Class Shader
java.lang.Object
pl.AWTGameEngine.objects.render.shaders.Shader
- Direct Known Subclasses:
BillboardShader,DefaultShader,GUIShader,XRayShader
Shader class is used to create custom shaders.
Every shader instance is a singleton in window area. To obtain shader, use
You can use helper methods, such as
For reference, check out
Shader is compiled before its first use.
Vertex shader layout:
Shaders.of(BaseWindow, Class).You can use helper methods, such as
setFloatValue(int, float) or setFloatMatrixValue(int, float[]),
or just use GL context.For reference, check out
DefaultShader or XRayShader shaders.Shader is compiled before its first use.
Vertex shader layout:
layout(location = 0) in vec3 aPos;
layout(location = 1) in vec3 normal;
layout(location = 2) in vec2 aUV;
-
Method Summary
Modifier and TypeMethodDescriptionintgetLocation(String name) getName()intvoidsetCurrentContext(com.jogamp.opengl.GL4 context, BaseWindow window) voidsetFloatMatrixValue(int location, float[] value) voidsetFloatValue(int location, float value) voidsetVec3Value(int location, float x, float y, float z) voidsetVec3Value(int location, Vector3 vector3) toString()abstract voiduse(ShaderUseContext useContext) Method is invoked everytime an object wants to render.
-
Method Details
-
use
Method is invoked everytime an object wants to render. -
getLocation
-
setFloatValue
public void setFloatValue(int location, float value) -
setFloatMatrixValue
public void setFloatMatrixValue(int location, float[] value) -
setVec3Value
-
setVec3Value
public void setVec3Value(int location, float x, float y, float z) -
getName
-
getProgram
public int getProgram() -
setCurrentContext
-
toString
-