2011年10月6日 星期四

Project Journal 10/06 [Multiple Light Sources]

[Finished]
1. Part of the scene graph. Now it can add transform groups, and models. Besides, it can change the model matrices under the transform groups.
2. Model loading: The model hierarchy is Scene->Transform Group->Model->Mesh.
A Scene can contain several Transform Group.
A Transform Group can have other transform groups and Models.
A Model will contain several meshes that compose of ONE entire model.
A Mesh is where the real vertices locate. A complicated model might have several meshes object.

[To do]
1. Multiple Light Sources:
I just found out that in webGL, pixel shader doesn't support uniform array indexing which means you can pass an array into the shader but only the vertex shader can access it.
So to do multiple light sources, the only way is to use texture.

Quote:
http://www.khronos.org/registry/webgl/specs/latest/#DYNAMIC_INDEXING_OF_ARRAYS "WebGL only allows dynamic indexing with constant expressions, loop indices or a combination. The only exception is for uniform access in vertex shaders, which can be indexed using any expression."

沒有留言:

張貼留言