Changeset 2376 for GTP/trunk


Ignore:
Timestamp:
05/16/07 08:33:51 (17 years ago)
Author:
szirmay
Message:
 
Location:
GTP/trunk/App/Demos/Illum/Ogre/Media
Files:
6 added
4 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/App/Demos/Illum/Ogre/Media/MORIA/MoriaHallBase.hlsl

    r2373 r2376  
    4141 
    4242uniform float specularity; 
     43uniform float4 specularColor; 
    4344 
    4445 
     
    9697//light1                 
    9798        //light dir 
    98         float3 L = wLightPos1.xyz - IN.wPos * wLightPos1.w; 
     99float3 L; 
     100float4 col; 
     101float3 lightCPos; 
     102float shadow; 
     103 
     104if(dot(lightColor1, lightColor1) != 0) 
     105{ 
     106        L = wLightPos1.xyz - IN.wPos * wLightPos1.w; 
    99107        //illumination 
    100         float4 col; 
    101         col = Illumination(N, L, V, lightColor1 * lightPower1, lightRange1, diffuseColor, specularity); 
     108        col = Illumination(N, L, V, lightColor1 * lightPower1, lightRange1, diffuseColor, specularity, specularColor); 
    102109        //shadowing      
    103         float3 lightCPos = mul(LightView1, float4(IN.wPos, 1)).xyz; 
    104         float shadow = shadowPoint(ShadowMap1Point, lightCPos, lightFarPlane1); 
     110        lightCPos = mul(LightView1, float4(IN.wPos, 1)).xyz; 
     111        shadow = shadowPoint(ShadowMap1Point, lightCPos, lightFarPlane1); 
    105112        Color += col * shadow;   
     113} 
    106114 
    107115//---------------------------------------------------------------------------------------------------------------- 
    108116//light2                         
     117/*if(dot(lightColor2, lightColor2) != 0) 
     118{ 
    109119        //light dir 
    110120        L = wLightPos2.xyz - IN.wPos * wLightPos2.w; 
    111121        //illumination 
    112         col = Illumination(N, L, V, lightColor2 * lightPower2, lightRange2, diffuseColor, specularity); 
     122        col = Illumination(N, L, V, lightColor2 * lightPower2, lightRange2, diffuseColor, specularity, specularColor); 
    113123        //shadowing      
    114124        lightCPos = mul(LightView2, float4(IN.wPos, 1)).xyz; 
    115125        shadow = shadowPoint(ShadowMap2Point, lightCPos, lightFarPlane2); 
    116126        Color += col * shadow;   
     127}*/ 
    117128         
    118129        //do Path Map to gather indirect illumination 
    119130         
    120         float4 indirect = PathMapIndirect(PathMap, WeightIndexMap, WeightMap, IN.texCoord2.zw) * 1.2; 
    121         indirect *= diffuseColor; 
    122         Color = Color + indirect; 
     131//      float4 indirect = PathMapIndirect(PathMap, WeightIndexMap, WeightMap, IN.texCoord2.zw) * 1.2; 
     132//      indirect *= diffuseColor; 
     133//      Color = Color + indirect; 
    123134         
    124135        //gather caustics for all casters 
  • GTP/trunk/App/Demos/Illum/Ogre/Media/MORIA/illum.hlsl

    r2373 r2376  
    11 
    2 float4 Illumination(float3 N, float3 L, float3 V, float4 lightColor, float4 lightRange, float4 diffuseColor, float specularity) 
     2float4 Illumination(float3 N, float3 L, float3 V, float4 lightColor, float4 lightRange, float4 diffuseColor, float specularity, float4 specularColor) 
    33{ 
    44        // Blinn lighting 
     
    88        float4 Lighting = lit(dot(N, L), dot(N, H), specularity); 
    99         
    10         return   lightColor * (Lighting.y * diffuseColor + Lighting.z) //color 
     10        return   lightColor * (Lighting.y * diffuseColor + Lighting.z * specularColor) //color 
    1111                         / (lightRange.y + d * lightRange.z + d * d * lightRange.w) //attenuation 
    1212                         ; 
     
    6464         
    6565        float3 col = 0; 
    66         for(int iCluster = 0; iCluster < 32; iCluster++) 
     66        for(int iCluster = 0; iCluster < 8; iCluster++) 
    6767        { 
    6868                float2 prmTexPos = float2( 
  • GTP/trunk/App/Demos/Illum/Ogre/Media/MORIA/moria.material

    r2373 r2376  
    2121                        IllumTechniques 
    2222                        { 
    23                                 RenderTechnique PathMap 
    24                                 { 
    25                                 new_passes false 
    26                                         start_tex_id 3 
    27                                 }        
     23                                //RenderTechnique PathMap 
     24                                //{ 
     25                            //  new_passes false 
     26                                //      start_tex_id 3 
     27                                //}      
    2828                                RenderTechnique DepthShadowReceiver 
    2929                                { 
    30                                         max_light_count 2 
     30                                        max_light_count 1 
    3131                                        set_light_viewproj false 
    3232                                        set_light_view true 
     
    5656                          param_named_auto lightColor1 light_diffuse_colour 0 
    5757                          param_named_auto lightColor2 light_diffuse_colour 1 
    58                           param_named specularity float 120 
     58                          param_named specularity float 20 
     59                          param_named specularColor float4 0.2 0.2 0.2 0.2                         
    5960                        } 
    6061                        texture_unit tile_texture 
  • GTP/trunk/App/Demos/Illum/Ogre/Media/MORIA/troll.material

    r2368 r2376  
    8484} 
    8585 
     86material trollCameraDepth 
     87{ 
     88        technique 
     89        { 
     90                pass 
     91                { 
     92                        vertex_program_ref TrollSkinningSMGen 
     93                        { 
     94                                param_named_auto worldMatrix3x4Array[0] world_matrix_array_3x4 
     95                                param_named_auto viewProjectionMatrix viewproj_matrix 
     96                                param_named_auto viewMatrix view_matrix                          
     97                        }                    
     98                        fragment_program_ref GTP/Basic/CDepth_PS 
     99                    { 
     100                        param_named_auto farplane far_clip_distance 
     101                    }   
     102                } 
     103        } 
     104} 
     105 
    86106material trollBase 
    87107{ 
     
    95115                                { 
    96116                                        ILLUM_TRIGGER_SM_POINT trollShadowMapGen_POINT 
     117                                        ILLUM_TRIGGER_CAMERADEPTH trollCameraDepth 
    97118                                } 
    98119                        } 
Note: See TracChangeset for help on using the changeset viewer.