20 Commits

Author SHA1 Message Date
ztenghui
3bd3fa1f1d Correctly detect the wrong Z value for the light
b/17221975

Change-Id: I2b46da95ad12ca5260d7fe9514a75558b6b6393b
2014-08-26 10:45:27 -07:00
ztenghui
c50a03d78a Improve the spot shadow computation.
Get rid of compuation of the intersection for penumbra and convex hull for umbra.
Use simple circle / normal to compute the penumbra and simple intersection for umbra.

The new way could be 2x to 4x faster from rectangle to round shape.
And this part is roughly half of the shadow computation, or 2/3 of spot shadow
computation.

This improve the spot shadow spikeness too.

b/16712006
b/14976551

Change-Id: I02911784868731369efa73f76fc915bc08248600
2014-08-22 13:51:16 -07:00
Chris Craik
91a8c7c629 Switch to cos interpolation of shadow alpha
bug:16852257

Updates default shadow opacities to compensate.

Also, update variable/constant naming related to vertex alpha.

Change-Id: I9055b4ac3c9ac305ca9d515f21b52d6aa6dc9c5c
2014-08-12 16:00:09 -07:00
John Reck
1aa5d2d706 Fix ALL compile warnings
All warnings/errors fixed for GCC & Clang

Change-Id: I2ece3a136a5ae97a9acc3069537ed986238b5fd3
2014-07-24 14:28:08 -07:00
Chris Craik
9a89bc6524 Compute layer bounds over subset of VertexBuffer verts
bug:15538815
Change-Id: I0dbb54f656a6ae99a87c5734761107e1c2351b65
2014-07-24 17:49:23 +00:00
Chris Craik
c93e45cf04 Build layer damage bounds for shadows
bug:15538815

Change-Id: I703afeb7e31c28002bd1aff9ce448ec8cdc4e70d
2014-07-23 11:04:53 -07:00
Chris Craik
05f3d6e511 Tessellate on worker threads
Tessellate and cache (where possible) shadow and round rect
tessellation tasks.

Change-Id: I2cfda8e11d83d51ea74af871235cf26e8f831d40
2014-06-10 01:53:17 +00:00
ztenghui
2e023f3827 Make sure the theta is correctly represented and incoming polygon is CW for shadow.
Now the theta = 0 should be on +x axis.
And cos(theta) should correctly represent x value.
Without this fix, the poly theta (from atan2) can be wrongly rotated 90 degrees.

Also, make sure the incoming polygon is CW for the shadow system.
This fix visual artifacts in recent regression for spot shadows.

bug:13553955

Change-Id: I9bbf54db094e7f133326da4dae4610962da849c1
2014-04-28 16:43:13 -07:00
ztenghui
28c3ea0187 Get rid of useless code
Change-Id: I7fedd0df349e1d9408d58edcab25396e2ff2edd6
2014-03-18 15:58:57 -07:00
ztenghui
99af9429cd Fix the missing spot shadow when DEBUG_SHADOW is turned on
In the current design, this error should be tolerated since the delta should
be small enough. So we should not return here.

Change-Id: I251db2882b331d37ae7f0896e9aa95d69a5650da
2014-03-17 15:35:25 -07:00
ztenghui
50ecf849cb Create one hole inside the umbra area to avoid overdraw.
bug:13439450

Change-Id: I859575196bd5a3029f447883025a6ec3a1f1face
2014-03-17 10:10:02 -07:00
Chris Craik
b98f2116f5 Force shadow casters above the Z=0 plane
Change-Id: Ifee75414829d4bfb3c7aa6219f1f9bcfd50ff0c6
2014-03-12 11:19:42 -07:00
Chris Craik
b79a3e301a Fix orthographic shadows projection, simplify shadow reordering
Separate matrix passed to shadow system into two parts, one for
transforming the polygon XY points (using the actual draw matrix) and
a separate one which respects correct 4x4 3d rotations and
translations for determining Z values.

Change-Id: I7e30a84774a8709df6b2241e8f51fc5583648fe8
2014-03-12 09:44:41 -07:00
Chris Craik
726118b352 Improve shadow tessellation performance
- Tune and simplify shadow parameters
- Remove additional inner rings
- Improve polygon ray casting algorithm

Change-Id: If0f28b2d66ae0480b675942bb65e8fcd2864425d
2014-03-11 15:23:36 -07:00
ztenghui
63d41abb40 Use pre-computed index to draw the shadow.
Also draw the umbra part as triangle fans instead of zig zag fashion.

b/12840179

Change-Id: Iaa5d15e77351acdd71f076bd8f9bb2d4d2b92faf
2014-02-25 14:18:25 -08:00
ztenghui
a989cb29c3 Merge "Fixing a bad bug when there is no real umbra" 2014-02-03 22:18:54 +00:00
ztenghui
5176c974f1 Fixing a bad bug when there is no real umbra
This fixed most of the issues when the light's Z postion is low.

Change-Id: If49afbf8aa90b1ce32fd628a62ed982a1a473da2
2014-01-31 17:44:07 -08:00
Chris Craik
12d9526dd2 Simplify umbra calculation
Reuse pre-computed values

Change-Id: Ia7725be0ec3ac58af477fcb8de375f5faa05abf4
2014-01-31 10:43:42 -08:00
ztenghui
f5ca8b4cb1 Merge close vertices in a better way.
And add more verification code for testing purpose.

Change-Id: I5bc4f69e6582c02fd03106af9a98abd05a6755b7
2014-01-29 09:04:04 -08:00
ztenghui
7b4516e7ea Calculate and show the shadow from a spot light.
Change-Id: Ia558852e8cde5d33866b22875eb501e4c6858819
2014-01-10 17:18:53 -08:00