• Articles
  • Api Documentation
Show / Hide Table of Contents
  • net.abi.abisEngine.components
    • Camera
    • DirectionalLight
    • FreeLook
    • FreeMove
    • Light
    • LockView
    • MeshRenderer
    • PointLight
    • SceneComponent
    • SpotLight
  • net.abi.abisEngine.core
    • CoreEngine
    • Main
    • Time
  • net.abi.abisEngine.entities
    • Entity
    • EntityI
  • net.abi.abisEngine.handlers.file
    • FileHandler
    • PathHandle
    • PathResolveI
    • PathType
  • net.abi.abisEngine.handlers.logging
    • Logger
    • LogLevel
    • LogManager
  • net.abi.abisEngine.input
    • GLFWInput
    • GLFWMouseAndKeyboardInput
  • net.abi.abisEngine.math
    • Math
    • Matrix
    • Matrix4f
    • Quaternion
    • Transform
    • Vector2f
    • Vector2i
    • Vector3f
    • Vector3i
    • Vector4f
    • Vector4fI
  • net.abi.abisEngine.rendering.asset
    • AssetClassifier
    • AssetContainer
    • AssetI
    • AssetLoaderParameters
    • AssetLoaderParameters.LoadedCallback
    • AssetLoadTask
    • AssetManager
    • AssetStore
    • TaskCompleteHandler
  • net.abi.abisEngine.rendering.asset.loaders
    • AssetLoader
    • AsyncAssetLoader
    • ModelSceneLoader
    • ModelSceneLoader.Parameter
    • SyncAssetLoader
  • net.abi.abisEngine.rendering.image
    • AEImage
    • ImageMetaData
    • PixelMap
  • net.abi.abisEngine.rendering.material
    • Material
  • net.abi.abisEngine.rendering.mesh
    • AIMeshLoader
    • Mesh
    • MeshResource
    • Model
    • ModelScene
    • Vertex
  • net.abi.abisEngine.rendering.pipeline
    • RenderingEngine
  • net.abi.abisEngine.rendering.scene
    • Scene
    • SceneManager
  • net.abi.abisEngine.rendering.scene.scenes
    • EngineSplashScreen
  • net.abi.abisEngine.rendering.shader
    • AEShader
    • AEShader.AEShaderType
    • AEShaderResource
    • ForwardAmbientShader
    • ForwardDirectionalShader
    • ForwardPointShader
    • ForwardSpotShader
    • GLSLLayoutQualifier
    • GLSLUniform
    • GLSLUniformBlockObject
    • GLSLUniformBlockObjectData
    • Shader
    • Shader.ShaderSource
    • Shader.ShaderType
    • ShaderResource
    • WireFrameShader
  • net.abi.abisEngine.rendering.shader.compiler
    • AEGLInfo
    • AEShaderCompiler
    • AEShaderCompiler.GLSLStruct
    • AEShaderCompiler.ShaderData
    • AEShaderCompiler.ShaderSource
    • Tokens
    • Tokens.Keywords
    • Tokens.Operators
    • Tokens.Qualifiers
  • net.abi.abisEngine.rendering.shader.loader
    • AEShaderLoader
  • net.abi.abisEngine.rendering.shader.parser
    • AEShaderParserYAML
  • net.abi.abisEngine.rendering.shader.parser.fileTypes.yaml
    • AEDemoProperty
    • AEPrepProperty
    • AEShaderFileYAML
    • AEShaderGLSLProgram
    • AEShaderPass
  • net.abi.abisEngine.rendering.texture
    • Texture
    • Texture.TextureData
    • TextureResource
  • net.abi.abisEngine.rendering.window
    • GLFWWindow
    • GLFWWindow.AnimatedCursor
    • GLFWWindow.CursorI
    • GLFWWindow.GLFWWindowProperties
    • GLFWWindow.StaticCursor
    • GLFWWindow.StaticCursorResource
    • GLFWWindowManager
    • GLFWWindowManager.GLFWWindowContext
  • net.abi.abisEngine.rendering.window.models
    • EngineLoader
  • net.abi.abisEngine.util
    • Attenuation
    • Color
    • Expendable
    • IOUtil
    • MappedValues
    • ThreadUtils
    • Util
  • net.abi.abisEngine.util.async
    • Async
    • AsyncResult
    • AsyncTask
    • AsyncThreadDispatcher
  • net.abi.abisEngine.util.cacheing
    • GenericCache
    • GenericCacheI
    • TwoFactorGenericCache
    • TwoFactorGenericCacheI
  • net.abi.abisEngine.util.exceptions
    • AECursorInitializationException
    • AEException
    • AEGLFWWindowInitializationException
    • AEImageManipulationException
    • AEIOException
    • AERuntimeException
    • AEShaderCompilerRuntimeException
  • tests.renderTest
    • Start
  • tests.renderTest.entitys
    • FlatPlane
    • MonkeyHead
  • tests.renderTest.materials
    • BricksOne
    • BricksTwo
  • tests.renderTest.scenes
    • MainMenu
    • TestGame
  • tests.renderTest.windows
    • MainGame

