开发者

OpenGL lighting with Cg

开发者 https://www.devze.com 2023-01-29 21:53 出处:网络
I\'m already familiar with OpenGL\'s native lights. My question is how do I go about rendering lights with Cg?

I'm already familiar with OpenGL's native lights.

My question is how do I go about rendering lights with Cg? Do I still need to declare normal OpenGL lights and then use Cg to render the light?Or is it all done with Cg?

If you could point me to some reading material about li开发者_C百科ghting with Cg that would be great also.


Well, after some experimenting, I figured out that you don't need to use any OpenGL ligthing directive. All you need to do is write a vertex shader and give it the parameters needed for the lights: light position, light color. You can also send reflectance and shininess parameters for each object to simulate the way you declare material properties in opengl.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号