This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 15253 - Custom Filters / CSS Shaders: add normal matrix uniform to enable lighting
Summary: Custom Filters / CSS Shaders: add normal matrix uniform to enable lighting
Status: RESOLVED INVALID
Alias: None
Product: CSS
Classification: Unclassified
Component: Filter Effects (show other bugs)
Version: unspecified
Hardware: All All
: P2 major
Target Milestone: ---
Assignee: Dean Jackson
QA Contact: This bug has no owner yet - up for the taking
URL:
Whiteboard:
Keywords:
: 16838 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-12-17 05:52 UTC by Fabrice Robinet
Modified: 2014-11-03 21:28 UTC (History)
6 users (show)

See Also:


Attachments

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. ***
Comment 3 Dirk Schulze 2014-11-03 21:28:16 UTC
Shaders were removed from the spec. Closing bug.