O'Reilly logo

Build Your Own 2D Game Engine and Create Great Web Games: Using HTML5, JavaScript, and WebGL by Jason Pace, Fernando Arnez, Jebediah Pavleas, Kelvin Sung

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating the Shadow Caster Object

As mentioned, creating a Renderable object to pair with the ShadowCasterShader object would allow game clients to create and manipulate shadow casters as game objects. However, shadow casters and the associated geometries are implicitly computed based on the associated shadow receiver and light sources. For this reason, shadow casters cannot be directly manipulated by the game clients.

Instead of the familiar Renderable object hierarchy, the ShadowCaster object is defined to encapsulate the implicitly defined shadow caster geometry functionality. A ShadowCaster object represents a Renderable game object that will cast shadow on a shadow receiver, another Renderable game object. To support receiving shadows on ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required