Tips For Developers: The Deadly Light on news worldwide.

News : AMERICAS : Hi-Tech, Software, Downloads, Hardware, Computers breaking news


search on current category and in current geographical place

CURRENT NEWS ITEM: TIPS FOR DEVELOPERS: THE DEADLY LIGHT


Tips For Developers: The Deadly Light

Tips For Developers: The Deadly Light

by Yakov Sumygin

Tips on optimization of applications for Intel GMA X3000- X3100

  • The latest Intel video adapters are limited in terms of pixel rendering speed. Thus, it is necessary to provide the user with an opportunity to change game settings, e.g. resolution, shadow support and quality. Another consequence is an advantage of complex single-threaded shaders over multithreaded shaders. That means an ability to render several light sources in a single thread, select more important light sources, and disable those sources that don’t affect the object.
  • Using Early Z clipping. For multithreaded algorithms, it is preferable firstly to render all visible object into the Z-buffer, having disabled rendering to the frame buffer, after which to change Z—test to equal and to render brightness for really visible objects only. This is especially necessary because GMA X3000 has the Early Z function which can discard a pixel that didn’t pass the Z-test before sending it to the shader or to Render Target. Also for improved performance objects can be sorted and rendered “front-to-back”.
  • GMA X3000 supports Occlusion Query, i.e. the display adapter can be prompted for an object’s visibility. An object’s box needs to be rendered after disabling the filling of the rendering buffer and the Z-buffer, and then query results have to be processed. The object’s grid itself should be complex enough to warrant additional rendering for the test.
  • For the early discarding of non-lit pixels rendering to the stencil buffer of the light source’s model can be used. For instance, for omni light it will be a sphere, for a spot source – a sphere section. Lit pixels can be marked using the Z-fail Carmack algorithm for shadows rendering. The two-sided stencil that now is supported by almost all display cards should be especially useful.
  • As Intel’s integrated adapters use the main memory it is necessary to lower the load on the memory. To this end, if possible, compressed textures should be used, when creating an object D3DPOOL_MANAGED or D3DPOOL_DEFAULT flag should be inserted into memory, the user should be provided with an ability to change textures’ quality necessarily using textures’ and objects’ level of detail.
  • To use an efficient method for clipping hidden areas, such as Portals or Binary Separation Planes (BSP).

  • Defer
    red Shading

    Until recently, all graphics engines used Forward rendering. For the rendering of an object lit by several light sources the object was rendered once for each source with the ADD blending mode on. Also for each light source shadows were calculated and light wasn’t rendered in shaded areas. Usually bump maps were used, as well as specular maps (maps of reflected light). A shining example of such an engine is idTech 4, earlier called Doom3 engine. As exemplified by this game the disadvantages of this approach can be seen. If bump mapping is disabled a very simplified levels’ geometry is visible. Moreover, the engine has a limitation on the number of light sources per object.
    All this because of a significant load on vertex transformations and rasterization.

    The solution to this problem lies in Deferred Shadering.

    The essence of the algorithm is to place geometrical data of an object into several special textures which are used for lightening thereafter. That is an object is rendered only once.

    Now let us look at it step by step:

  • Create 3 float32 textures (supported starting with GeForce 6xxx)
  • In the iteration of rendering cycle, set the textures as currently rendered using MRT (Multiple Render Targets)
  • Render all visible objects into the set textures. Let us have a detailed look at what is being rendered and whereto. Coordinates of a point in view space go to the first texture (I will explain why view space later). A normal of a point also in view space goes to the second texture. An object’s diffused texture goes to the third texture. We have w coordinates of the textures left which can be used for gloss maps and additional objects.
  • Lightening steps. For each visible light source a rectangular is rendered on a display covering this source with a defined special shader. Also the textures filled in the previous step should be defined. Coordinates, normals, and albedo (diffused texture) are extracted in the shader. After that standard pixel lightening operations are used – calculation of diffused lightening, specular component, light dimming calculation.
  •  

    Advice on optimization and details:

  • Using view space – a point is stored in the view space for more accurate and optimized calculation.
  • Rendering a light source model into the stencil buffer before calculating the illumination for marking the pixels lit with this source. A simple pixel shader operates like stencil shadows (algorithm Carmack). For instance, in case of a sphere-like light source a sphere is rendered into the stencil.
  • Shadow maps for soft shadows. When using shadow maps it is necessary to solve the problem of omni (sphere) light sources. I have solved this problem by replacing an omni source with 6 spot sources. To achieve the effect of softness for now a simple PCF is used – blending of adjacent pixels of the shadow map.
  •  

    Convenient multithreading

    Convenient and safe multithreading can be achieved by the division of an application into several modules communicating with each other using messages. Windows uses this model, but it isn’t convenient enough. It is necessary to compile a message handler, to create identifiers  etc. etc. I have compiled a basic subsystem class where boost functors function as messages. Functors enable us to save and postpone the call of a function with parameters. This is an RPC (remote procedure call) of sort based on С++. Now in order to call a function from another thread it is necessary to set an example: physics.post_msg(&CPhysics::SetPlayerPosition, position), the call of a function will be placed in a queue and the messages queue will be executed in the next iteration of the thread. A function’s parameter will be copied automatically, and as a consequence there won’t be any problems with the synchronization access to memory. A system for the transmission of functions’ calls over the network also can be improved.

    Advice on optimization and details:

  • If multithreading isn’t needed this system can be used in a single-threaded application. In my engine this procedure is static, i.e. to switch between the modes recompilation is needed. This done for performance reasons. In this case the compiler optimizes a code and there are almost no functions call overheads.
  • The subsystem operates in a separate thread depending on a special compilation key.
  • It looks like this:
  • Execution of a queue of messages

  • The system is fully based on С++  and boost, and thanks to that it is transferable to other platforms.

  • Support for a wide range of display adapters
    .

    To support different hardware it is necessary to work with rendering through an interface – an abstract basic class. To develop different basic interface threads for adapters with different capabilities. The engine supports 3 methods of lightening: Deffered Shading for modern adapters with Shader Model 3.0 support such as Intel X3500 (G35), Doom3 adaptive illumination for the previous generation of adapters, and lightening with recalculated illumination maps.

    Pixel by pixel lightening without pixel shaders.

    Modern lightening consists of the following components: pixel by pixel fading, pixel bump mapping, shadows. All this can be achieved even it an adapter doesn’t support pixel shaderes. Dimming can be achieved using the rendering of two textures of dimming into the alpha buffer, stencil shadows don’t require pixel shaders, pixel by pixel bump mapping may be implemented using integrated  DirectX Dot3 texturing (D3DTOP_DOTPRODUCT3 flag). All this is supported by Intel’s early generations integrated graphics adapters such as Intel® 82810, 82815, 82830M, 82845G.

    Mobile gaming support.

    To support gaming on a mobile device Intel Laptop Gaming TDK library  can be very useful. In this library in a friendly interface power level control, connection level, and processor load control functions are accumulated. I have added a simple manager that makes it even easier to work with these functions.

    Here is the external interface:

    Upon initialization the manager calculates the number of processors, upon the refreshment it calculates power level and connection quality. When power decreases to the threshold level the manager shows the corresponding message window.

    It is also possible to lower the load on the graphics adapter and the processor if the user unplugged the mains cable from the laptop. For instance, by lowering the quality of shadows and disabling certain effects.

    Advice on optimization: information about the level of load on processor is very slow. Frames per second drop approximately three-fold, for this reason this function should be called not more than once per 3 seconds.

    A technology for moving bots in the shadow.

    In the Deadly Light project it was necessary to implement the movement of characters which don’t carry light. To this end I have decided to calculate the brightness of a character in every point of the way. When a level is loaded the way point brightness is calculated.

    Brightness is calculated as follows:

  • For each point all light sources that illuminate it are calculated.
  • For each light source ray casting from a way point to the light is carried out, and if this ray intersects something that means that the point is in the shadow.
  • The level of illumination from each source is summed.
  • For static sources the level of illumination is stored for dynamic – is recalculated each time.
  • The level of illumination is calculated in a character’s box points.
  • When calculating a route for a zombie (A*) for the movement to lit points higher weights are defined so that the zombie would avoid lit routes. Now the zombie will avoid the torchlight and lit areas, but if necessary it can jump over these areas at the expense of its health.

