Ignore:
Timestamp:
09/21/06 08:35:22 (18 years ago)
Author:
szirmay
Message:
 
Location:
GTP/trunk/App/Demos/Illum/Ogre/Media/materials/programs
Files:
3 added
2 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/App/Demos/Illum/Ogre/Media/materials/programs/GameTools_HPS_Smoke_L.hlsl

    r1355 r1424  
    77        float r                         : TEXCOORD2;     
    88        float4 center           : TEXCOORD3; 
     9        float4 Color            : TEXCOORD4;     
    910}; 
    1011 
    1112VS_OUT HPS_Smoke_L_VS (float4 position : POSITION,       
    1213                float4 texCoord : TEXCOORD0, 
    13                  
     14                float4 Color: COLOR0, 
     15                uniform float baseRadius, 
    1416                uniform float4x4 worldView, 
    1517                uniform float4x4 Proj, 
     
    1719{ 
    1820        VS_OUT OUT; 
    19    
    20         float2 offset = texCoord.zw; 
     21    float2 offset = texCoord.zw * baseRadius; 
    2122        float4 cPosition;    
    2223        cPosition = mul(worldView, position); 
     
    2425        cPosition.xy += offset;                          
    2526        OUT.cPosition = cPosition; 
    26         OUT.r = abs(texCoord.z);                 
     27        OUT.r = abs(offset.x);           
    2728  
    2829    OUT.hPosition = mul( Proj, cPosition ); 
    2930      
    30     OUT.texCoord = texCoord.xy;     
     31    OUT.texCoord = texCoord.xy;   
     32    OUT.Color = Color;   
    3133        return OUT; 
    3234}  
     
    3941        float4 Color = 0; 
    4042        Color = tex2D(Texture, IN.texCoord); 
    41         Color = float4(1, 1, 1, Color.a); 
     43        Color = float4(1, 1, 1, Color.a) * IN.Color; 
    4244        return Color;  
    4345} 
  • GTP/trunk/App/Demos/Illum/Ogre/Media/materials/programs/GameTools_HPS_Smoke_S.hlsl

    r1355 r1424  
    77        float r                         : TEXCOORD2;     
    88        float4 center           : TEXCOORD3; 
     9        float4 Color            : TEXCOORD4; 
    910}; 
    1011 
    1112VS_OUT HPS_Smoke_S_VS (float4 position : POSITION,       
    1213                float4 texCoord : TEXCOORD0, 
    13                  
     14                float4 Color: COLOR0, 
    1415                uniform float4x4 worldView, 
    1516                uniform float4x4 Proj, 
     
    2829    OUT.hPosition = mul( Proj, cPosition ); 
    2930      
    30     OUT.texCoord = texCoord.xy;     
     31    OUT.texCoord = texCoord.xy; 
     32    OUT.Color = Color;     
    3133        return OUT; 
    3234}  
     
    4244        float alpha = 0; 
    4345                 
    44         float d = length( IN.cPosition.xyz - IN.center.xyz); 
     46        float d = length( IN.cPosition.xy- IN.center.xy); 
    4547         
    4648        if( d < IN.r ) 
     
    5355         fPosition = mul(Proj, fPosition); 
    5456         bPosition = mul(Proj, bPosition); 
    55          f = (fPosition.z / fPosition.w + 1.0) / 2.0; 
    56          b = (bPosition.z / bPosition.w + 1.0) / 2.0; 
     57         f = fPosition.z / fPosition.w; 
     58         b = bPosition.z / bPosition.w; 
    5759          
    5860         alpha = pow(w / IN.r, 4) * 0.5;                 
     
    6365        Color.r = b; 
    6466        Color.g = 1 - f; 
    65         Color.a = alpha; 
     67        Color.a = alpha * IN.Color.a; 
    6668        //Color.a = tex2D(Texture, IN.texCoord).a * 0.2; 
    6769         
Note: See TracChangeset for help on using the changeset viewer.