Sign in to follow this  

Having HLSL Compile failure doing cubemaps

Recommended Posts

rpsathe    115
Folks, I am trying to use a simple cube map. Nothing fancy and sample it using texCube and passing a sampler and a direction vector as input. I am getting a weird compile error that I can't track down. Here's my HLSL code for sampler texture g_txCubeMap; samplerCUBE g_samCubeMap = sampler_state { Texture = <g_txCubeMap>; MinFilter = Linear; MagFilter = Linear; MipFilter = Linear; }; In vertex shader, I do following for(int i=0; i<nNumLights; i++ ) { temp_color = texCUBE( g_samCubeMap, normalize(g_LightDir[i])); vTotalLightDiffuse += g_LightDiffuse[i] * max(0,dot(vNormalWorldSpace, g_LightDir[i])) ; //vTotalLightDiffuse += g_LightDiffuse[i] * max(0,dot(vNormalWorldSpace, g_LightDir[i])) ; } Output.Diffuse = temp_color; temp_color and Output.Diffuse are both float4. g_LightDir[] is array of float3. when I compile using fxc I don't get any compilation errors, but at runtime I get following error - 0x80004005 which error look-up utility says HRESULT: 0x80004005 (2147500037) Name: E_FAIL Description: An undetermined error occurred Severity code: Failed Facility Code: FACILITY_NULL (0) Error Code: 0x4005 (16389) I am at a complete loss...Any help would be appreciated. I can send the whole project if someone has time. Thanks -R

Share this post

Link to post
Share on other sites
This topic is now closed to further replies.
Sign in to follow this