galdar496 / QiGameEngine

Realtime Game Engine designed with C++ and OpenGL.
http://qiengine.blogspot.com/
1 stars 0 forks source link

Design the renderer #12

Open galdar496 opened 9 years ago

galdar496 commented 9 years ago

All rendering handled on separate thread Generate rendering commands that can be sorted later http://realtimecollisiondetection.net/blog/?p=86 Rendering system has a list of delegates it calls into. Put the id of the delegate in the command so that the renderer can reference it. When applying materials, really just apply a diff from the previous state. This way you’re only changing what needs to be changed (texture, blend func, etc.) Can do the same diff for shader parameters For now, just use the queue in-order Generate render commands (clear screen) don’t have to sort on material itself, can sort on texture since Qi is deferred (always uses the same shader during the main pass)

galdar496 commented 9 years ago

For objects being rendered, either:

galdar496 commented 9 years ago

Note that luminance can be computed by doing a dot product with the RGB and vec3(0.3, 0.59, 0.11). These values from the NTSC standard for B&W televisions.