Add post to: BlinklistBlogmarksdel.icio.usDiggMa.gnoliaMy Web 2.0NewsvineRedditSegnaloSimpySpurlWistsTechnorati

TOP - 50 RELEVANT BREAKING NEWS

  1. Study sheds light on deadly childhood cancer

    LONDON (Reuters) - A gene involved in cell division also helps fuel a deadly childhood cancer called neuroblastoma and could offer a new way to develop drugs to treat the disease, German researchers said on Monday.

  2. Test-Drive Turns Deadly

    Customer allegedly pushes salesman from a moving truck during a test-drive.

  3. Sir Anthony Caro: Light for darkness

    Reduced to a shell in the Second World War, the choir of a Gothic church in northern France was bricked up and hidden from view for half a century. Its resurrection, at the hands of the abstract sculptor Sir Anthony Caro, sparked another battle, this time between traditionalists and modernists, that took nine years to resolve. By Mick Brown.

  4. Hiddink tips his hat to Germany

    Italy may have broken the Westfalenstadion myth two years ago but Guus Hiddink knows Russia face an extra challenge when they play Germany in Dortmund on Saturday in a crucial 2010 FIFA World Cup Group 4 qualifier.

  5. PERU: Shining Path guerrillas launch deadly ambush

    In its deadliest attack in 10 years, Shining Path guerrillas clashed with the Peruvian military in an important coca-growing region in southeast Peru, killing at least 18 people.

  6. Man quizzed over deadly robbery

    Tom Brady

  7. Deadly earthquake hits Chechnya

    An earthquake kills at least 13 people and injured 100 more near the Chechen capital Gozny, officials say.

  8. Deadly missile strike reported in Pakistan

    Read full story for latest details.

  9. EARTHQUAKE: Deadly quake hits Chechnya

    An earthquake rocked the northern Caucasus killing at least 12 people in eastern Chechnya and injuring many more. Hundreds of inhabitants of the restive Russian province were left sheltering in tents on the eve of regional elections.

  10. Top developers see asset values dive two-thirds

    The value of property assets held by prominent developers has collapsed to ruinous levels, the Sunday Independent can reveal.

  11. Deadly quake strikes Chechnya

    At least 12 people were killed Saturday in an earthquake in Russia's Chechnya region, Russian news agencies reported.

  12. Deadly blasts rock Baghdad

    Oct. 12 - Car bombers target Shi'ite neighbourhoods in the Iraqi capital in weekend attacks.

  13. 10 tips for IT leaders to succeed during tough economic times

    Managing your business and your career during tough times requires you to focus on the right stuff, both professionally and personally. Cisco CTO Padmasree Warrior recently shared her tips for leaning into the current economic headwinds. Take a look and then add your advice to the discussion.

  14. Three tips for cost crunching network projects without loss of quality

    With the economic climate as it is, many organizations are being pressed to do offer more with less, and the network is no exception. This blog offers a few ways that savings can be made on network projects. Even though numbers may be down or budgets cut mid-year, the network is still must go on with a critical role to the organization. Further, this may include new projects and new functionality. Here are a couple ways to realize some quick savings on network projects that can still provide a quality product. Insourced labor For new installations that require cable runs and terminations, the single biggest savings gain may be in doing the work internally. In lieu of calling a vendor to do the ...

  15. ANZ gets Vietnamese green light

    ANZ Bank is cementing its presence in Vietnam after getting a licence from the State Bank of Vietnam to set up a wholly-owned bank to be run out of Hanoi.

  16. Midas share tips: BP, Shell, Vodafone and Aviva yields look good

    Financial markets are said to be motivated by fear and greed - and nowhere is this more apparent than in the behaviour of the banking sector

  17. Deadly blaze likely caused by fire play

    A blaze that claimed the lives of a couple and their three children in a Manhattan apartment was caused by a child playing with matches or a lighter, fire marshals said Monday.

  18. Light winds keep Volvo Ocean Race voyagers in a bunch

    Fewer than 19 miles separated the first six boats at the front of the Volvo Ocean Race.

  19. Light rule needs new vision

    FOX Sports cricket commentator Brendon Julian runs his rule over the final day's play in Bangalore.

  20. Microsoft woos developers under the Silverlight

    As it releases Version 2.0 of Silverlight, Microsoft is turning to the next phase of its strategy: directly wooing developers and designers to the rich Internet platform.

  21. Tips to ensure safe autumn driving

    The Institute of Advanced Motorists (IAM) has compiled a list of tips to make sure that Brits drive safely on autumn roads.The motoring organisation advises that fallen leaves tend to accumulate near roadside gutters.It is best to remember that this

  22. Warning: Deadly L.A. Blaze Is On The Move

    Residents near Los Angeles are being warned to stay on alert during the night as two huge wildfires burn in parts of the San Fernando Valley.

  23. Rays light up Lester, Byrd with long ball

    B.J. Upton's three-run home run in the third inning Monday was the first of four dingers by the Tampa Bay Rays, who breezed to a 9-1 win over Boston in Game 3 of the American League Championship Series.

  24. Today's racing tips 14/10/08

    BEV SWINGELL is the principal tipster for the Daily Express and Sunday Express, and for the last 20 years he has been acknowledged as one of the top private handicappers in England.

  25. Ten tips that are not to be sniffed at

    Listen carefully and you'll hear it. A cough here, a snuffle there: it's the insidious return of the dreaded winter cold. Marisa Duffy looks at ways to give your immune system a boost.

  26. Texas Ghostbusters See the Light

    Mike and Dee-Dee McCaskill say images of unexplained lights are poltergeists.

  27. Deadly Wildfires Force Frantic Evacuations

    Two die as Santa Ana winds whip up fires, threatening homes for miles.

  28. Child's Play Caused Deadly NYC Blaze

    Seven people were killed in two fire; deadliest NYC weekend in years.

  29. State of Emergency in Los Angeles as Deadly Wildfires Rage

    Two huge wildfires driven by strong Santa Ana winds burned into neighborhoods near Los Angeles on Monday, forcing frantic evacuations on smoke- and traffic-choked highways, destroying homes and causing at least two deaths.

  30. Cases: Always a Doctor, Even in the Dying of the Light

    My father took pride in keeping up with the latest in medicine, and the functions of his body were fascinating to him in a detached, scientific way.

  31. Top 10 tips for encouraging mroe website traffic

  32. Gratuity guide: Worldwide tips on tipping

    How much to tip, and when? What’s standard in America might be taboo in Japan. Find the answers with T+L’s guide to gratuities around the world.

  33. Small developers relocating to other sectors

    The rental rates of commercial property have soared in Chandigarh, thus forcing the small developers to shift to other sectors. The number of vacant sites in sector 8 and 9 has increased. "The benchmark for rentals has increased manifold over

  34. Picture This: Light Reading

  35. A Few Tips on Direct Advertising for Your Site

    1. Before looking for direct advertisers, read your site.I say read your site first before attempting to contact companies. Why? Well, you have to ask yourself, is my site worth advertising on? You can't expect a direct advertiser to sign up on a pro-bono case. If you are just starting out in this business, don't expect to reach the brightest stars. Settle for small companies or sites until you have established the popularity and credibility of your site.    

  36. DA: Driver of deadly bus crash wasn't intoxicated

    SACRAMENTO, Calif. (AP) -- Prosecutors say the driver of a charter bus that crashed earlier this month in northern California wasn't drunk or on drugs at the time....

  37. Politkovskaya's lawyer finds car filled with deadly mercury

    A Russian human rights lawyer whose clients have included leading Kremlin opponents said Tuesday that she had found poisonous mercury in her car in France and believed it may have been a warning to her.

  38. Old teammates united to fight deadly mystery

    Fifty-one former Italian soccer players have died of motor neurone disease. No-one knows why. Last week, an array of former stars played in Florence to raise money for a research charity set up by Stefano Borgonovo, a former player now confined to a wheelchair.

  39. KUDLOW: Light at the end of the financial crisis

    Fear and panic have taken over the stock market, the banking system and the economy. It is one of those moments in history when people feel helpless, frustrated and bewildered about what's going on and why it's happening.

  40. Looking for A New Plan? Here Are Some Tips.

    The rise in health insurance premiums is slowing a little, but you can still expect to pay 5 to 9 percent more next year for work-based health insurance. As you head into open-enrollment season, here are some tips on how to stay a few dollars ahead of rising costs:1. Don't Shop on Premium...

  41. 3 Simple Tips to Make Your Website User-Friendly

    Some smaller, often overlooked, areas that shouldn't be forgotten to make your website user-friendly.

  42. Intelligent Light's Fieldview

    Powerful CFD and CAE post-processing from FIELDVIEW quickly identifies important flow features and characteristics and allows interactive exploration to develop a thorough understanding. Examine and compare cases, extract critical values, and make compelling presentations that make an impact. Use FieldView to gain full understanding...automate & optimize...prove your point. FieldView has been chosen by more engineering analysts than any other dedicated post-processor and has built its success on meeting the needs of mission-critical CFD. Getting started with FieldView is easy using the free demo version or a complimentary evaluation to explore your own data.

  43. Tips for staying safe this Autumn

    With the clocks going back on 26th October and Halloween and Bonfire night not far away, Kent Police are urging people to stay safe this Autumn.

  44. Deadly Creatures Screens

    15 new shots posted.



SYNDICATION


Subscribe to our RSS (Really Simple Syndication) feeds to get news delivered directly to your desktop or web-site!


ADVERTISEMENTS



PCT: 1.010 s.