Common.MatDefs.Misc.Sky.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 3D game engine for adventurous Java developers
The newest version!
uniform mat4 g_ViewMatrix;
uniform mat4 g_ProjectionMatrix;
uniform mat4 g_WorldMatrix;
uniform vec3 m_NormalScale;
attribute vec3 inPosition;
attribute vec3 inNormal;
varying vec3 direction;
void main(){
// set w coordinate to 0
vec4 pos = vec4(inPosition, 0.0);
// compute rotation only for view matrix
pos = g_ViewMatrix * pos;
// now find projection
pos.w = 1.0;
gl_Position = g_ProjectionMatrix * pos;
vec4 normal = vec4(inNormal * m_NormalScale, 0.0);
direction = (g_WorldMatrix * normal).xyz;
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy