質問

I've just got an old OpenGL(2.1)/Cg(3.1) code, which I should improve, particularly a deferred shading rendering , where I want to change the kernel of one of the passes.

I'm adding GLSL(3.30) As I'm much more habituated. It seems to work, but I'm wondering if it could be some performance impact mixing up both (GLSL/Cg). In other words, the generated asm code should completely homogeneous?

役に立ちましたか?

解決

You can't mix GLSL and Cg in a single shader, but in different shaders, it should work fine. The Cg code just gets translated to GLSL anyways (unless you're using an Nvidia driver, in which case it may get translated directly to shader asm code). You can look at the GLSL code generated by the Cg compiler if you want to see if its doing anything odd that might be inefficient.

他のヒント

You should be able to run cgc as a pre-processor on your Cg code and have it output GLSL, in a pinch! Use the -profile option to select GLSL.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top