Class Shader

Inheritance
java.lang.Object
Expendable
AssetI
Shader
Syntax
public class Shader implements AssetI

Constructors

Shader(String shaderName)

Loads Or References a shader in the private context, which means where ever this shader was created thats were it will be usable since the context handle for this is 0. This shader cannot be used universally.

Declaration
public Shader(String shaderName)
Parameters
Type Name Description
String shaderName

Shader(String shaderName, long context)

Creates a shader found in the shader assets directory.

Declaration
public Shader(String shaderName, long context)
Parameters
Type Name Description
String shaderName
long context

Fields

DEFAULT_SHADER

Declaration
public static final Shader DEFAULT_SHADER= null
Field Value
Type Description
final Shader

DEFAULT_SHADER_ASSET_DIRECTORY_PATH

Declaration
public static final PathHandle DEFAULT_SHADER_ASSET_DIRECTORY_PATH= new PathHandle("res/shaders/",
			PathType.Internal)
Field Value
Type Description
final PathHandle

Methods

addAllAttributes(ShaderSource source)

Declaration
public void addAllAttributes(ShaderSource source)
Parameters
Type Name Description
ShaderSource source

addAllAttributes(String shaderText)

Declaration
public void addAllAttributes(String shaderText)
Parameters
Type Name Description
String shaderText

addAllUniforms(ShaderSource source)

Declaration
public void addAllUniforms(ShaderSource source)
Parameters
Type Name Description
ShaderSource source

addAllUniforms(String shaderText)

Declaration
public void addAllUniforms(String shaderText)
Parameters
Type Name Description
String shaderText

addFragmentShader(ShaderSource source)

Declaration
public void addFragmentShader(ShaderSource source)
Parameters
Type Name Description
ShaderSource source

addFragmentShader(String text)

Declaration
public void addFragmentShader(String text)
Parameters
Type Name Description
String text

addGeometryShader(ShaderSource source)

Declaration
public void addGeometryShader(ShaderSource source)
Parameters
Type Name Description
ShaderSource source

addGeometryShader(String text)

Declaration
public void addGeometryShader(String text)
Parameters
Type Name Description
String text

addProgram(String text, int type, String text_type)

Declaration
public void addProgram(String text, int type, String text_type)
Parameters
Type Name Description
String text
int type
String text_type

addShader(ShaderType type, ShaderSource source)

Declaration
public void addShader(ShaderType type, ShaderSource source)
Parameters
Type Name Description
Shader.ShaderType type
ShaderSource source

addTesselationControlShader(ShaderSource source)

Declaration
public void addTesselationControlShader(ShaderSource source)
Parameters
Type Name Description
ShaderSource source

addTesselationControlShader(String text)

GL40 Shader Program.

Declaration
public void addTesselationControlShader(String text)
Parameters
Type Name Description
String text

addTesselationEvaluationShader(ShaderSource source)

Declaration
public void addTesselationEvaluationShader(ShaderSource source)
Parameters
Type Name Description
ShaderSource source

addUniform(String uniform)

Declaration
public void addUniform(String uniform)
Parameters
Type Name Description
String uniform

addUniform(String uniformName, String uniformType, HashMap<String, ArrayList<GLSLStruct>> structs)

Previously Known As addUniformWithStructCheck.

Declaration
public void addUniform(String uniformName, String uniformType, HashMap<String, ArrayList<GLSLStruct>> structs)
Parameters
Type Name Description
String uniformName
String uniformType
HashMap<String, ArrayList<GLSLStruct>> structs

addVertexShader(ShaderSource source)

Declaration
public void addVertexShader(ShaderSource source)
Parameters
Type Name Description
ShaderSource source

addVertexShader(String text)

Declaration
public void addVertexShader(String text)
Parameters
Type Name Description
String text

bind()

Declaration
public void bind()

compileShader()

Declaration
public void compileShader()

decAndGetRef()

Declaration
public int decAndGetRef()
Returns
Type Description
int
Overrides
AssetI.decAndGetRef()

decRef()

Decrements the asset's reference count by one.

Declaration
public void decRef()
Overrides
AssetI.decRef()

dispose()

Declaration
public void dispose()
Overrides
Expendable.dispose()

findUniformStructs(String shaderText)

Declaration
public HashMap<String, ArrayList<GLSLStruct>> findUniformStructs(String shaderText)
Parameters
Type Name Description
String shaderText
Returns
Type Description
HashMap<String, ArrayList<GLSLStruct>>

getProgram()

Declaration
public int getProgram()
Returns
Type Description
int

getRefs()

Returns the integer representation of the references.

Declaration
public int getRefs()
Returns
Type Description
int

The count of refrences.

Overrides
AssetI.getRefs()

getUniforms()

Declaration
public HashMap<String, Integer> getUniforms()
Returns
Type Description
HashMap<String, Integer>

incAndGetRef()

Declaration
public int incAndGetRef()
Returns
Type Description
int
Overrides
AssetI.incAndGetRef()

incRef()

Increments the asset's reference count by one.

Declaration
public void incRef()
Overrides
AssetI.incRef()

