Bug 15253 - Custom Filters / CSS Shaders: add normal matrix uniform to enable lighting
Custom Filters / CSS Shaders: add normal matrix uniform to enable lighting
Status: NEW
Product: CSS
Classification: Unclassified
Component: Filter Effects
unspecified
All All
: P2 major
: ---
Assigned To: Dean Jackson
This bug has no owner yet - up for the taking
:
: 16838 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-12-17 05:52 UTC by Fabrice Robinet
Modified: 2013-07-04 16:10 UTC (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fabrice Robinet 2011-12-17 05:52:06 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.
Comment 1 Chris Marrin 2012-01-12 21:54:52 UTC
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:

WORLD
VIEW
PROJECTION
WORLDVIEW
VIEW PROJECTION
WORLDVIEWPROJECTION
WORLDINVERSE
VIEWINVERSE
PROJECTIONINVERSE
WORLDVIEWINVERSE
VIEWPROJECTIONINVERSE
WORLDVIEWPROJECTIONINVERSE
WORLDTRANSPOSE
VIEWTRANSPOSE
PROJECTIONTRANSPOSE
WORLDVIEWTRANSPOSE
VIEW PROJECTIONTRANSPOSE
WORLDVIEWPROJECTIONTRANSPOSE
WORLDINVERSETRANSPOSE
VIEWINVERSETRANSPOSE
PROJECTIONINVERSETRANSPOSE
WORLDVIEWINVERSETRANSPOSE
VIEW PROJECTIONINVERSETRANSPOSE
WORLDVIEWPROJECTIONINVERSETRANSPOSE

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?
Comment 2 Dirk Schulze 2013-07-04 16:10:23 UTC
*** Bug 16838 has been marked as a duplicate of this bug. ***