문제

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