开发者

OpenGL Spotlight

开发者 https://www.devze.com 2022-12-21 06:07 出处:网络
I开发者_运维知识库 have a spotlight that I\'m attempting to use, however when I move forward and get to a specific spot (before I reach the object) the light gets cut off and disappears. Does anyone k

I开发者_运维知识库 have a spotlight that I'm attempting to use, however when I move forward and get to a specific spot (before I reach the object) the light gets cut off and disappears. Does anyone know what could be causing this, or direct me to a good tutorial that would show me how to make sure it didn't do this?

I'm attempting to simulate a flashlight. Here is the line that sets up the spotlight

glLightf(GL_LIGHT0, GL_SPOT_CUTOFF, 30.0f);


Does your geometry have enough polygons? OpenGL fixed functionality only does shading equations for each vertex (not for each pixel like per-pixel lighting), so if your polygons are very large, the behavior may appear incorrect.


Was going through my questions and noticed this one I asked a LONG time ago and thought I'd update with what the solution was in case anyone else has similar issues. Come to find out it had to do with the order in which I was setting up my light and textures... I swapped which one was done first and that resolved the issues I was having with my lighting.

0

精彩评论

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