CullMode Render State In CG Shading Language

Started by
2 comments, last by akaitora 10 years, 1 month ago

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!

xdpixel.com - Practical Computer Graphics

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.

xdpixel.com - Practical Computer Graphics

Try cullmode = cw; or cullmode = ccw;

Please don't PM me with questions. Post them in the forums for everyone's benefit, and I can embarrass myself publicly.

You don't forget how to play when you grow old; you grow old when you forget how to play.

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);
}

xdpixel.com - Practical Computer Graphics

This topic is closed to new replies.

Advertisement