When we ship our product; I precompile our shaders with fxc.
I get the occasional "didn't" work complaint. Usually that is a bug
on the client side handing up the constants and renderstate.
I get a report from our QA Engineer that the chrome is broken
on the new GeForce card. The same shader [both precompiled and sourced]
run on the GeForce 6800 up to the 9xxx series.
On the new card--the shader literally doesn't draw anything.
It also trashes other meshes in the scene.
The bug seems to be related to the Wrap0 renderstate. If I comment it out
then the reflection map appears. With it there, nada.
In this repro the wrap isn't that important; however, in the real shader
I've got another set of 2D textures I'm reading from and using the coordinates--
so I have to have the Wrap0 set.
:edit -- tested on the quadro, its broken there as well.
//I've got a Quadro 4k around here, somewhere. If it doesn't work there
//then I can actually submit a bug to nvidia; however, they usually ignore
//GeForce bugs.
Here is a sample cube map...
http://members.gamedev.net/farplane/BlowersGallery.dds.zip
float4x4 worldViewProj : WORLDVIEWPROJECTION;float4x4 worldView : WORLDVIEW;float4x4 viewI : VIEWINVERSE;float4x4 worldIT : WORLDINVERSETRANSPOSE;float4x4 world : WORLD;float4x4 worldI : WORLDINVERSE;texture CubeMap< string ResourceName = "BlowersGallery.dds"; string ResourceType = "Cube";>;samplerCUBE CubeMapSampler = sampler_state{ Texture = <CubeMap>; MinFilter = Linear; MagFilter = Linear; MipFilter = Linear; AddressU = WRAP; AddressV = WRAP; AddressW = WRAP;};struct VS_INPUT{ float4 Position:POSITION0; float3 Normal:NORMAL0; float3 Binormal:BINORMAL0; float3 Tangent:TANGENT0; float2 UV:TEXCOORD0; float2 UV1:TEXCOORD1; float2 UV2:TEXCOORD2;};struct VS_OUTPUT{ half4 Position:POSITION; half4 Diffuse :COLOR0; half4 Specular :COLOR1; half4 UVPrevMainMain :TEXCOORD0; half4 UVMaskAlpha :TEXCOORD1; half4 UVEnv:TEXCOORD2; float3 WorldNormal : TEXCOORD3; float4 WorldPosition : TEXCOORD4; float3 WorldView : TEXCOORD5; float3 ModelNormal : TEXCOORD6;};VS_OUTPUT mainVS(VS_INPUT IN) { VS_OUTPUT OUT = (VS_OUTPUT)0; OUT.Position = mul( float4(IN.Position.xyz , 1.0) , worldViewProj); OUT.WorldNormal = mul(IN.Normal, worldIT); OUT.WorldView = normalize(viewI[3].xyz - mul(IN.Position, world)); return OUT;}float4 mainPS(VS_OUTPUT IN) : COLOR{ float4 PS = float4(0.0f,0.0f,0.0f,0.0f); float3 N = normalize(IN.WorldNormal); float3 V = normalize(IN.WorldView); float3 R = reflect(-V, N); PS = texCUBE(CubeMapSampler, R); return PS;}technique technique_main{ pass pass0 { //Wrap0 = U|V|W; VertexShader = compile vs_3_0 mainVS(); PixelShader = compile ps_3_0 mainPS(); }}
[Edited by - Mathucub on November 10, 2010 9:37:28 AM]