jared-hughes / DesThree

Desmos bindings for three.js
3 stars 0 forks source link

Add shadows #42

Open jared-hughes opened 3 years ago

jared-hughes commented 3 years ago

The shadow settings need to be tweaked to be enabled.

Also add ShadowMaterial, which allows for some cool effects; see the ground on https://threejs.org/examples/#webgl_geometry_spline_editor.

Probably want to implement planes first to get a similar effect as that example.

I believe this is the final mesh material available easily in three.js without using shader materials (#23).

jared-hughes commented 3 years ago

In https://github.com/jared-hughes/DesThree/commit/c86e927c3d0c4608bf24e2e8d3995b9f6d693b6c, I pretty much used default values, but there were still some shadow artifacts — example graph https://www.desmos.com/calculator/pzp3jcjhhy; try looking at low values of y_0.

After research into shadows, I understand how much of a performance hit they can be. Each light stores a shadow map, created essentially by re-rendering the whole scene from the perspective of the light. Shadows are going to need a lot more thought before being released.

Maybe:

For now, I'm going to drop this issue from the 0.5.2 release.