new ShaderAnisotropicDiffusion( [options])
Creates a new Anisotropic Diffusion Shader instance.
Parameters:
Name | Type | Argument | Description | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
<optional> |
Configuration options passed to parent Shader Properties
|
- Source:
Methods
-
fragShaderSrc(gl)
-
Override fragment shader source to implement anisotropic diffusion. This version is compatible with both WebGL 1.0 and 2.0+.
Parameters:
Name Type Description gl
WebGLRenderingContext WebGL context
- Source:
Returns:
Fragment shader source code
- Type
- string
-
setIterations(value)
-
Sets the number of diffusion iterations. More iterations produce smoother results but take longer to compute.
Parameters:
Name Type Description value
number Number of iterations (typically 1-10)
- Source:
-
setKappa(value)
-
Sets the kappa parameter which controls edge sensitivity. Higher values preserve fewer edges.
Parameters:
Name Type Description value
number Kappa value (typically 5-50)
- Source:
-
setLambda(value)
-
Sets the lambda parameter which controls diffusion rate. Should be between 0.0 and 0.25 for numerical stability.
Parameters:
Name Type Description value
number Lambda value (0.0-0.25)
- Source:
-
setNormalStrength(value)
-
Sets the normal strength parameter which controls how much the normal map information influences the final result.
Parameters:
Name Type Description value
number Normal strength multiplier
- Source: