1#ifndef OE_RENDER_SURFACE_SHADER_H
2#define OE_RENDER_SURFACE_SHADER_H
5#include <glm/mat4x4.hpp>
7#include "shader_base.h"
24 SurfaceShader(
const std::string& source_code,
const std::string& name =
"");
35 define(
"SHADER_DEPTH_ENTRYPOINT", name);
39 static constexpr const char* surface_shader_headers = R
"(
40 // Input surface option
48 // Result surface option
59 // These following 3 are only for refractive surfaces
67 #define RENDER_PASS_DEPTH 1
68 #define RENDER_PASS_FORWARD 2
69 #define RENDER_PASS_DEFERRED 3
71 #define GEOMETRY_PASS_SOLID 1
72 #define GEOMETRY_PASS_SKINNED 2
74 // Read a normal texture and extract a normal
75 vec3 OE_UNPACK_NORMAL_MAP(sampler2D TEX, vec2 TEX_COORDS);
77 // Convert color stored into sRGB into linear
78 vec3 OE_CONVERT_SRGB_TO_LINEAR(vec3 X);
80 // Surface shaders should implement this function
81 void surface(in SurfaceInput surface_input, inout SurfaceOutput result);
ShaderBase(const std::string &name="")
Create a new shader instance.
void define(const std::string &name, const T &value)
Define a shader constant.
Definition shader_base.h:69
Render related abstractions (Shader, Framebuffer, Cubemaps, Textures).
Definition opengl.h:12
void setDepthFunctionName(const std::string &name)
Set a custom function to use for getting alpha.
Definition surface_shader.h:33
SurfaceShader(const std::string &source_code, const std::string &name="")
Create a new shader instance.