Advertisement Jump to content
Sign in to follow this  

using Cg and DirectX with texCUBE(..)

This topic is 4906 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi Everyone, I'm having problems getting a simple Cg pixel shader code working...I'm having difficulty with texCUBE(..) I mean the shader cant' get much simpler: void main( in float4 position : POSITION, in float4 rgba : COLOR0, in float2 texCoord0 : TEXCOORD0, in float2 R : TEXCOORD1, out float4 color : COLOR, uniform sampler2D testTexture, uniform samplerCUBE environmentMap) { float4 reflectedColor = texCUBE(environmentMap, R); // Really doesn't like this line! float4 decalColor = tex2D(testTexture, texCoord0); color = decalColor; } I get the error when I use cgCreateProgramFromFile(..) If I comment the line out it runs okay...can't see where I'm going wrong. I thought texCUBE(..) is supported with ps1.1. Also, just wondering, if I use D3DDEVTYPE_REF instead of D3DDEVTYPE_HAL does that mean I can check later versions of pixel shader code, e.g. ps2.0 etc, but its done in software and is just very slow? instead of on the graphics card. Thanks for any ideas on this. Thanks, Ben

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!