Lighting, Shadows & Materials
M3D-Engine handles 3 different types of lights:
This type of light is best suited for global scene illumination. There is no specific light source, and every point in the world is lit by the same light vector
Point Lights extends the notion of directional light vector by adding a light source. Light rays are still infinite, but these vectors are not collinear any-more.
Spot lights are an extension of Point Lights, they are bounded in a 3D space. you can control the aperture angle and the falloff of the light.
Static shadows can be computed and baked in the final textures either in the production pipeline, or during the game’s execution.
M3D-Engine use shadow mapping for real time dynamic full scene shading.
Shadow Mapping algorithms are
- Simple – SSM
- Poisson Sampling
- Percentage Closer Filtering – PCF
- Variance – VSM
Material objects in M3D-Engine are defined as
- attribute slots for dynamic variables
- shader object
- texture set
Once your Material is defined, you must bind it the a Mesh object and link the attributes slots to dynamic variables, such as timers and oscillators.
M3D-Engine’s Rendering Module perform Mesh batching, using the Materials definitions, to limit OpenGL state changes.