All pastes #418940 Raw Edit

Cody Brocious

public c v1 · immutable
#418940 ·published 2007-03-31 23:02 UTC
rendered paste body
Original HLSL:float4 PS( PS_INPUT input) : SV_Target{    // Calculate lighting assuming light color is <1,1,1,1>    float fLighting = saturate( dot( input.Norm, vLightDir ) );       // Load the environment map texture    float4 cReflect = g_txEnvMap.Sample( samLinearClamp, input.ViewR );        // Load the diffuse texture and multiply by the lighting amount    float4 cDiffuse = g_txDiffuse.Sample( samLinear, input.Tex ) * fLighting;        // Add diffuse to reflection and go    float4 cTotal = cDiffuse + cReflect;    cTotal.a = 1;    return cTotal;}Output GLSL:PS_INPUT VS() {        PS_INPUT output = (PS_INPUT) 0;        output.Pos = mul(float4(input.Pos, 1), World);        output.Pos.x += sin(output.Pos.y * 0.1 + Time) * Waviness;        output.Pos = mul(output.Pos, View);        output.Pos = mul(output.Pos, Projection);        output.Norm = mul(input.Norm, float3x3);        output.Tex = input.Tex;        float3 viewNorm = mul(output.Norm, float3x3);        output.ViewR = reflect(viewNorm, float3(0, 0, -1.0));        return output;};