Sommaire

Rendering pipeline



Rendering pipeline : Definitions.

3 types of WorldObjects.

    Fixed

        Interior (empty)

        Interior (plain)

        Exterior

    Morphing

    Bones trees (1024 keys animation)

More type of Additionnals.

    Interior

    Exterior

    Morphing

    Combinaison with Environment Mapping



Rendering pipeline : Lighting.

Per object or per texture as material :

    context.ambient

    context.light

    context.daylight

    context.lightandamb

    context.lightwithshadowone

    context.lightwithshadowfourty

    context.lightwithshadowspotlight

    context.lightwithshadowspot

    + shadow_zbuffer and shadow_mapping (stencil)


Scripting functions :


    int resetWorldShaderContext(int n)

    int setWorldShaderContextAmbient(int wo,int shd)

    int setWorldShaderContextLightSpotMapping(int wo,int shd)

    int setWorldShaderContextLight(int wo,int shd)

    int setWorldShaderContextDaylight(int wo,int shd)

    int setWorldShaderContextLightAndAmbient(int wo,int shd)

    int setWorldShaderContextLightShadowOne(int wo,int shd)

    int setWorldShaderContextLightShadowFourty(int wo,int shd)

    int setWorldShaderContextLightShadowSpotlight(int wo,int shd)

    int setWorldShaderContextLightShadowSpot(int wo,int shd)

    int setWorldShaderContextZBuffer(int wo,int shd)

    int setWorldShaderContextZBufferMapping(int wo,int shd)


    int resetAddedShaderContext(int n)

    int setAddedShaderContextAmbient(int wo,int shd)

    int setAddedShaderContextLightSpotMapping(int wo,int shd)

    int setAddedShaderContextLight(int wo,int shd)

    int setAddedShaderContextDaylight(int wo,int shd)

    int setAddedShaderContextLightAndAmbient(int wo,int shd)

    int setAddedShaderContextLightShadowOne(int wo,int shd)

    int setAddedShaderContextLightShadowFourty(int wo,int shd)

    int setAddedShaderContextLightShadowSpotlight(int wo,int shd)

    int setAddedShaderContextLightShadowSpot(int wo,int shd)

    int setAddedShaderContextZBuffer(int wo,int shd)

    int setAddedShaderContextZBufferMapping(int wo,int shd)

    int setAddedShaderContextEdgesDG(int wo,int shd)


    int resetMaterialShaderContext(int wo)

    int setMaterialShaderContextAmbient(int wo,int shd)

    int setMaterialShaderContextLightSpotMapping(int wo,int shd)

    int setMaterialShaderContextLight(int wo,int shd)

    int setMaterialShaderContextDaylight(int wo,int shd)

    int setMaterialShaderContextLightAndAmbient(int wo,int shd)

    int setMaterialShaderContextLightShadowOne(int wo,int shd)

    int setMaterialShaderContextLightShadowFourty(int wo,int shd)

    int setMaterialShaderContextLightShadowSpotlight(int wo,int shd)

    int setMaterialShaderContextLightShadowSpot(int wo,int shd)

    int setMaterialShaderContextZBuffer(int m,int shd)

    int setMaterialShaderContextEdgesDG(int m,int shd)

    int setMaterialShaderContextZBufferMapping(int m,int shd)



Rendering pipeline : Optionnal parameters.

Scripting functions for vertex shaders and pixel shaders:

    int setWorldVSParam(int wo,float x,float y,float z,float w)

    int setAddedVSParam(int wo,float x,float y,float z,float w)

    int setWorldPSParam(int wo,float x,float y,float z,float w)

    int setAddedPSParam(int wo,float x,float y,float z,float w)



Rendering pipeline : Lighting generality.

Data access to procedurally animations : additionnals

    Position coo.xyz

    Rotation rot.xyz (in degrees)

Data access to procedurally animations : clones

    Position coo.xyz

    Rotation rot.xyz (in degrees)

Data access to procedurally animations : draw(*)draw

    Object, Tree, Morph

    Position coo.xyz

    Rotation rot.xyz (in degrees)


Data access to general lighting

    Ambient

    Ambient Interior

    Daylight: vector, color, falloff

    OmniLights: full params

    Anim Script per Additionnals with 2 lights



Rendering pipeline : Shaders with shadow maps.

Vertex Shader :

    MATRIX REF;

    VECTOR LIGHTPOS;

    VECTOR MULTI;

    ldir = pos - LIGHTPOS;

    "dist" = norme( ldir.xyz );

    posi = pos *4 REF;

Pixel Shader :

    posi = coord(Tex2);

    div.w = reciprocal( posi );

    posi.xy = posi.xy * div.ww;

    posi.xy = ScaleToSecondary(posi.xy);

    d.x = calcshadow(posi,"dist");

 

    float calcshadow(vec4 pos,float zval)

    {

      tmp = sample(2,pos.xy);

      tmp = RGBToValue(tmp);

      tmp.r = zval - tmp.x;

      tmp = cmp(tmp.r,pszero,psone);

      tmp.x = BoundsViewIntegrate(pos);

      tmp.x;

    };

 

    ValueToRGB(x) and RGBToValue(x) to convert shadow map values.