- Make sure to clone this repository and their submodules recursivelly
git clone --recursive https://github.com/ShaderCamp/shader_prototyping_2022.gitIf you already clone it with out the --recursive flag, just do
git pull
git submodule init
git submodule update- Make sure you have compiled and installed GlslViewer from source following the instructions of you system of choise:
We will start by doing a fast recap of the difference between 2D and 3D shaders, to then load a simple geometry:
make 01_materialor
glslViewer 01_mt.frag assets/skull.obj -lWe will iterate on it adding and modifying different render passes each one with a unique notation so then it's easier to structure any pipeline:
- M main shader (2D): when loaded only a
.fragfile or and image or video. - Mt material shader (3D): when loaded a
.vertor geometry file (.ply/.obj/.glb/.gltf) - Bg Background shader (2D): forked using
BACKGROUNDdefine keyword - Pp Post Processing shader (2D): forked using
POSTPROCESSINGdefine keyword renders the entire scene into a FBO callu_sceneandu_sceneDepth. - Fl Floor Material (3D): creates a floor plane when
FLOORdefine keyword is present and fork the shader adding that keyword as a define to it. - L Light's shadowMap (2D): when uniform sampler2D
u_lightShadowMapis present create a depth pass from the perspective of the light (vec3 u_lightandmat4 u_lightMatrix). - B Buffer (2D): when define keyword
BUFFER_<N>is present, forks the shader to render a 2D pass inside FBO namedu_buffer<N> - D Doubple buffer (2D): when define keyword
DOUBLE_BUFFER_<N>is present, forks the shader to render a 2D pass inside a double FBO namedu_doubleBuffer<N>. This double buffer it's also know as PingPong, where after each pass the pare is swap, allowing for feedback passing their own content in it self. - Cp Convolution pyramid(2D): when define keyword
CONVOLUTION_PYRAMID_<N>is present, forks the shader to render a 2D pass inside a FBO to be prosses according to this paper and delivered throughu_pyramid<N>. - Gn G Buffer Normal (3D>2D): when uniform sampler2D
u_sceneNormalis present creates a g buffer of the 3D scene normals in screenspace - Gp G Buffer Position (3D>2D): when uniform sampler2D
u_sceneNPositionis present creates a g buffer of the 3D scene position in screenspace
make 00_platform
make 00_billboard
make 01_material
make 02_background
make 03_postprocessing
make 04_floor
make 04_pbr
make 05_multiple_materials
make 06_buffer
make 06a_scene_depth
make 06a_scene_normal
make 06a_buffer_postprocessing
make 07_doubleBuffer
make 08_doubleDoubleBuffer
make 09_convolutionPyramid