Hi,
I'm working through "OpenGL Shading Language v2 2006" and I stumbled upon this shader code to implement a Lava Shader:
varying float LightIntensity;
varying vec3 MCposition;
uniform sampler3D Noise;
uniform vec3 Color1; // (0.8, 0.7, 0.0)
uniform vec3 Color2; // (0.6, 0.1, 0.0)
uniform float NoiseScale; // 1.2
void main()
{
vec4 noisevec = texture3D(Noise, MCposition * NoiseScale);
float intensity = abs(noisevec[0] - 0.25) +
abs(noisevec[1] - 0.125) +
abs(noisevec[2] - 0.0625) +
abs(noisevec[3] - 0.03125);
intensity = clamp(intensity * 6.0, 0.0, 1.0);
vec3 color = mix(Color1, Color2, intensity) * LightIntensity;
gl_FragColor = vec4(color, 1.0);
}
The problem arises at the sampler3D. How do I initialize it from within jME?
The same question arrises at different sort of variables, samplerCube and so on.
I searched the forum for an answer, but only found 2+ year old questions regarding the same subject.