diff options
Diffstat (limited to 'honey/asset')
-rw-r--r-- | honey/asset/shader.lua | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/honey/asset/shader.lua b/honey/asset/shader.lua index a23c17b..d1fecc4 100644 --- a/honey/asset/shader.lua +++ b/honey/asset/shader.lua @@ -140,4 +140,47 @@ clearCache = function() end +--===== builtin shaders =====-- + +builtin["builtin.basic3d.vert"] = [[ + #version 410 core + layout (location = 0) in vec3 in_position; + layout (location = 1) in vec3 in_normal; + layout (location = 2) in vec2 in_texture; + + uniform mat4 model; + uniform mat4 view; + uniform mat4 projection; + + out vec3 position; + out vec3 normal; + out vec2 tex; + + void main() + { + gl_Position = projection * view * model * vec4(in_position, 1.0); + + position = in_position; + normal = in_normal; + tex = in_texture; + } +]] + +builtin["builtin.flat.frag"] = [[ + #version 410 core + + out vec4 frag_color; + + in vec3 position; + in vec3 normal; + in vec2 tex; + + uniform sampler2D surface; + + void main() + { + frag_color = texture(surface, tex); + } +]] + return module |