Followers 0

# Lesson 44

## 0 posts in this topic

Hi, Lesson 44 is the lens flare tutorial. Apparently, it has occlusion testing. If the situation is right, it can be done vastly more efficiently. In Python:
model = glGetDoublev(GL_MODELVIEW_MATRIX)
proj = glGetDoublev(GL_PROJECTION_MATRIX)
view = glGetIntegerv(GL_VIEWPORT)
winx,winy,winz = gluProject(lightpos[0],lightpos[1],lightpos[2],model,proj,view)
pos = gluUnProject(winx,winy,winz,model,proj,view)
#if pos and lightpos are basically the same and 0<winx<view[2] and
#0<winy<view[3], then the light is visible; draw the flare.

I used this technique to produce: The planet can occlude the sun's flare. It does so perfectly. Hope this helps, Geometrian
0

## Create an account

Register a new account