Changeset 2054


Ignore:
Timestamp:
01/24/07 21:44:30 (17 years ago)
Author:
szirmay
Message:
 
Location:
GTP/trunk/App/Demos/Illum/Ogre/Media/materials
Files:
22 added
15 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPBasic/GTPBasic.program

    r2024 r2054  
    5050   entry_point VPos 
    5151   target vs_1_1 
     52} 
     53 
     54vertex_program GTP/Basic/MPos_VS hlsl 
     55{ 
     56   source GTPBasic_VS.hlsl 
     57   entry_point MPos 
     58   target vs_1_1 
     59}    
     60 
     61vertex_program GTP/Basic/MPos_NoTransform_VS hlsl 
     62{ 
     63   source GTPBasic_VS.hlsl 
     64   entry_point MPos_NoTransform 
     65   target vs_1_1 
    5266}    
    5367 
     
    5670   source GTPBasic_VS.hlsl 
    5771   entry_point CPos 
     72   target vs_1_1 
     73} 
     74 
     75vertex_program GTP/Basic/Shaded_CPos_VS hlsl 
     76{ 
     77   source GTPBasic_VS.hlsl 
     78   entry_point Shaded_CPos_VS 
    5879   target vs_1_1 
    5980} 
  • GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPBasic/GTPBasic_VS.hlsl

    r2024 r2054  
    153153} 
    154154 
     155struct MPos_OUT 
     156{ 
     157 float4 VPos : POSITION; 
     158 float4 MPos : TEXCOORD0; 
     159}; 
     160 
     161MPos_OUT MPos(float4 position : POSITION0, 
     162              uniform float4x4 WorldViewProj) 
     163{ 
     164 MPos_OUT OUT; 
     165 OUT.VPos = mul(WorldViewProj, position); 
     166 OUT.MPos = position; 
     167 return OUT; 
     168} 
     169 
     170MPos_OUT MPos_NoTransform(float4 position : POSITION0) 
     171{ 
     172 MPos_OUT OUT; 
     173 OUT.VPos = position; 
     174 OUT.MPos = position; 
     175 return OUT; 
     176} 
    155177 
    156178struct CPos_OUT 
     
    168190 OUT.CPos = mul(WorldView, position); 
    169191 return OUT; 
     192} 
     193 
     194struct Shaded_CPos_OUT 
     195{ 
     196 float4 vPos : POSITION; 
     197 float4 wNormal : TEXCOORD0; 
     198 float4 wPos    : TEXCOORD1;  
     199 float4 CPos    : TEXCOORD2; 
     200}; 
     201 
     202Shaded_CPos_OUT Shaded_CPos_VS(float4 position : POSITION, 
     203                               float4 normal : NORMAL, 
     204                               uniform float4x4 WorldViewProj, 
     205                               uniform float4x4 World, 
     206                                       uniform float4x4 WorldView, 
     207                               uniform float4x4 WorldInv) 
     208{ 
     209 Shaded_CPos_OUT OUT; 
     210 OUT.vPos = mul(WorldViewProj, position); 
     211 OUT.wPos = mul(World, position); 
     212 OUT.CPos = mul(WorldView, position); 
     213 OUT.wNormal = mul(normal, WorldInv); 
     214 return OUT;  
    170215} 
    171216 
  • GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPCaustic/GTPCaustic.hlsl

    r2024 r2054  
    256256 
    257257        if(mydist > dist + EPSILON) caustic = 0; 
    258         //caustic.rgb *= max(attenuation - mydist, 0.0) / attenuation; 
     258         
     259        caustic.rgb *= max(attenuation - mydist, 0.0) / attenuation; 
    259260                         
    260261        Color = caustic; 
    261         Color += attenuation; 
    262         Color.a = 1;     
     262        //Color += attenuation * 0.000000000001; 
     263        Color.a = 1; 
     264 
    263265        return Color; 
    264266} 
  • GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPCaustic/GTPCaustic.material

    r2040 r2054  
    4040     param_named_auto WorldView     worldview_matrix 
    4141     param_named_auto Proj          projection_matrix 
    42      param_named CauSpriteSize      float 20.0 
     42     param_named CauSpriteSize      float 20 
    4343   }  
    4444   fragment_program_ref GTP/Caustic/CauCube_PointSprite_PS 
    4545   { 
    46      param_named CausticColor float4          0.7 0.7 0.5 0.15 
     46     param_named CausticColor float4          0.7 0.7 0.5 0.3 
    4747   } 
    4848   texture_unit 
     
    9696                        { 
    9797                                update_interval         0 
    98                                 update_all_face true 
    99                                 distance_calc true 3.5                                   
     98                                update_all_face true                                                                     
    10099                        } 
    101100                        RenderTechnique DistanceCubeMap 
    102101                        { 
    103102                                update_interval         0 
    104                                 update_all_face true 
    105                                 distance_calc true 3.5                                           
     103                                update_all_face true                                                                             
    106104                        } 
    107105                        RenderTechnique CausticCaster 
    108106                        { 
    109                                 attenuation     0 
     107                                attenuation     1000 
    110108                                photonmap_resolution 32 
    111109                                caustic_cubemap_resolution 256 
     
    118116                         
    119117                 }       
    120              vertex_program_ref GTP/Basic/ShadedTex_VS 
     118         vertex_program_ref GTP/Basic/ShadedTex_VS 
    121119         {        
    122120            param_named_auto WorldViewProj worldviewproj_matrix  
     
    124122            param_named_auto WorldInv inverse_world_matrix 
    125123         }  
    126              fragment_program_ref GTP/EnvMap/Localized_Refraction_PS 
     124         fragment_program_ref GTP/EnvMap/Localized_Refraction_PS 
    127125         {  
    128126                    param_named_auto cameraPos camera_position 
  • GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPEnvMap/GTPEnvMap.hlsl

    r2040 r2054  
    2525 
    2626        // iteration 
    27         for( int i = 0; i < SECANT_ITERATIONCOUNT; i++ ) 
     27        for( int i = 0; i < SECANT_ITERATIONCOUNT ; i++ ) 
    2828        { 
    2929                float llp = length( l ) / readDistanceCubeMap( mp, l);          // |l|/|l’| 
     
    4343} 
    4444 
    45 struct ShadedTex_OUT 
     45 
     46struct Shaded_OUT 
    4647{ 
    4748 float4 vPos : POSITION; 
    48  float4 texCoord : TEXCOORD0; 
    49  float4 wNormal : TEXCOORD1; 
    50  float4 wPos    : TEXCOORD2;   
     49 float4 wNormal : TEXCOORD0; 
     50 float4 wPos    : TEXCOORD1;  
    5151}; 
    5252 
    53 float4 EnvMap_Default_PS(ShadedTex_OUT IN, 
     53 
     54float4 EnvMap_Default_PS(Shaded_OUT IN, 
    5455                                                uniform samplerCUBE CubeMap : register(s0), 
    5556                                                uniform float3 cameraPos) : COLOR0 
     
    6263} 
    6364 
    64 float4  EnvMap_Localized_Reflection_PS( ShadedTex_OUT IN, 
     65float4  EnvMap_Localized_Reflection_PS( Shaded_OUT IN, 
    6566                                                                                uniform samplerCUBE CubeMap : register(s0), 
    6667                                                                                uniform samplerCUBE DistanceMap : register(s1), 
     
    8283} 
    8384 
    84 float4  EnvMap_Localized_Refraction_PS( ShadedTex_OUT IN, 
     85float4  EnvMap_Localized_Refraction_PS( Shaded_OUT IN, 
    8586                                                                                uniform samplerCUBE CubeMap : register(s0), 
    8687                                                                                uniform samplerCUBE DistanceMap : register(s1), 
     
    111112 
    112113 
    113 float4 EnvMap_LocalizedMetal_PS(  ShadedTex_OUT IN, 
     114float4 EnvMap_LocalizedMetal_PS(  Shaded_OUT IN, 
    114115                                                                        uniform samplerCUBE CubeMap : register(s0), 
    115116                                                                        uniform samplerCUBE DistanceMap : register(s1), 
  • GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPEnvMap/GTPEnvMap.material

    r2040 r2054  
    140140                                update_interval         0 
    141141                                update_all_face true 
    142                                 distance_calc true 3.5                                   
     142                                distance_calc false                                      
     143                                face_angle_calc false 
    143144                        } 
    144145                        RenderTechnique DistanceCubeMap 
     
    146147                                update_interval         0 
    147148                                update_all_face true 
    148                                 distance_calc true 3.5                                           
     149                                distance_calc false 
     150                                face_angle_calc false 
    149151                        }                        
    150152                 }       
  • GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPParticles/GTP_Particles.material

    r2024 r2054  
    3131   technique  
    3232   {  
    33         pass  
     33    pass  
    3434    {     
    35          IllumTechniques 
    36                  {  
     35        IllumTechniques 
     36        {  
    3737                RenderTechnique SphericalBillboard 
    38                         { 
     38                { 
    3939                                texture_unit_id         1                                        
    40                         } 
    41                  }         
    42                  scene_blend src_alpha one 
    43                  //scene_blend src_alpha one_minus_src_alpha 
    44                  depth_write off 
    45                  depth_check off         
    46                  vertex_program_ref GTP/Particles/SB_Sprite_VS 
    47              {        
    48                 param_named_auto worldView worldview_matrix 
    49                     param_named_auto Proj projection_matrix 
    50                     param_named_auto width viewport_width        
    51                     param_named_auto height viewport_height  
    52                  }  
    53                  fragment_program_ref  GTP/Particles/SB_Sprite_PS 
    54              {  
    55                 param_named_auto farplane far_clip_distance        
    56                     param_named_auto nearplane near_clip_distance 
    57                  } 
    58                  texture_unit 
    59                  { 
    60                    anim_texture smokealpha.tga 32 2.0 
    61                    //texture flare.png 
    62                  } 
    63                  //scene depth texture 
    64                  texture_unit 
    65                  { 
    66                    filtering none 
    67                  }       
    68                  texture_unit 
    69                  { 
    70                    texture planck.tga 
    71                  } 
     40                } 
     41        }          
     42        scene_blend src_alpha one 
     43        //scene_blend src_alpha one_minus_src_alpha 
     44        depth_write off 
     45        depth_check off  
     46        vertex_program_ref GTP/Particles/SB_Sprite_VS 
     47        {        
     48            param_named_auto worldView worldview_matrix 
     49            param_named_auto Proj projection_matrix 
     50            param_named_auto width viewport_width        
     51            param_named_auto height viewport_height  
     52        }  
     53        fragment_program_ref  GTP/Particles/SB_Sprite_PS 
     54        {  
     55            param_named_auto farplane far_clip_distance    
     56            param_named_auto nearplane near_clip_distance 
     57            param_named color float4 3 3 3 1 
     58         } 
     59         texture_unit 
     60         { 
     61           anim_texture smokealpha.tga 32 2.0 
     62           //texture flare.png 
     63         } 
     64         //scene depth texture 
     65         texture_unit 
     66         { 
     67           filtering none 
     68         }       
     69         texture_unit 
     70         { 
     71           texture planck.tga 
     72         } 
    7273    } 
    7374   } 
  • GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPParticles/GTP_Sprite.hlsl

    r2024 r2054  
    100100            uniform float nearplane, 
    101101            uniform float farplane, 
    102                 uniform sampler2D colorTexture : register(s0), 
    103                 uniform sampler2D DepthMap : register(s1), 
    104                 uniform sampler2D PlanckMap : register(s2) 
     102            uniform float4 color, 
     103            uniform sampler2D colorTexture : register(s0), 
     104            uniform sampler2D DepthMap : register(s1), 
     105            uniform sampler2D PlanckMap : register(s2) 
    105106                ) : COLOR 
    106107{ 
     
    137138        Color.rgb = tex2D( PlanckMap, Color.aa).rgb; 
    138139         
    139         return Color;  
     140        return Color * color;  
    140141} 
    141142 
  • GTP/trunk/App/Demos/Illum/Ogre/Media/materials/programs/GameTools_DepthShadow.hlsl

    r1691 r2054  
    113113 
    114114 
     115 
    115116VS_OUT_SHADOW distShadowVS(float4 position : POSITION,   
    116117                                                        uniform float4x4 worldViewProj, 
     
    128129} 
    129130 
    130  
     131/* 
    131132float4 distShadowPS(VS_OUT_SHADOW IN, 
    132133                                        uniform float4x4 lightViewProj, 
     
    173174         
    174175        return shadow + (1 - shadow) * light; 
    175 } 
    176  
     176}*/ 
     177 
     178float4 distShadowPS(VS_OUT_SHADOW IN, 
     179                                        uniform float4x4 lightViewProj, 
     180                                        uniform float lightFarPlane, 
     181                                        uniform sampler2D depthShadowMap : register(s0) 
     182                                        ):COLOR 
     183{        
     184        float bias = 0.001; 
     185        float epsilon = 0.001; 
     186        float4 light = float4(1,1,1,1); 
     187        float4 shadow = float4(0.85,0.85,0.85,1); 
     188         
     189        if(IN.lPosition.z > 0.0) 
     190        { 
     191                float4 pos = (IN.lPosition / IN.lPosition.w); 
     192                 
     193                float d = length(pos.xy); 
     194                         
     195                light = saturate((1.0 - d)/0.05); 
     196                 
     197                if(d <= 1.0) 
     198                { 
     199                        float dist = length(IN.lVPosition.xyz) / lightFarPlane; 
     200                        pos.xy = (pos.xy + 1.0) / 2.0; 
     201                        pos.y = 1.0 - pos.y; 
     202                        float4 storedDist = tex2D(depthShadowMap, pos.xy); 
     203                         
     204                light = storedDist.r + dist*0.000000000001; 
     205         
     206                } 
     207                 
     208        } 
     209        else 
     210                light = 0;       
     211         
     212        return shadow + (1 - shadow) * light; 
     213} 
    177214 
    178215/* 
  • GTP/trunk/App/Demos/Illum/Ogre/Media/materials/programs/GameTools_Diffuse.hlsl

    r1929 r2054  
    11float REDUCED_CUBEMAP_SIZE; 
     2int CUBEMAP_SIZE = 128; 
     3int RATE = 32; 
    24 
    35float4 readCubeMap(samplerCUBE cm, float3 coord)                 
     
    1315        if(dist == 0) dist = 1000000; ///sky 
    1416        return dist; 
     17} 
     18 
     19 
     20///// 
     21/// Reduce cube map shader 
     22///// 
     23struct MPos_OUT 
     24{ 
     25 float4 VPos : POSITION; 
     26 float4 MPos : TEXCOORD0; 
     27}; 
     28 
     29float4 ReduceCubeMap_PS(MPos_OUT IN, 
     30                                                uniform int nFace, 
     31                                                uniform samplerCUBE EnvironmentMapSampler : register(s0) ) : COLOR 
     32 
     33   RATE = 32; 
     34   CUBEMAP_SIZE = 128; 
     35   float4 color = 0; 
     36   float3 dir; 
     37   
     38   for (int i = 0; i < RATE; i++) 
     39     for (int j = 0; j < RATE; j++) 
     40    { 
     41                float2 pos; 
     42                pos.x = IN.mPos.x + (2*i + 1)/(float)CUBEMAP_SIZE; 
     43                pos.y = IN.mPos.y - (2*j + 1)/(float)CUBEMAP_SIZE;      // y=-u 
     44 
     45                // "scrambling" 
     46                if (nFace == 0) dir = float3(1, pos.y, -pos.x); 
     47                if (nFace == 1) dir = float3(-1, pos.y, pos.x); 
     48                if (nFace == 2) dir = float3(pos.x, 1, -pos.y); 
     49                if (nFace == 3) dir = float3(pos.x, -1, pos.y); 
     50                if (nFace == 4) dir = float3(pos.x, pos.y, 1); 
     51                if (nFace == 5) dir = float3(-pos.x, pos.y,-1); 
     52 
     53                color += texCUBE( EnvironmentMapSampler, dir); 
     54    } 
     55  
     56        return color / (RATE*RATE);              
    1557} 
    1658 
  • GTP/trunk/App/Demos/Illum/Ogre/Media/materials/programs/MetalTeapotNew.hlsl

    r2024 r2054  
    413413        return I; 
    414414} 
    415  
     415/* 
    416416float4 mainPS(VertOut IN, 
    417417                                                        uniform float3 cameraPos, 
     
    448448   return Color; 
    449449} 
    450  
    451 /* 
     450*/ 
     451 
    452452float4 mainPS(VertOut IN, 
    453453                                                        uniform float3 cameraPos, 
     
    486486          
    487487        return Color; 
    488 }*/ 
    489  
    490 /* 
    491 float4 mainPS(VertOut IN, 
    492                                                         uniform float3 cameraPos, 
    493                                                         uniform samplerCUBE CubeMap : register(s0), 
    494                                                         uniform samplerCUBE DistanceMap : register(s1), 
    495                                                         uniform samplerCUBE NormDistMap1 : register(s2), 
    496                                                         uniform samplerCUBE NormDistMap2 : register(s3), 
    497                                                         uniform float3 lastCenter, 
    498                                                         uniform float SingleBounce, 
    499                                                         uniform float refIndex, 
    500                                                         uniform float4 min, 
    501                                                         uniform float4 min1, 
    502                                                         uniform float4 min2, 
    503                                                         uniform float4 max, 
    504                                                         uniform float4 max1, 
    505                                                         uniform float4 max2 
    506                                                         ):COLOR 
    507 { 
    508   float2 miniMaxi1; 
    509   miniMaxi1.x = min1.a; 
    510   miniMaxi1.y = max1.a; 
    511     
    512   float4 I = float4(0,0,0,0); 
    513                  
    514   float3 N = normalize(IN.mNormal); 
    515   float3 x = IN.wPos - lastCenter; 
    516   float3 V  = normalize(IN.wPos - cameraPos); 
    517   float3 R = normalize(reflect(V, N));  
    518           
    519   float3 p; 
    520   float dl, dp, llp, ppp;    
    521   linearSearch( x, R, N, NormDistMap1, miniMaxi1, p, dl, dp, llp, ppp); 
    522   if( dot(p, p) != 0 ) 
    523   { 
    524     //secantSearch(x, R, NormDistMap1, dl, dp, llp, ppp, p); 
    525     I = readCubeMap(NormDistMap1, p); 
    526   } 
    527 <<<<<<< .mine 
    528 I = max1 + 0.0000000000001 *x.x; 
    529 ======= 
    530  I = max1 + 0.000000001 * x.x; 
    531 >>>>>>> .r1994 
    532   //I = readCubeMap(NormDistMap1, R)+0.00000000001*x.x;  
    533   return I;      
    534 }*/ 
     488} 
  • GTP/trunk/App/Demos/Illum/Ogre/Media/materials/scripts/GameTools.material

    r2030 r2054  
    261261   technique  
    262262   {  
    263       scene_blend none 
    264  
    265       pass  
    266       {  
    267                 cull_hardware anticlockwise 
    268                 //cull_hardware none 
     263       
     264      pass  
     265      {  
     266        scene_blend none 
     267 
     268        cull_hardware anticlockwise 
     269        //cull_hardware none 
     270        //cull_hardware clockwise 
    269271                 
    270                 vertex_program_ref GameTools/ShadowMap/DistVS 
     272        vertex_program_ref GameTools/ShadowMap/DistVS 
    271273        {        
    272274          param_named_auto worldViewProj worldviewproj_matrix 
    273275          param_named_auto worldView worldview_matrix           
    274             }  
    275                 fragment_program_ref  GameTools/ShadowMap/DistPS 
     276        }  
     277        fragment_program_ref  GameTools/ShadowMap/DistPS 
    276278        {  
    277                         param_named_auto farPlane far_clip_distance 
     279          param_named_auto farPlane far_clip_distance 
    278280        } 
    279281         
  • GTP/trunk/App/Demos/Illum/Ogre/Media/materials/scripts/colorcube.material

    r1862 r2054  
    66                { 
    77                        //lighting off 
    8                          
     8                        IllumTechniques 
     9                        { 
     10                                 
     11                                RenderTechnique CausticReciever 
     12                                { 
     13                                        max_caster_count        10                                       
     14                                }                                
     15                                RenderTechnique DepthShadowReciever 
     16                                { 
     17                                   max_light_count 1 
     18                                   vertex_program_name GameTools/ShadowMap/ShadowDistVS 
     19                                   fragment_program_name GameTools/ShadowMap/ShadowDistPS 
     20                                   set_light_view true 
     21                                   set_light_farplane true 
     22                                } 
     23                        } 
     24 
    925                        texture_unit 
    1026                        { 
    1127                                texture roomc.PNG 
    1228                                tex_coord_set 0 
    13                                 colour_op replace 
     29                                colour_op modulate 
    1430                        } 
    1531                } 
  • GTP/trunk/App/Demos/Illum/Ogre/Media/materials/scripts/difflab.material

    r1671 r2054  
    192192                                        set_light_farplane true 
    193193                                } 
     194                                RenderTechnique CausticReciever 
     195                                { 
     196                                        max_caster_count        3 
     197                                }        
    194198                        } 
    195199                         
  • GTP/trunk/App/Demos/Illum/Ogre/Media/materials/scripts/kupola.material

    r1691 r2054  
    1111                { 
    1212                         
    13                         //RenderTechnique CausticReciever 
    14                         //{ 
    15                         //      max_caster_count        10 
    16                         //} 
     13                        RenderTechnique CausticReciever 
     14                        { 
     15                                max_caster_count        10 
     16                        } 
    1717                        //RenderTechnique DepthShadowReciever 
    1818                        //{ 
     
    6565                        { 
    6666                                 
    67                                 //RenderTechnique CausticReciever 
    68                                 //{ 
    69                                 //      max_caster_count        10 
    70                                 //} 
     67                                RenderTechnique CausticReciever 
     68                                { 
     69                                        max_caster_count        10 
     70                                } 
    7171                                //RenderTechnique DepthShadowReciever 
    7272                                //{ 
Note: See TracChangeset for help on using the changeset viewer.