1 / 19

Integrating Shaders into the Vision Rendering Engine

Shader Study 2007.5.30 이동현. Integrating Shaders into the Vision Rendering Engine. Vision engine. http://www.trinigy.net/ Games Helldorado The Show Warlord. Shaders in the Vision Engine. Multi-platform game engine. Shaders in the Vision Engine. Effects Fallback

keaton
Download Presentation

Integrating Shaders into the Vision Rendering Engine

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Shader Study 2007.5.30 이동현 Integrating Shaders into the Vision Rendering Engine

  2. Vision engine • http://www.trinigy.net/ • Games • Helldorado • The Show • Warlord

  3. Shaders in the Vision Engine • Multi-platform game engine

  4. Shaders in the Vision Engine • Effects • Fallback • Fallbacks are alternative, usually simpler, versions of a complex shader that are used whenever the hardware requirements for a shader version higher up in the hierarchy are not met.

  5. Shader tool in V.6.0

  6. Assigning Shaders to Geometry • Static Effects • Statically assigned by the artists. • Do not need to be updated, removed, or replaced in runtime. • Dynamic Effects • Volumetric fog • Dynamic lighting

  7. Dynamic Effects – point light Do not want to assign the shader to all the objects in a scene

  8. Shader assignment types • Shaders that are statically assigned by artists in the production tools: material properties, rendering styles. • Shaders that are dynamically assigned in the game code – for example, when highlighting selected objects. • Volume-based shader assignments-useful for dynamic lights, volumetric effects, and the like.

  9. Rendering order • Base pass • Base texture * static lighting • Ex) Objects that do not have dynamic light • Zcull • Save pixel processing power • Opaque objects • front-to-back in order to improve early Z rejection. • Translucent objects • Sorted back-to-front, to minimize visual artifacts. • Addition rendering passes • The problem of finding the right rendering order gets a little more complex.

  10. Rendering order – cont • There are shaders which have to be drawn before the usual base*lighting pass is rendered. • Cartoon outline shader – use vertex program to extrude the rendered geometry along the normal vectors. • Drawn as an additive blend pass after the base*lighting pass. • Such as additional rendering passes for dynamic lights. • Should be rendered after almost everything else. • For effect • Not properties of the rendered surface itself, but rather properties of the space between the rendered surface and the camera.

  11. Rendering order – cont • A bad idea • If static geometry is actually behind the translucent primitives? • All effects on translucent primitives would have to be rendered right after rendering the primitive itself. – not very feasible due to performance reason.( too many state changes ) • Render the effects passes separately for opaque and translucent primitives.

  12. Rendering order – cont • As long as the artists know how to handle translucent geometry and are aware of the fact that there are limitations to be considered, a loop like the above one will be sufficient. • The problem that still has to be solved is the rendering order between the base pass and the shaders applied to the same geometry. • Multi-pass rendering with multiple shaders. • Render pass property is set to each fallbacks. • This way, it is possible to render to render the cartoon outlines mentioned above before the base pass is drawn, and if the geometry is illuminated by a light source, a lighting shader can be rendered on top of the base pass. • Using a sorting key ensures that the fog is always rendered last.

  13. Shader Callback Functions • Per-frame callback function. • Per-primitive callback function. • Called for each single triangle but rather on batches of triangles. • Fur shader. – the shader loops through each single shell and increases the normal extrusion distance in each iteration.

  14. Reducing Overhead for State Setup • Shader-based rendering pipeline • Batching triangles with the same shader setup • Reducing state setup changes. • A sorting key encoded into a single 64-bit value. • Int64 iKey = (iUserKey<<48) | (iDistance<<16) | iStateSetupID; • The batches might differ in their individual diffuse base texture

  15. Textures • Procedurally generated textures into the shader system of the Vision Engine. • Custom modifier functions have to be implemented and registered and can finally be accessed in the shader definition. • Examples • Converting height maps to vector maps( though for fine details, using dedicated art tool plugins is recommended) • Normalization cubemaps. • All kinds of gradients and characteristic functions for texture lookups. • Cel shading lookups with dedicated mipmap levels. • Creating texture alpha channels for texture “color key” emulation.

More Related