Difference between revisions of "Talk:New graphical pipeline"

(Work in progress)
(tasks)
 
Line 35: Line 35:
 
* Properly re-implement specular light
 
* Properly re-implement specular light
 
* Decide what we activate as default. Auto-detect would be ideal
 
* Decide what we activate as default. Auto-detect would be ideal
* Soft particles (detailed article [[new particle engine|here]])
+
* Soft particles (detailed article [[Talk:New particle engine|here]])
  
 
== Shader overview ==
 
== Shader overview ==

Latest revision as of 22:51, 8 September 2016

Supertuxkart > 0.8.1 has a completely new graphical pipeline based on Shaders [1]. Making a track for the new pipeline follow a completely new philosophy. Look at Antarctica: Technical Details for technical information about the new pipeline.

Features

Implemented

  • Probably the most important feature :) Deferred lighting (A new per pixel 100% dynamic lighting system) [2]
  • Space Screen Ambient Occlusion (SSAO) [3]
  • Deformation through transparent objects (like when you see something underwater)
  • Lens flare (don't abuse please ^^) [4]
  • Glow [5]
  • Outline for items[6]
  • Bloom
  • High Dynamic Range (HDR) [7]
  • Rim light for karts
  • Detail map
  • Improved water (caustic, new water shader)
  • A wind parameter that affect the vegetation, water waves, etc
  • Color correction

Work in progress

Planned

  • Interactive vegetation (the grass can be crushed by the kart)
  • ...

tasks

  • The flag in the materials editor to make an object ignored by light (flat, full brightness) or fog no longer works (see Fort Magma cave, the walls and floor shouldn't be affected by shadows). This is possible by putting them in the transparent pass
    • Having an object affected by fog but not light, or vice-versa. Excessively unimportant, I don't think we have a single case of this in our current tracks, usually what is useful is to disable both light and fog together, for instance on billboard halos
  • Samuncle points out we will need to write a basic illumination and fog shader for transparent objects, which currently are unaffected by the lighting system and the fog. This is just to avoid transparent objects looking out of place, they are few enough that it doesn't need to be elaborate. Perhaps we can make a very basic uber shader to avoid code duplication among shaders.
  • Make glow configurable
  • Vertex colors no longer work. Cand says this was an intended change of his when a texture is present, to save VRAM. We need to decide if we want them back or not.
  • Shadows
  • Properly re-implement specular light
  • Decide what we activate as default. Auto-detect would be ideal
  • Soft particles (detailed article here)

Shader overview

Generic shader

Here is a list of things that should be present in the generic solid shader (view from blender). This shader is used by 90% of objects present in STK

  • Textures
    • Detail diffuse map: RGB texture to define the surface's details
    • Generic Diffuse map: RGB texture to define the surface's main colour.
    • Glow map: RGB texture to define where the object should glow
    • Generic Specular map: A Black and white texture to define the surface's specularity
    • Normal map: RGB texture to define the normal of the object
  • Rendering parameter
    • Ignored by light: bool
    • Ignored by fog: bool (to be defined if it's possible in the new pipeline
    • Specular exponent: float
    • Specular color: float, float float (For surface like metal)
    • Blending mode between Generic and detail diffuse map: (Additive, multiply, Overlay, Hard light)
    • Blending opacity: float (a value that define the blending opacity between Generic and detail diffuse map
    • Clamp texture vertically: bool
    • Clamp texture horizontally: bool
  • Physical parameter
    • Falling effect: bool
    • High tire adhesion: bool
    • Ignore: bool
    • Particle effect when skid and drive over it: VFX file
    • Sound effect: SFX file
    • Reset kart on drive: bool
    • Water bottom: bool
    • Water surface: bool
    • Zipper:(multi parameter)

Displacement

The displacement is an effect to deform something behind a transparent object (like glass, water or a fire). It will be used for heat distoriton, the water shader, glass panel, lava, etc.

Current implementation

The current implementation works that way:

  • It must be a separate object (it's per object not per material)
  • The object can be textured or not. The texture might be solid, alpha blend or additive blend, etc.
  • The first UV layout define the layout of the object's texture (if it has one) and the layout of the distortion texture. If you change its, it will change two things: A) the aspect of the textured object B) the aspect of the distortion
  • The distortion texture can't be changed
  • A second UV layout MUST be created. The second UV layout define the intensity of the distortion. Used to make a fade out (for a fire for instance). If a coordinate in the second UV layout is near 0.5 X,Y the effect is maximal. Otherwise it's faded until 0

Proposed implementation

I (samuncle) propose this implementation

  • It's a per object effect (so it's compatible with all material shader)
  • The object can be textured or not
  • The first UV layout is for the standard texture only
  • The second UV layout is for the displacement texture. The displacement texture is per object.
  • Vertex color are used to fadeout the effect (like the transition between the beach and water)
  • You can choose the speed of the displacement. For instance for a glass panel the displacement texture shouldn't move