Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // default.glsl
- #type source
- #use <nora3D.glsl>
- #uniforms
- vec2 u_Offset : fast_read;
- vec4 u_Tint : fast_write;
- sampler2D u_AlbedoTex : frag_access;
- #end
- #vert
- layout(location = 0) out vec3 v_Normal;
- layout(location = 1) out vec2 v_UV0;
- layout(location = 2) out vec3 v_Tangent;
- layout(location = 3) out vec4 v_Color;
- void main() {
- gl_Position = APPLY_TF(a_Pos);
- v_Normal = a_Normal;
- v_UV0 = a_UV0;
- v_Tangent = a_Tangent;
- v_Color = a_Color;
- }
- #end
- #frag
- layout(location = 0) in vec3 v_Normal;
- layout(location = 1) in vec2 v_UV0;
- layout(location = 2) in vec3 v_Tangent;
- layout(location = 3) in vec4 v_Color;
- void main() {
- o_Col = texture(u_AlbedoTex, v_UV0 + u_Offset) * u_Tint;
- }
- #end
- // nora3D.glsl
- #type include
- #unique NORA3D
- #use <nora.glsl>
- #body
- #ifdef VERT
- #define APPLY_TF(pos) (u_ProjMat * u_ViewMat * u_ModelMat * vec4(pos, 1.0))
- layout(location = 0) in vec3 a_Pos;
- layout(location = 1) in vec3 a_Normal;
- layout(location = 2) in vec2 a_UV0;
- layout(location = 3) in vec2 a_UV1;
- layout(location = 4) in vec3 a_Tangent;
- layout(location = 5) in vec4 a_Color;
- layout(std140, binding = 0) uniform SlowMatrices {
- mat4 u_ProjMat; // This one goes here because it changes relatively sparely
- };
- layout(std140, push_constant) uniform FastMatrices {
- mat4 u_ModelMat;
- mat4 u_ViewMat;
- };
- #endif
- #end
- // nora.glsl
- #type include
- #unique NORA
- #body
- #ifdef FRAG
- layout(location = 0) out vec4 o_Col;
- #endif
- #end
Advertisement
Add Comment
Please, Sign In to add comment