java.lang.Object
de.grogra.glsl.utility.GLSLShader
de.grogra.glsl.utility.GLSLManagedShader
de.grogra.glsl.light.GLSLLightShader
de.grogra.glsl.light.GLSLCurveLight
- All Implemented Interfaces:
GLSLOpenGLObject
GL4/GLSL deferred-shading light shader for
CurveLight.
Approximates the tube as the straight line segment between its two
endpoints (correct for straight-tube CurveLights; a reasonable centroid
approximation for curved ones). At each fragment the closest point on that
segment is found, then the Phong-cosine emission lobe is evaluated:
BSDF = (n+2)·sinTheta^(n+1) / (2π), where sinTheta is the
sine of the angle between the tube axis and the direction from the fragment
to the closest point.
The formula matches the GPU Flux kernel (samplelight.h,
LIGHT_CURVE case) and the CPU CurveLight.computeBSDF
implementation.
- Author:
- MH at YNL 2026
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected Stringprotected StringTube endpoint 1 in eye space.protected StringTube endpoint 2 in eye space.protected StringFields inherited from class de.grogra.glsl.light.GLSLLightShader
spec, stdVFields inherited from class de.grogra.glsl.utility.GLSLManagedShader
config -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionString[]For "hardcompiled" Shaders this method should return a new instanceSets middle part of a light shader (after properties have been extracted from deferred-shading-texturesbooleanneedsRecompilation(Object data) Return false if Shader depends only on UniformsvoidsetupDynamicUniforms(javax.media.opengl.GL gl, GLSLDisplay disp, Object data, int shaderNo) Function that loads uniforms of the represented Shader.protected voidsetupShader(javax.media.opengl.GL gl, GLSLDisplay disp, Object data) Methods inherited from class de.grogra.glsl.light.GLSLLightShader
canDisplayShadows, getLightShaderConfig, getVertexShader, toStringMethods inherited from class de.grogra.glsl.utility.GLSLManagedShader
deleteShader, getConfig, getMaterial_stamp, setConfig, setMaterial_stampMethods inherited from class de.grogra.glsl.utility.GLSLShader
activateShader, cleanup, getShaderProgramNumber, printProgramInfoLog
-
Field Details
-
ep1
Tube endpoint 1 in eye space. -
ep2
Tube endpoint 2 in eye space. -
cl_exponent
-
col0
-
radientPower
-
-
Constructor Details
-
GLSLCurveLight
public GLSLCurveLight()
-
-
Method Details
-
getLightFunction
Description copied from class:GLSLLightShaderSets middle part of a light shader (after properties have been extracted from deferred-shading-textures- Overrides:
getLightFunctionin classGLSLLightShader- Returns:
-
getFragmentShader
- Specified by:
getFragmentShaderin classGLSLShader- Returns:
-
needsRecompilation
Description copied from class:GLSLShaderReturn false if Shader depends only on Uniforms- Overrides:
needsRecompilationin classGLSLShader- Returns:
- true, if Sourcecode needs to be regenerated and recompiled
-
instanceFor
- Overrides:
instanceForin classGLSLShader- Returns:
- Class represented by this Shader
-
getInstance
Description copied from class:GLSLShaderFor "hardcompiled" Shaders this method should return a new instance- Overrides:
getInstancein classGLSLShader- Returns:
-
setupShader
- Overrides:
setupShaderin classGLSLLightShader- Parameters:
gl-disp-
-
setupDynamicUniforms
public void setupDynamicUniforms(javax.media.opengl.GL gl, GLSLDisplay disp, Object data, int shaderNo) Description copied from class:GLSLShaderFunction that loads uniforms of the represented Shader.- Overrides:
setupDynamicUniformsin classGLSLLightShader- Parameters:
gl-disp- GLSLDisplay that tries using this shaderdata- The GroIMP-Shader-Object represented by this shader.
-