Jump to content
  • Advertisement
Sign in to follow this  
bkenwright

using Cg and DirectX with texCUBE(..)

This topic is 4847 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
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!