techniques and passes on Cg shaders

Jul 3, 2009 at 7:15am

techniques and passes on Cg shaders

Hello, hope someone can give me a hint about Cg shaders.
I have been working with Cg shaders for couple weeks now. The idea, of course, is to translate HLSL shaders to jitter. So far I have noticed that both .fx and .cg are quite similar. However, there are some functions that I cannot figure out how to convert. Basically are the techniques and passes declared at the end of the .fx and .cgfx shaders. Something like this:
technique dummy_shader
{
pass P0
{

VertexShader = compile vs_2_0 VS();
PixelShader = compile ps_2_0 PS();

}
}
I am not so sure we need to declare those passes inside the jxs file, right?, can we just bypass them when we write out shader wrapper?

Second question. When I have something like this:
float4 cAmb : COLOR = {1, 1, 1, 1};

the correct translation might be like this?:

Thank you very much for the help
Emmanuel

#44625
Jul 3, 2009 at 4:57pm

jxs does not currently support techniques or passes.

you should be able to get similar results by placing each pass in it’s own jxs file, and chaining the slabs together. so pass 1 is read into slab one, pass 2 to slab 2, and slab 1 is connected to slab 2.

Quote:
Second question. When I have something like this:
float4 cAmb : COLOR = {1, 1, 1, 1};

the correct translation might be like this?:

I would think it would be more like:

#160586

You must be logged in to reply to this topic.