loadShaderSource(PathHandle pathToShader, ShaderType type)

Loads a shader from the path to the shader directory and the type. Resolves a file from the path and then loads.

Declaration
public static ShaderSource loadShaderSource(PathHandle pathToShader, ShaderType type)
Parameters
Type Name Description
PathHandle pathToShader
Shader.ShaderType type
Returns
Type Description
ShaderSource

setAttribLocation(String attribName, int location)

Declaration
public void setAttribLocation(String attribName, int location)
Parameters
Type Name Description
String attribName
int location

setProgram(int program)

Declaration
public void setProgram(int program)
Parameters
Type Name Description
int program

setUniform1i(String uniformName, int value)

Declaration
public void setUniform1i(String uniformName, int value)
Parameters
Type Name Description
String uniformName
int value

setUniform2f(String uniformName, Vector2f value)

Declaration
public void setUniform2f(String uniformName, Vector2f value)
Parameters
Type Name Description
String uniformName
Vector2f value

setUniform2fv(String uniformName, float[] value)

Declaration
public void setUniform2fv(String uniformName, float[] value)
Parameters
Type Name Description
String uniformName
float [] value

setUniform2iv(String uniformName, int[] value)

Declaration
public void setUniform2iv(String uniformName, int[] value)
Parameters
Type Name Description
String uniformName
int [] value

setUniform3f(String uniformName, Vector3f value)

Declaration
public void setUniform3f(String uniformName, Vector3f value)
Parameters
Type Name Description
String uniformName
Vector3f value

setUniform3fv(String uniformName, float[] value)

Declaration
public void setUniform3fv(String uniformName, float[] value)
Parameters
Type Name Description
String uniformName
float [] value

setUniform3i(String uniformName, Vector3i value)

Declaration
public void setUniform3i(String uniformName, Vector3i value)
Parameters
Type Name Description
String uniformName
Vector3i value

setUniform3iv(String uniformName, int[] value)

Declaration
public void setUniform3iv(String uniformName, int[] value)
Parameters
Type Name Description
String uniformName
int [] value

setUniform3ui(String uniformName, Vector3i value)

Declaration
public void setUniform3ui(String uniformName, Vector3i value)
Parameters
Type Name Description
String uniformName
Vector3i value

setUniform3uiv(String uniformName, int[] value)

Declaration
public void setUniform3uiv(String uniformName, int[] value)
Parameters
Type Name Description
String uniformName
int [] value

setUniform4f(String uniformName, Vector4f value)

Declaration
public void setUniform4f(String uniformName, Vector4f value)
Parameters
Type Name Description
String uniformName
Vector4f value

setUniformBoolean(String uniformName, boolean value)

1 - true, 0 - false;

Declaration
public void setUniformBoolean(String uniformName, boolean value)
Parameters
Type Name Description
String uniformName
boolean value

setUniformDirectionalLight(String uniformName, DirectionalLight directionalLight)

Declaration
public void setUniformDirectionalLight(String uniformName, DirectionalLight directionalLight)
Parameters
Type Name Description
String uniformName
DirectionalLight directionalLight

setUniformf(String uniformName, float value)

Declaration
public void setUniformf(String uniformName, float value)
Parameters
Type Name Description
String uniformName
float value

setUniformfv(String uniformName, float[] value)

Declaration
public void setUniformfv(String uniformName, float[] value)
Parameters
Type Name Description
String uniformName
float [] value

setUniformi(String uniformName, int value)

Declaration
public void setUniformi(String uniformName, int value)
Parameters
Type Name Description
String uniformName
int value

setUniformiv(String uniformName, int[] value)

Declaration
public void setUniformiv(String uniformName, int[] value)
Parameters
Type Name Description
String uniformName
int [] value

setUniformLight(String uniformName, Light baseLight)

Declaration
public void setUniformLight(String uniformName, Light baseLight)
Parameters
Type Name Description
String uniformName
Light baseLight

setUniformMatrix4fv(String uniformName, Matrix value)

All Matrices by default are transposed while loading.

Declaration
public void setUniformMatrix4fv(String uniformName, Matrix value)
Parameters
Type Name Description
String uniformName
Matrix value

setUniformPointLight(String uniformName, PointLight pointLight)

Declaration
public void setUniformPointLight(String uniformName, PointLight pointLight)
Parameters
Type Name Description
String uniformName
PointLight pointLight

setUniforms(HashMap<String, Integer> uniforms)

Declaration
public void setUniforms(HashMap<String, Integer> uniforms)
Parameters
Type Name Description
HashMap<String, Integer> uniforms

setUniformSpotLight(String uniformName, SpotLight spotLight)

Declaration
public void setUniformSpotLight(String uniformName, SpotLight spotLight)
Parameters
Type Name Description
String uniformName
SpotLight spotLight

updateUniforms(Transform transform, Material mat, RenderingEngine engine)

Declaration
public void updateUniforms(Transform transform, Material mat, RenderingEngine engine)
Parameters
Type Name Description
Transform transform
Material mat
RenderingEngine engine
Back to top Generated by DocFX