Bugzilla – Bug 15253
Custom Filters / CSS Shaders: add normal matrix uniform to enable lighting
Last modified: 2014-11-03 21:28:16 UTC
This comment applies to CSS Shaders (https://dvcs.w3.org/hg/FXTF/raw-file/tip/custom/index.html).
Adding the normal matrix to the shader uniforms (6.2.2. Shader uniform variables) would enable lighting computation. Name would be "u_normalMatrix".
We might also need normals to be sent along with vertices (referred as a_position in the spec), but because it is all about plans in the DOM, we could handle simple situations by assuming a (0,0,1) normal.
As per the current thread, I believe we should use Gregg's idea of making the 24 matrices as shown in "http://developer.download.nvidia.com/assets/gamedev/docs/Using_SAS_v1_03.pdf?display=default" available. That list is:
We should create a standard naming convention for each matrix (I don't think we should use all caps). It is an easy matter of reading the list of uniforms used by a shader and creating the requested matrix only when needed.
We also need to understand the meaning of the PROJECTION matrix. Where does that projection come from? Do we use the value of the CSS perspective property?
*** Bug 16838 has been marked as a duplicate of this bug. ***
Shaders were removed from the spec. Closing bug.