Jump to content
  • Advertisement
Sign in to follow this  
akaitora

OpenGL CullMode Render State In CG Shading Language

This topic is 2040 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

 In CG, you can set the cull mode render state in an fx like so

pass p0
{
	CullFaceEnable = bool(true);
	CullMode = int(Back);

	VertexShader = compile glslv myvs( __model, __modelViewProjection, __deltaTime, edge );
	PixelShader = compile glslf myps(decalSampler);
} 

However the CullMode render state is only support for OpenGL and not DirectX.  

 

http://http.developer.nvidia.com/Cg/CullMode.html

 

Is there some render state I can use to set the Culling mode when rendering in DirectX in a CG shader?  Thanks!

 

 

Share this post


Link to post
Share on other sites
Advertisement

Any know?  I know CG is no longer supported by NVidia but many a game used CG and this must have been a pretty common operation for effects.

Edited by akaitora

Share this post


Link to post
Share on other sites

Hey Buckeye!  Thanks for the idea but it didn't work.  Is there a way to mix HLSL render states in with CgFX?

 

I tried using the hlslv profile for my vertex shader hoping I could use directx runtime states but that didn't work either...  =(

pass p1
{
    cullmode = ccw;

    //VertexShader = compile vs_3_0 myvs2( __model, __view, __modelViewProjection, __deltaTime);
    VertexShader = compile hlslv myvs2( __model, __view, __modelViewProjection, __deltaTime);
    PixelShader = compile ps_3_0 myps2(decalSampler, rampSampler);
}

Share this post


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

  • Advertisement
×

Important Information

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

GameDev.net 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!