Common.MatDefs.ShaderNodes.Environment.reflect100.vert Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jme3-core Show documentation
Show all versions of jme3-core Show documentation
jMonkeyEngine is a 3-D game engine for adventurous Java developers
void main(){
//@input vec3 position position in model space
//@input vec3 normal the normal of the vertex
//@input vec3 camPosition camera position in world space
//@input mat4 worldMatrix the world view matrix
//@output vec3 refVec the reflection vector
vec3 worldPos = (worldMatrix * vec4(position, 1.0)).xyz;
vec3 N = normalize((worldMatrix * vec4(normal, 0.0)).xyz);
vec3 I = normalize( camPosition - worldPos ).xyz;
refVec.xyz = reflect(-I, N);
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy