Shaders - Relative paths
Shaders are no longer found under /shaders in the project; they can be anywhere. In addition, paths for both (program) instructions in the script and include directives in shader source code are relative to the file which contains them.
This commit is contained in:
parent
3344f96af0
commit
68d01ca42e
41 changed files with 198 additions and 132 deletions
test
demo.srdfullscreen.v.glsl
fx-bloom
fx-combine
fx-dof
dof-cs.glsldof-lib.glsldof-pass1.c.glsldof-pass1.f.glsldof-pass2.c.glsldof-pass2.f.glsldof.glslfx-dof.srd
fx-fxaa
lib
fog.glslhg_sdf.glslraymarcher-cs.glslraymarcher.glslraymarching.glslshading-blinnphong.glslshading-pbr.glslutils.glsl
scene.c.glslscene.f.glsl
|
@ -1,7 +1,7 @@
|
|||
(include "fx-bloom.srd")
|
||||
(include "fx-dof.srd")
|
||||
(include "fx-combine.srd")
|
||||
(include "fx-fxaa.srd")
|
||||
(include "fx-bloom/fx-bloom.srd")
|
||||
(include "fx-dof/fx-dof.srd")
|
||||
(include "fx-combine/fx-combine.srd")
|
||||
(include "fx-fxaa/fx-fxaa.srd")
|
||||
|
||||
(init
|
||||
# Compute viewport size
|
||||
|
@ -20,7 +20,7 @@
|
|||
(set vp-x (div (sub $width $vp-width) 2))
|
||||
(set vp-y (div (sub $height $vp-height) 2))
|
||||
|
||||
(program prg-fullscreen "fullscreen.v.glsl")
|
||||
(program prg-fullscreen "/fullscreen.v.glsl")
|
||||
|
||||
(set use-compute 1)
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ layout(
|
|||
) in;
|
||||
|
||||
//! type compute
|
||||
//! include lib/utils.glsl
|
||||
//! include /lib/utils.glsl
|
||||
|
||||
layout( location = 0 ) uniform sampler2D u_MainInput;
|
||||
layout( location = 1 ) uniform sampler2D u_BlurInput;
|
|
@ -1,7 +1,7 @@
|
|||
#version 450 core
|
||||
|
||||
//! type fragment
|
||||
//! include lib/utils.glsl
|
||||
//! include /lib/utils.glsl
|
||||
|
||||
layout( location = 0 ) uniform sampler2D u_MainInput;
|
||||
layout( location = 1 ) uniform sampler2D u_BlurInput;
|
|
@ -17,7 +17,7 @@ layout( location = 4 ) uniform vec3 u_ResolutionTime;
|
|||
|
||||
layout( binding = 0 , rgba16f ) writeonly uniform image2D u_Output;
|
||||
|
||||
//!include lib/utils.glsl
|
||||
//!include /lib/utils.glsl
|
||||
|
||||
float DOF_CoC(
|
||||
in float z )
|
|
@ -1,5 +1,5 @@
|
|||
//!type library
|
||||
//!include lib/utils.glsl
|
||||
//!include /lib/utils.glsl
|
||||
|
||||
float DOF_CoC(
|
||||
in float z )
|
|
@ -7,7 +7,7 @@ layout(
|
|||
local_size_y = 64
|
||||
) in;
|
||||
|
||||
//! include chunks/dof-cs.glsl
|
||||
//! include dof-cs.glsl
|
||||
|
||||
void main()
|
||||
{
|
|
@ -1,7 +1,7 @@
|
|||
#version 450 core
|
||||
|
||||
//! type fragment
|
||||
//! include chunks/dof.glsl
|
||||
//! include dof.glsl
|
||||
|
||||
void main()
|
||||
{
|
|
@ -7,7 +7,7 @@ layout(
|
|||
local_size_y = 20
|
||||
) in;
|
||||
|
||||
//! include chunks/dof-cs.glsl
|
||||
//! include dof-cs.glsl
|
||||
|
||||
void main()
|
||||
{
|
|
@ -1,7 +1,7 @@
|
|||
#version 450 core
|
||||
|
||||
//! type fragment
|
||||
//! include chunks/dof.glsl
|
||||
//! include dof.glsl
|
||||
|
||||
void main()
|
||||
{
|
|
@ -20,4 +20,4 @@ layout( location = 4 ) uniform vec3 u_ResolutionTime;
|
|||
layout( location = 0 ) out vec3 o_Color;
|
||||
|
||||
|
||||
//!include lib/dof.glsl
|
||||
//!include dof-lib.glsl
|
|
@ -8,7 +8,7 @@
|
|||
#define FXAA_GATHER4_ALPHA 1
|
||||
#define FXAA_QUALITY__PRESET 39
|
||||
|
||||
//! include chunks/fxaa-3.11.glsl
|
||||
//! include fxaa-3.11.glsl
|
||||
|
||||
layout( location = 0 ) uniform sampler2D u_Input;
|
||||
layout( location = 1 ) uniform vec4 u_Viewport;
|
|
@ -126,7 +126,7 @@
|
|||
|
||||
|
||||
//! type library
|
||||
//! include lib/utils.glsl
|
||||
//! include utils.glsl
|
||||
|
||||
|
||||
|
|
@ -19,4 +19,4 @@ layout( location = 8 ) uniform int u_Correction;
|
|||
//layout( location = 1 ) out float o_Z;
|
||||
layout( binding = 0 , rgba16f ) writeonly uniform image2D u_Output;
|
||||
|
||||
//! include lib/raymarching.glsl
|
||||
//! include raymarching.glsl
|
|
@ -13,4 +13,4 @@ layout( location = 8 ) uniform int u_Correction;
|
|||
layout( location = 0 ) out vec3 o_Color;
|
||||
layout( location = 1 ) out float o_Z;
|
||||
|
||||
//! include lib/raymarching.glsl
|
||||
//! include raymarching.glsl
|
|
@ -1,5 +1,5 @@
|
|||
//! type library
|
||||
//! include lib/utils.glsl
|
||||
//! include utils.glsl
|
||||
|
||||
vec2 RM_Map( in vec3 pos );
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
//! type library
|
||||
//! include lib/utils.glsl
|
||||
//! include utils.glsl
|
||||
|
||||
|
||||
struct T_PBRMaterial
|
|
@ -1,12 +1,12 @@
|
|||
#version 450 core
|
||||
//! type compute
|
||||
|
||||
//! include chunks/raymarcher-cs.glsl
|
||||
//! include lib/hg_sdf.glsl
|
||||
//! include /lib/raymarcher-cs.glsl
|
||||
//! include /lib/hg_sdf.glsl
|
||||
|
||||
//! include lib/shading-pbr.glsl
|
||||
//! include lib/shading-blinnphong.glsl
|
||||
//! include lib/fog.glsl
|
||||
//! include /lib/shading-pbr.glsl
|
||||
//! include /lib/shading-blinnphong.glsl
|
||||
//! include /lib/fog.glsl
|
||||
|
||||
|
||||
T_BPMaterial BPMaterials[1] = {
|
|
@ -1,12 +1,12 @@
|
|||
#version 450 core
|
||||
//! type fragment
|
||||
|
||||
//! include chunks/raymarcher.glsl
|
||||
//! include lib/hg_sdf.glsl
|
||||
//! include /lib/raymarcher.glsl
|
||||
//! include /lib/hg_sdf.glsl
|
||||
|
||||
//! include lib/shading-pbr.glsl
|
||||
//! include lib/shading-blinnphong.glsl
|
||||
//! include lib/fog.glsl
|
||||
//! include /lib/shading-pbr.glsl
|
||||
//! include /lib/shading-blinnphong.glsl
|
||||
//! include /lib/fog.glsl
|
||||
|
||||
|
||||
T_BPMaterial BPMaterials[1] = {
|
Loading…
Add table
Add a link
Reference in a new issue