|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.threed.jpct.GLSLShadowInjector
public class GLSLShadowInjector
This class offers static methods to inject shadow mapping code into exiting
shaders. It's tailored to work with the default shaders that come with
jPCT-AE, but you can use it on your own shaders as well, if you follow some
basic rules. The easiest way to do that, is to base your shaders on the
default shaders and keep the names of the uniforms and variables.
While you can do shadow mapping on your own in jPCT-AE, it's advised to rely
on the ShadowHelper class in the util package if possible.
If you have an object that should receive shadows and that uses a custom
shader based on the default shaders, you have two options:
Field Summary | |
---|---|
static int |
NORMAL_SHADOWS
Shadow mode for normal, blocky shadows with no filtering |
static int |
NORMAL_SHADOWS_WITH_EDGE_SMOOTHING
Shadow mode for normal, blocky shadows which fade out at the edges of the shadow map. |
static int |
PCF_FILTERED_SHADOWS
Shadow mode for filtered shadows, which are less blocky but slower. |
static int |
PCF_FILTERED_SHADOWS_WITH_EDGE_SMOOTHING
Shadow mode for filtered shadows + edge smoothing. |
Constructor Summary | |
---|---|
GLSLShadowInjector()
|
Method Summary | |
---|---|
static int |
getShadowMode()
Returns the engine's current shadow mode. |
static GLSLShader |
injectShadowCode(GLSLShader sourceShader)
Tries to inject shadow mapping code into a GLSLShader. |
static void |
setShadowMode(int mode)
Sets the shadow mode. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int NORMAL_SHADOWS
public static final int NORMAL_SHADOWS_WITH_EDGE_SMOOTHING
public static final int PCF_FILTERED_SHADOWS
public static final int PCF_FILTERED_SHADOWS_WITH_EDGE_SMOOTHING
Constructor Detail |
---|
public GLSLShadowInjector()
Method Detail |
---|
public static void setShadowMode(int mode)
mode
- the mode.public static int getShadowMode()
public static GLSLShader injectShadowCode(GLSLShader sourceShader)
sourceShader
- the source shader
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |