SLProject 4.0.000
SLGLProgramGenerated.cpp File Reference
#include <SLAssetManager.h>
#include <SLGLProgramManager.h>
#include <SLGLProgramGenerated.h>
#include <SLGLShader.h>
#include <SLCamera.h>
#include <SLLight.h>
#include <SLGLDepthBuffer.h>
Include dependency graph for SLGLProgramGenerated.cpp:

Variables

const string vertInput_a_pn
 
const string vertInput_PS_a_p
 
const string vertInput_PS_a_v
 
const string vertInput_PS_a_st
 
const string vertInput_PS_a_initV
 
const string vertInput_PS_a_r
 
const string vertInput_PS_a_r_angularVelo
 
const string vertInput_PS_a_texNum
 
const string vertInput_PS_a_initP
 
const string vertInput_a_uv0
 
const string vertInput_a_uv1
 
const string vertInput_a_tangent
 
const string vertInput_u_matrices_all
 
const string vertInput_u_matrix_vOmv
 
const string vertInput_u_lightNm
 
const string vertConstant_PS_pi
 
const string vertInput_PS_u_time
 
const string vertInput_PS_u_al_bernstein_alpha
 
const string vertInput_PS_u_al_bernstein_size
 
const string vertInput_PS_u_colorOvLF
 
const string vertInput_PS_u_deltaTime
 
const string vertInput_PS_u_pgPos
 
const string vertInput_PS_u_a_const
 
const string vertInput_PS_u_a_diffDir
 
const string vertInput_PS_u_g
 
const string vertInput_PS_u_angularVelo
 
const string vertInput_PS_u_col
 
const string vertInput_PS_u_row
 
const string vertInput_PS_u_condFB
 
const string vertOutput_v_P_VS
 
const string vertOutput_v_P_WS
 
const string vertOutput_v_N_VS
 
const string vertOutput_v_R_OS
 
const string vertOutput_v_uv0
 
const string vertOutput_v_uv1
 
const string vertOutput_v_lightVecTS
 
const string vertFunction_PS_ColorOverLT
 
const string vertOutput_PS_struct_Begin
 
const string vertOutput_PS_struct_t
 
const string vertOutput_PS_struct_r
 
const string vertOutput_PS_struct_s
 
const string vertOutput_PS_struct_c
 
const string vertOutput_PS_struct_texNum
 
const string vertOutput_PS_struct_End
 
const string vertOutput_PS_tf_p
 
const string vertOutput_PS_tf_v
 
const string vertOutput_PS_tf_st
 
const string vertOutput_PS_tf_initV
 
const string vertOutput_PS_tf_r
 
const string vertOutput_PS_tf_r_angularVelo
 
const string vertOutput_PS_tf_texNum
 
const string vertOutput_PS_tf_initP
 
const string vertMain_Begin
 
const string vertMain_v_P_VS
 
const string vertMain_v_P_WS_Sm
 
const string vertMain_v_N_VS
 
const string vertMain_v_R_OS
 
const string vertMain_v_uv0
 
const string vertMain_v_uv1
 
const string vertMain_TBN_Nm
 
const string vertMain_PS_v_a
 
const string vertMain_PS_v_t_default
 
const string vertMain_PS_v_t_begin
 
const string vertMain_PS_v_t_linear
 
const string vertMain_PS_v_t_curve
 
const string vertMain_PS_v_t_end
 
const string vertMain_PS_v_r
 
const string vertMain_PS_v_s
 
const string vertMain_PS_v_s_curve
 
const string vertMain_PS_v_doColorOverLT
 
const string vertMain_PS_v_texNum
 
const string vertMain_PS_EndAll
 
const string vertMain_PS_EndAll_VertBillboard
 
const string vertMain_EndAll
 
const string vertMain_PS_U_Begin
 
const string vertMain_PS_U_v_init_p
 
const string vertMain_PS_U_v_init_v
 
const string vertMain_PS_U_v_init_st
 
const string vertMain_PS_U_v_init_initV
 
const string vertMain_PS_U_v_init_r
 
const string vertMain_PS_U_v_init_r_angularVelo
 
const string vertMain_PS_U_v_init_texNum
 
const string vertMain_PS_U_v_init_initP
 
const string vertMain_PS_U_bornDead
 
const string vertMain_PS_U_reset_p
 
const string vertMain_PS_U_reset_shape_p
 
const string vertMain_PS_U_reset_v
 
const string vertMain_PS_U_reset_st_counterGap
 
const string vertMain_PS_U_reset_st
 
const string vertMain_PS_U_alive_p
 
const string vertMain_PS_U_v_rConst
 
const string vertMain_PS_U_v_rRange
 
const string vertMain_PS_U_alive_a_const
 
const string vertMain_PS_U_alive_a_diffDir
 
const string vertMain_PS_U_alive_g
 
const string vertMain_PS_U_alive_texNum
 
const string vertMain_PS_U_EndAll
 
const string geomConfig_PS
 
const string geomInput_PS_struct_Begin
 
const string geomInput_PS_struct_t
 
const string geomInput_PS_struct_r
 
const string geomInput_PS_struct_s
 
const string geomInput_PS_struct_c
 
const string geomInput_PS_struct_texNum
 
const string geomInput_PS_struct_End
 
const string geomInput_u_matrix_p
 
const string geomInput_u_matrix_vertBillboard
 
const string geomInput_PS_u_ScaRa
 
const string geomInput_PS_u_c
 
const string geomInput_PS_u_col
 
const string geomInput_PS_u_row
 
const string geomOutput_PS_v_pC
 
const string geomOutput_PS_v_tC
 
const string geomMain_PS_Begin
 
const string geomMain_PS_v_s
 
const string geomMain_PS_v_sS
 
const string geomMain_PS_v_rad
 
const string geomMain_PS_v_p
 
const string geomMain_PS_v_rot
 
const string geomMain_PS_v_rotIden
 
const string geomMain_PS_v_c
 
const string geomMain_PS_v_doColorOverLT
 
const string geomMain_PS_v_withoutColor
 
const string geomMain_PS_v_cT
 
const string geomMain_PS_fourCorners
 
const string geomMain_PS_fourCorners_vertBillboard
 
const string geomMain_PS_fourCorners_horizBillboard
 
const string geomMain_PS_Flipbook_fourCorners
 
const string geomMain_PS_Flipbook_fourCorners_horizBillboard
 
const string geomMain_PS_Flipbook_fourCorners_vertBillboard
 
const string geomMain_PS_EndAll
 
const string fragInput_v_P_VS
 
const string fragInput_v_P_WS
 
const string fragInput_v_N_VS
 
const string fragInput_v_R_OS
 
const string fragInput_v_uv0
 
const string fragInput_v_uv1
 
const string fragInput_v_lightVecTS
 
const string fragInput_PS_v_pC
 
const string fragInput_PS_v_tC
 
const string fragInput_PS_u_overG
 
const string fragInput_PS_u_wireFrame
 
const string fragMain_PS_TF
 
const string fragMain_PS
 
const string fragMain_PS_withoutColor
 
const string fragMain_PS_endAll
 
const string fragInput_u_lightAll
 
const string fragInput_u_matBlinnAll
 
const string fragInput_u_matAmbi
 
const string fragInput_u_matDiff
 
const string fragInput_u_matEmis
 
const string fragInput_u_matRough
 
const string fragInput_u_matMetal
 
const string fragInput_u_matTexDm
 
const string fragInput_u_matTexNm
 
const string fragInput_u_matTexEm
 
const string fragInput_u_matTexOm
 
const string fragInput_u_matTexRm
 
const string fragInput_u_matTexMm
 
const string fragInput_u_matTexRmMm
 
const string fragInput_u_matTexOmRmMm
 
const string fragInput_u_matGetsSm
 
const string fragInput_u_skyCookEnvMaps
 
const string fragInput_u_cam
 
const string fragOutputs_o_fragColor
 
const string fragFunctionsLightingBlinnPhong
 
const string fragFunctionsLightingCookTorrance
 
const string fragFunctionDoStereoSeparation
 
const string fragFunctionFogBlend
 
const string fragFunctionDoColoredShadows
 
const string fragMain_Begin
 
const string fragMain_0_Intensities
 
const string fragMain_1_EN_in_VS
 
const string fragMain_1_EN_in_TS
 
const string fragMain_1_matEmis
 
const string fragMain_1_matEmis_Em
 
const string fragMain_1_matOccl
 
const string fragMain_1_matOccl_Om0
 
const string fragMain_1_matOccl_Om1
 
const string fragMainBlinn_2_LightLoop
 
const string fragMainBlinn_2_LightLoopNm
 
const string fragMainBlinn_2_LightLoopSm
 
const string fragMainBlinn_2_LightLoopNmSm
 
const string fragMainBlinn_3_FragColor
 
const string fragMainBlinn_3_FragColorDm
 
const string fragMain_4_ColoredShadows
 
const string fragMain_5_FogGammaStereo
 
const string fragMainCook_1_matDiff
 
const string fragMainCook_1_matDiff_Dm
 
const string fragMainCook_1_matEmis
 
const string fragMainCook_1_matEmis_Em
 
const string fragMainCook_1_matRough
 
const string fragMainCook_1_matRough_Rm
 
const string fragMainCook_1_matRough_RMm
 
const string fragMainCook_1_matRough_ORMm
 
const string fragMainCook_1_matMetal
 
const string fragMainCook_1_matMetal_Mm
 
const string fragMainCook_1_matMetal_RMm
 
const string fragMainCook_1_matMetal_ORMm
 
const string fragMainCook_1_matOcclu_1
 
const string fragMainCook_1_matOcclu_Om
 
const string fragMainCook_1_matOcclu_ORMm
 
const string fragMainCook_2_LightLoop
 
const string fragMainCook_2_LightLoopNm
 
const string fragMainCook_2_LightLoopSm
 
const string fragMainCook_2_LightLoopNmSm
 
const string fragMainCook_3_FragColor
 
const string fragMainCook_3_FragColorSky
 
const string fragMainVideoBkgd
 

Variable Documentation

◆ fragFunctionDoColoredShadows

const string fragFunctionDoColoredShadows

◆ fragFunctionDoStereoSeparation

const string fragFunctionDoStereoSeparation

◆ fragFunctionFogBlend

const string fragFunctionFogBlend
Initial value:
= R"(
//-----------------------------------------------------------------------------
vec4 fogBlend(vec3 P_VS, vec4 inColor)
{
float factor = 0.0f;
float distance = length(P_VS);
switch (u_camFogMode)
{
case 0:
factor = (u_camFogEnd - distance) / (u_camFogEnd - u_camFogStart);
break;
case 1:
factor = exp(-u_camFogDensity * distance);
break;
default:
factor = exp(-u_camFogDensity * distance * u_camFogDensity * distance);
break;
}
vec4 outColor = factor * inColor + (1.0 - factor) * u_camFogColor;
outColor = clamp(outColor, 0.0, 1.0);
return outColor;
})"

◆ fragFunctionsLightingBlinnPhong

const string fragFunctionsLightingBlinnPhong

◆ fragFunctionsLightingCookTorrance

const string fragFunctionsLightingCookTorrance

◆ fragInput_PS_u_overG

const string fragInput_PS_u_overG
Initial value:
= R"(
uniform float u_oneOverGamma; // 1.0f / Gamma correction value)"

◆ fragInput_PS_u_wireFrame

const string fragInput_PS_u_wireFrame
Initial value:
= R"(
uniform bool u_doWireFrame; // Boolean for wireFrame)"

◆ fragInput_PS_v_pC

const string fragInput_PS_v_pC
Initial value:
= R"(
in vec4 v_particleColor; // interpolated color from the geometry shader)"

◆ fragInput_PS_v_tC

const string fragInput_PS_v_tC
Initial value:
= R"(
in vec2 v_texCoord; // interpolated texture coordinate)"

◆ fragInput_u_cam

const string fragInput_u_cam
Initial value:
= R"(
uniform int u_camProjType; // type of stereo
uniform int u_camStereoEye; // -1=left, 0=center, 1=right
uniform mat3 u_camStereoColors; // color filter matrix
uniform bool u_camFogIsOn; // flag if fog is on
uniform int u_camFogMode; // 0=LINEAR, 1=EXP, 2=EXP2
uniform float u_camFogDensity; // fog density value
uniform float u_camFogStart; // fog start distance
uniform float u_camFogEnd; // fog end distance
uniform vec4 u_camFogColor; // fog color (usually the background)
uniform float u_camClipNear; // camera near plane
uniform float u_camClipFar; // camera far plane
uniform float u_camBkgdWidth; // camera background width
uniform float u_camBkgdHeight; // camera background height
uniform float u_camBkgdLeft; // camera background left
uniform float u_camBkgdBottom; // camera background bottom)"

◆ fragInput_u_lightAll

const string fragInput_u_lightAll
Initial value:
= R"(
uniform bool u_lightIsOn[NUM_LIGHTS]; // flag if light is on
uniform vec4 u_lightPosVS[NUM_LIGHTS]; // position of light in view space
uniform vec4 u_lightAmbi[NUM_LIGHTS]; // ambient light intensity (Ia)
uniform vec4 u_lightDiff[NUM_LIGHTS]; // diffuse light intensity (Id)
uniform vec4 u_lightSpec[NUM_LIGHTS]; // specular light intensity (Is)
uniform vec3 u_lightSpotDir[NUM_LIGHTS]; // spot direction in view space
uniform float u_lightSpotDeg[NUM_LIGHTS]; // spot cutoff angle 1-180 degrees
uniform float u_lightSpotCos[NUM_LIGHTS]; // cosine of spot cutoff angle
uniform float u_lightSpotExp[NUM_LIGHTS]; // spot exponent
uniform vec3 u_lightAtt[NUM_LIGHTS]; // attenuation (const,linear,quadr.)
uniform bool u_lightDoAtt[NUM_LIGHTS]; // flag if att. must be calc.
uniform vec4 u_globalAmbi; // Global ambient scene color
uniform float u_oneOverGamma; // 1.0f / Gamma correction value
)"

◆ fragInput_u_matAmbi

const string fragInput_u_matAmbi
Initial value:
= R"(
uniform vec4 u_matAmbi; // ambient color reflection coefficient (ka))"

◆ fragInput_u_matBlinnAll

const string fragInput_u_matBlinnAll
Initial value:
= R"(
uniform vec4 u_matAmbi; // ambient color reflection coefficient (ka)
uniform vec4 u_matDiff; // diffuse color reflection coefficient (kd)
uniform vec4 u_matSpec; // specular color reflection coefficient (ks)
uniform vec4 u_matEmis; // emissive color for self-shining materials
uniform float u_matShin; // shininess exponent
)"

◆ fragInput_u_matDiff

const string fragInput_u_matDiff
Initial value:
= R"(
uniform vec4 u_matDiff; // diffuse color reflection coefficient (kd))"

◆ fragInput_u_matEmis

const string fragInput_u_matEmis
Initial value:
= R"(
uniform vec4 u_matEmis; // emissive color (ke))"

◆ fragInput_u_matGetsSm

const string fragInput_u_matGetsSm
Initial value:
= R"(
uniform bool u_matGetsShadows; // flag if material receives shadows)"

◆ fragInput_u_matMetal

const string fragInput_u_matMetal
Initial value:
= R"(
uniform float u_matMetal; // metalness factor (0-1)"

◆ fragInput_u_matRough

const string fragInput_u_matRough
Initial value:
= R"(
uniform float u_matRough; // roughness factor (0-1))"

◆ fragInput_u_matTexDm

const string fragInput_u_matTexDm
Initial value:
= R"(
uniform sampler2D u_matTextureDiffuse0; // Diffuse color map)"

◆ fragInput_u_matTexEm

const string fragInput_u_matTexEm
Initial value:
= R"(
uniform sampler2D u_matTextureEmissive0; // PBR material emissive texture)"

◆ fragInput_u_matTexMm

const string fragInput_u_matTexMm
Initial value:
= R"(
uniform sampler2D u_matTextureMetallic0; // PBR material metallic texture)"

◆ fragInput_u_matTexNm

const string fragInput_u_matTexNm
Initial value:
= R"(
uniform sampler2D u_matTextureNormal0; // Normal bump map)"

◆ fragInput_u_matTexOm

const string fragInput_u_matTexOm
Initial value:
= R"(
uniform sampler2D u_matTextureOcclusion0; // Ambient occlusion map)"

◆ fragInput_u_matTexOmRmMm

const string fragInput_u_matTexOmRmMm
Initial value:
= R"(
uniform sampler2D u_matTextureOccluRoughMetal0; // PBR material occlusion-roughness-metalic texture)"

◆ fragInput_u_matTexRm

const string fragInput_u_matTexRm
Initial value:
= R"(
uniform sampler2D u_matTextureRoughness0; // PBR material roughness texture)"

◆ fragInput_u_matTexRmMm

const string fragInput_u_matTexRmMm
Initial value:
= R"(
uniform sampler2D u_matTextureRoughMetal0; // PBR material roughness-metallic texture)"

◆ fragInput_u_skyCookEnvMaps

const string fragInput_u_skyCookEnvMaps
Initial value:
= R"(
uniform samplerCube u_skyIrradianceCubemap; // PBR skybox irradiance light
uniform samplerCube u_skyRoughnessCubemap; // PBR skybox cubemap for rough reflections
uniform sampler2D u_skyBrdfLutTexture; // PBR lighting lookup table for BRDF
uniform float u_skyExposure; // PBR skybox exposure)"

◆ fragInput_v_lightVecTS

const string fragInput_v_lightVecTS
Initial value:
= R"(
in vec3 v_eyeDirTS; // Vector to the eye in tangent space
in vec3 v_lightDirTS[NUM_LIGHTS]; // Vector to light 0 in tangent space
in vec3 v_spotDirTS[NUM_LIGHTS]; // Spot direction in tangent space)"

◆ fragInput_v_N_VS

const string fragInput_v_N_VS
Initial value:
= R"(
in vec3 v_N_VS; // Interpol. normal at v_P_VS in view space)"

◆ fragInput_v_P_VS

const string fragInput_v_P_VS
Initial value:
= R"(
in vec3 v_P_VS; // Interpol. point of illumination in view space (VS))"

◆ fragInput_v_P_WS

const string fragInput_v_P_WS
Initial value:
= R"(
in vec3 v_P_WS; // Interpol. point of illumination in world space (WS))"

◆ fragInput_v_R_OS

const string fragInput_v_R_OS
Initial value:
= R"(
in vec3 v_R_OS; // Interpol. reflect in object space)"

◆ fragInput_v_uv0

const string fragInput_v_uv0
Initial value:
= R"(
in vec2 v_uv0; // Texture coordinate varying)"

◆ fragInput_v_uv1

const string fragInput_v_uv1
Initial value:
= R"(
in vec2 v_uv1; // Texture coordinate varying)"

◆ fragMain_0_Intensities

const string fragMain_0_Intensities
Initial value:
= R"(
vec4 Ia = vec4(0.0); // Accumulated ambient light intensity at v_P_VS
vec4 Id = vec4(0.0); // Accumulated diffuse light intensity at v_P_VS
vec4 Is = vec4(0.0); // Accumulated specular light intensity at v_P_VS
)"

◆ fragMain_1_EN_in_TS

const string fragMain_1_EN_in_TS
Initial value:
= R"(
vec3 E = normalize(v_eyeDirTS); // normalized interpolated eye direction
// Get normal from normal map, move from [0,1] to [-1, 1] range & normalize
vec3 N = normalize(texture(u_matTextureNormal0, v_uv0).rgb * 2.0 - 1.0);
)"

◆ fragMain_1_EN_in_VS

const string fragMain_1_EN_in_VS
Initial value:
= R"(
vec3 E = normalize(-v_P_VS); // Interpolated vector from p to the eye
vec3 N = normalize(v_N_VS); // A input normal has not anymore unit length
)"

◆ fragMain_1_matEmis

const string fragMain_1_matEmis
Initial value:
= R"(
vec4 matEmis = u_matEmis;)"

◆ fragMain_1_matEmis_Em

const string fragMain_1_matEmis_Em
Initial value:
= R"(
vec4 matEmis = texture(u_matTextureEmissive0, v_uv0);)"

◆ fragMain_1_matOccl

const string fragMain_1_matOccl
Initial value:
= R"(
float matOccl = 1.0;)"

◆ fragMain_1_matOccl_Om0

const string fragMain_1_matOccl_Om0
Initial value:
= R"(
float matOccl = texture(u_matTextureOcclusion0, v_uv0).r;)"

◆ fragMain_1_matOccl_Om1

const string fragMain_1_matOccl_Om1
Initial value:
= R"(
float matOccl = texture(u_matTextureOcclusion0, v_uv1).r;)"

◆ fragMain_4_ColoredShadows

const string fragMain_4_ColoredShadows
Initial value:
= R"(
// Colorize cascaded shadows for debugging purpose
if (u_lightsDoColoredShadows)
doColoredShadows(N);
)"

◆ fragMain_5_FogGammaStereo

const string fragMain_5_FogGammaStereo
Initial value:
= R"(
// Apply fog by blending over distance
if (u_camFogIsOn)
o_fragColor = fogBlend(v_P_VS, o_fragColor);
// Apply gamma correction
o_fragColor.rgb = pow(o_fragColor.rgb, vec3(u_oneOverGamma));
// Apply stereo eye separation
if (u_camProjType > 1)
doStereoSeparation();
}
)"

◆ fragMain_Begin

const string fragMain_Begin
Initial value:
= R"(
//-----------------------------------------------------------------------------
void main()
{)"

◆ fragMain_PS

const string fragMain_PS
Initial value:
= R"(
void main()
{
// Just set the interpolated color from the vertex shader
o_fragColor = v_particleColor;
// componentwise multiply w. texture color
if(!u_doWireFrame)
o_fragColor *= texture(u_matTextureDiffuse0, v_texCoord);
if(o_fragColor.a < 0.001)
discard;
)"

◆ fragMain_PS_endAll

const string fragMain_PS_endAll
Initial value:
= R"(
//Same color for each wireframe
if(u_doWireFrame)
o_fragColor = vec4(0,0,0,1.0);
o_fragColor.rgb = pow(o_fragColor.rgb, vec3(u_oneOverGamma));
})"

◆ fragMain_PS_TF

const string fragMain_PS_TF
Initial value:
= R"(
out vec4 o_fragColor; // output fragment color
void main()
{
o_fragColor = vec4(0,0,0,0); // Need to be here for the compilation
}
)"

◆ fragMain_PS_withoutColor

const string fragMain_PS_withoutColor
Initial value:
= R"(
void main()
{
// componentwise multiply w. texture color
if(!u_doWireFrame)
o_fragColor = texture(u_matTextureDiffuse0, v_texCoord);
else
o_fragColor = vec4(0,0,0,1.0);
o_fragColor.a *= v_particleColor.a;
if(o_fragColor.a < 0.001)
discard;
)"

◆ fragMainBlinn_2_LightLoop

const string fragMainBlinn_2_LightLoop
Initial value:
= R"(
for (int i = 0; i < NUM_LIGHTS; ++i)
{
if (u_lightIsOn[i])
{
if (u_lightPosVS[i].w == 0.0)
{
// We use the spot light direction as the light direction vector
vec3 S = normalize(-u_lightSpotDir[i].xyz);
directLightBlinnPhong(i, N, E, S, 0.0, Ia, Id, Is);
}
else
{
vec3 S = u_lightSpotDir[i]; // normalized spot direction in VS
vec3 L = u_lightPosVS[i].xyz - v_P_VS; // Vector from v_P to light in VS
pointLightBlinnPhong(i, N, E, S, L, 0.0, Ia, Id, Is);
}
}
}
)"

◆ fragMainBlinn_2_LightLoopNm

const string fragMainBlinn_2_LightLoopNm
Initial value:
= R"(
for (int i = 0; i < NUM_LIGHTS; ++i)
{
if (u_lightIsOn[i])
{
if (u_lightPosVS[i].w == 0.0)
{
// We use the spot light direction as the light direction vector
vec3 S = normalize(-v_spotDirTS[i]);
directLightBlinnPhong(i, N, E, S, 0.0, Ia, Id, Is);
}
else
{
vec3 S = normalize(v_spotDirTS[i]); // normalized spot direction in TS
vec3 L = v_lightDirTS[i]; // Vector from v_P to light in TS
pointLightBlinnPhong(i, N, E, S, L, 0.0, Ia, Id, Is);
}
}
}
)"

◆ fragMainBlinn_2_LightLoopNmSm

const string fragMainBlinn_2_LightLoopNmSm
Initial value:
= R"(
for (int i = 0; i < NUM_LIGHTS; ++i)
{
if (u_lightIsOn[i])
{
if (u_lightPosVS[i].w == 0.0)
{
// We use the spot light direction as the light direction vector
vec3 S = normalize(-v_spotDirTS[i]);
// Test if the current fragment is in shadow
float shadow = u_matGetsShadows ? shadowTest(i, N, S) : 0.0;
directLightBlinnPhong(i, N, E, S, shadow, Ia, Id, Is);
}
else
{
vec3 S = normalize(v_spotDirTS[i]); // normalized spot direction in TS
vec3 L = v_lightDirTS[i]; // Vector from v_P to light in TS
// Test if the current fragment is in shadow
float shadow = u_matGetsShadows ? shadowTest(i, N, L) : 0.0;
pointLightBlinnPhong(i, N, E, S, L, shadow, Ia, Id, Is);
}
}
}
)"

◆ fragMainBlinn_2_LightLoopSm

const string fragMainBlinn_2_LightLoopSm
Initial value:
= R"(
for (int i = 0; i < NUM_LIGHTS; ++i)
{
if (u_lightIsOn[i])
{
if (u_lightPosVS[i].w == 0.0)
{
// We use the spot light direction as the light direction vector
vec3 S = normalize(-u_lightSpotDir[i].xyz);
// Test if the current fragment is in shadow
float shadow = u_matGetsShadows ? shadowTest(i, N, S) : 0.0;
directLightBlinnPhong(i, N, E, S, shadow, Ia, Id, Is);
}
else
{
vec3 S = u_lightSpotDir[i]; // normalized spot direction in VS
vec3 L = u_lightPosVS[i].xyz - v_P_VS; // Vector from v_P to light in VS
// Test if the current fragment is in shadow
float shadow = u_matGetsShadows ? shadowTest(i, N, L) : 0.0;
pointLightBlinnPhong(i, N, E, S, L, shadow, Ia, Id, Is);
}
}
}
)"

◆ fragMainBlinn_3_FragColor

const string fragMainBlinn_3_FragColor
Initial value:
= R"(
// Sum up all the reflected color components
o_fragColor = u_matEmis +
u_globalAmbi +
Ia * u_matAmbi * matOccl +
Id * u_matDiff +
Is * u_matSpec;
// For correct alpha blending overwrite alpha component
o_fragColor.a = u_matDiff.a;
)"

◆ fragMainBlinn_3_FragColorDm

const string fragMainBlinn_3_FragColorDm
Initial value:
= R"(
// Sum up all the reflected color components
o_fragColor = u_matEmis +
u_globalAmbi +
Ia * u_matAmbi * matOccl +
Id * u_matDiff;
// Componentwise multiply w. texture color
o_fragColor *= texture(u_matTextureDiffuse0, v_uv0);
// add finally the specular RGB-part
vec4 specColor = Is * u_matSpec;
o_fragColor.rgb += specColor.rgb;
)"

◆ fragMainCook_1_matDiff

const string fragMainCook_1_matDiff
Initial value:
= R"(
vec4 matDiff = u_matDiff;)"

◆ fragMainCook_1_matDiff_Dm

const string fragMainCook_1_matDiff_Dm
Initial value:
= R"(
vec4 matDiff = pow(texture(u_matTextureDiffuse0, v_uv0), vec4(2.2));)"

◆ fragMainCook_1_matEmis

const string fragMainCook_1_matEmis
Initial value:
= R"(
vec4 matEmis = u_matEmis;)"

◆ fragMainCook_1_matEmis_Em

const string fragMainCook_1_matEmis_Em
Initial value:
= R"(
vec4 matEmis = pow(texture(u_matTextureEmissive0, v_uv0), vec4(2.2));)"

◆ fragMainCook_1_matMetal

const string fragMainCook_1_matMetal
Initial value:
= R"(
float matMetal = u_matMetal;)"

◆ fragMainCook_1_matMetal_Mm

const string fragMainCook_1_matMetal_Mm
Initial value:
= R"(
float matMetal = texture(u_matTextureMetallic0, v_uv0).r;)"

◆ fragMainCook_1_matMetal_ORMm

const string fragMainCook_1_matMetal_ORMm
Initial value:
= R"(
float matMetal = texture(u_matTextureOccluRoughMetal0, v_uv0).b;)"

◆ fragMainCook_1_matMetal_RMm

const string fragMainCook_1_matMetal_RMm
Initial value:
= R"(
float matMetal = texture(u_matTextureRoughMetal0, v_uv0).b;)"

◆ fragMainCook_1_matOcclu_1

const string fragMainCook_1_matOcclu_1
Initial value:
= R"(
float matOccl = 1.0;)"

◆ fragMainCook_1_matOcclu_Om

const string fragMainCook_1_matOcclu_Om
Initial value:
= R"(
float matOccl = texture(u_matTextureOcclusion0, v_uv0).r;)"

◆ fragMainCook_1_matOcclu_ORMm

const string fragMainCook_1_matOcclu_ORMm
Initial value:
= R"(
float matOccl = texture(u_matTextureOccluRoughMetal0, v_uv0).r;)"

◆ fragMainCook_1_matRough

const string fragMainCook_1_matRough
Initial value:
= R"(
float matRough = u_matRough;)"

◆ fragMainCook_1_matRough_ORMm

const string fragMainCook_1_matRough_ORMm
Initial value:
= R"(
float matRough = texture(u_matTextureOccluRoughMetal0, v_uv0).g;)"

◆ fragMainCook_1_matRough_Rm

const string fragMainCook_1_matRough_Rm
Initial value:
= R"(
float matRough = texture(u_matTextureRoughness0, v_uv0).r;)"

◆ fragMainCook_1_matRough_RMm

const string fragMainCook_1_matRough_RMm
Initial value:
= R"(
float matRough = texture(u_matTextureRoughMetal0, v_uv0).g;)"

◆ fragMainCook_2_LightLoop

const string fragMainCook_2_LightLoop

◆ fragMainCook_2_LightLoopNm

const string fragMainCook_2_LightLoopNm

◆ fragMainCook_2_LightLoopNmSm

const string fragMainCook_2_LightLoopNmSm

◆ fragMainCook_2_LightLoopSm

const string fragMainCook_2_LightLoopSm

◆ fragMainCook_3_FragColor

const string fragMainCook_3_FragColor
Initial value:
= R"(
// ambient lighting (note that the next IBL tutorial will replace
// this ambient lighting with environment lighting).
vec3 ambient = vec3(0.03) * matDiff.rgb * matOccl;
vec3 color = ambient + matEmis.rgb + Lo;
// HDR tone-mapping
color = color / (color + vec3(1.0));
o_fragColor = vec4(color, 1.0);
// For correct alpha blending overwrite alpha component
o_fragColor.a = matDiff.a;
)"

◆ fragMainCook_3_FragColorSky

const string fragMainCook_3_FragColorSky
Initial value:
= R"(
// Build diffuse reflection from environment light map
vec3 F = fresnelSchlickRoughness(max(dot(N, E), 0.0), F0, matRough);
vec3 kS = F;
vec3 kD = 1.0 - kS;
kD *= 1.0 - matMetal;
vec3 irradiance = texture(u_skyIrradianceCubemap, N).rgb;
vec3 diffuse = kD * irradiance * matDiff.rgb;
// sample both the pre-filter map and the BRDF lut and combine them together as per the split-sum approximation to get the IBL specular part.
const float MAX_REFLECTION_LOD = 4.0;
vec3 prefilteredColor = textureLod(u_skyRoughnessCubemap, v_R_OS, matRough * MAX_REFLECTION_LOD).rgb;
vec2 brdf = texture(u_skyBrdfLutTexture, vec2(max(dot(N, E), 0.0), matRough)).rg;
vec3 specular = prefilteredColor * (F * brdf.x + brdf.y);
vec3 ambient = (diffuse + specular) * matOccl;
vec3 color = ambient + matEmis.rgb + Lo;
// Exposure tone mapping
vec3 mapped = vec3(1.0) - exp(-color * u_skyExposure);
o_fragColor = vec4(mapped, 1.0);
// For correct alpha blending overwrite alpha component
o_fragColor.a = matDiff.a;
)"

◆ fragMainVideoBkgd

const string fragMainVideoBkgd

◆ fragOutputs_o_fragColor

const string fragOutputs_o_fragColor
Initial value:
= R"(
out vec4 o_fragColor; // output fragment color)"

◆ geomConfig_PS

const string geomConfig_PS
Initial value:
= R"(
layout (points) in; // Primitives that we received from vertex shader
layout (triangle_strip, max_vertices = 4) out; // Primitives that we will output and number of vertex that will be output)"

◆ geomInput_PS_struct_Begin

const string geomInput_PS_struct_Begin
Initial value:
= R"(
in vertex { )"

◆ geomInput_PS_struct_c

const string geomInput_PS_struct_c
Initial value:
= R"(
vec3 color; // Color of a particle )"

◆ geomInput_PS_struct_End

const string geomInput_PS_struct_End
Initial value:
= R"(
} vert[]; )"

◆ geomInput_PS_struct_r

const string geomInput_PS_struct_r
Initial value:
= R"(
float rotation; // Rotation of a particle)"

◆ geomInput_PS_struct_s

const string geomInput_PS_struct_s
Initial value:
= R"(
float size; // Size of a particle )"

◆ geomInput_PS_struct_t

const string geomInput_PS_struct_t
Initial value:
= R"(
float transparency; // Transparency of a particle)"

◆ geomInput_PS_struct_texNum

const string geomInput_PS_struct_texNum
Initial value:
= R"(
uint texNum; // Num of texture in flipbook)"

◆ geomInput_PS_u_c

const string geomInput_PS_u_c
Initial value:
= R"(
uniform vec4 u_color; // Particle color)"

◆ geomInput_PS_u_col

const string geomInput_PS_u_col
Initial value:
= R"(
uniform int u_col; // Number of column of flipbook texture)"

◆ geomInput_PS_u_row

const string geomInput_PS_u_row
Initial value:
= R"(
uniform int u_row; // Number of row of flipbook texture)"

◆ geomInput_PS_u_ScaRa

const string geomInput_PS_u_ScaRa
Initial value:
= R"(
uniform float u_scale; // Particle scale
uniform float u_radiusW; // Particle width radius)
uniform float u_radiusH; // Particle height radius)"

◆ geomInput_u_matrix_p

const string geomInput_u_matrix_p
Initial value:
= R"(
uniform mat4 u_pMatrix; // Projection matrix)"

◆ geomInput_u_matrix_vertBillboard

const string geomInput_u_matrix_vertBillboard
Initial value:
= R"(
uniform mat4 u_vYawPMatrix; // Projection matrix)"

◆ geomMain_PS_Begin

const string geomMain_PS_Begin
Initial value:
= R"(
void main()
{)"

◆ geomMain_PS_EndAll

const string geomMain_PS_EndAll
Initial value:
= R"(
EndPrimitive(); // Send primitives to fragment shader
} )"

◆ geomMain_PS_Flipbook_fourCorners

const string geomMain_PS_Flipbook_fourCorners

◆ geomMain_PS_Flipbook_fourCorners_horizBillboard

const string geomMain_PS_Flipbook_fourCorners_horizBillboard

◆ geomMain_PS_Flipbook_fourCorners_vertBillboard

const string geomMain_PS_Flipbook_fourCorners_vertBillboard

◆ geomMain_PS_fourCorners

const string geomMain_PS_fourCorners
Initial value:
= R"(
//BOTTOM LEFT
vec4 va = vec4(P.xy + (rot * vec2(-radiusW, -radiusH)), P.z, 1); //Position in view space
gl_Position = u_pMatrix * va; // Calculate position in clip space
v_texCoord = vec2(0.0, 0.0); // Texture coordinate
v_particleColor = color;
EmitVertex();
//BOTTOM RIGHT
vec4 vd = vec4(P.xy + (rot * vec2(radiusW, -radiusH)), P.z,1);
gl_Position = u_pMatrix * vd;
v_texCoord = vec2(1.0, 0.0);
v_particleColor = color;
EmitVertex();
//TOP LEFT
vec4 vb = vec4(P.xy + (rot * vec2(-radiusW,radiusH)) , P.z,1);
gl_Position = u_pMatrix * vb;
v_texCoord = vec2(0.0, 1.0);
v_particleColor = color;
EmitVertex();
//TOP RIGHT
vec4 vc = vec4(P.xy + (rot *vec2(radiusW, radiusH)), P.z,1);
gl_Position = u_pMatrix * vc;
v_texCoord = vec2(1.0, 1.0);
v_particleColor = color;
EmitVertex();)"

◆ geomMain_PS_fourCorners_horizBillboard

const string geomMain_PS_fourCorners_horizBillboard

◆ geomMain_PS_fourCorners_vertBillboard

const string geomMain_PS_fourCorners_vertBillboard
Initial value:
= R"(
//BOTTOM LEFT
vec4 va = vec4(P.xy + (rot * vec2(-radiusW, -radiusH)), P.z, 1); //Position in view space
gl_Position = u_pMatrix * (u_vYawPMatrix * va); // Calculate position in clip space
v_texCoord = vec2(0.0, 0.0); // Texture coordinate
v_particleColor = color;
EmitVertex();
//BOTTOM RIGHT
vec4 vd = vec4(P.xy + (rot * vec2(radiusW, -radiusH)), P.z,1);
gl_Position = u_pMatrix * (u_vYawPMatrix *vd);
v_texCoord = vec2(1.0, 0.0);
v_particleColor = color;
EmitVertex();
//TOP LEFT
vec4 vb = vec4(P.xy + (rot * vec2(-radiusW,radiusH)) , P.z,1);
gl_Position = u_pMatrix * (u_vYawPMatrix * vb);
v_texCoord = vec2(0.0, 1.0);
v_particleColor = color;
EmitVertex();
//TOP RIGHT
vec4 vc = vec4(P.xy + (rot *vec2(radiusW, radiusH)), P.z,1);
gl_Position = u_pMatrix * (u_vYawPMatrix * vc);
v_texCoord = vec2(1.0, 1.0);
v_particleColor = color;
EmitVertex(); )"

◆ geomMain_PS_v_c

const string geomMain_PS_v_c
Initial value:
= R"(
vec4 color = u_color; // Particle color)"

◆ geomMain_PS_v_cT

const string geomMain_PS_v_cT
Initial value:
= R"(
color.w *= vert[0].transparency; // Apply transparency)"

◆ geomMain_PS_v_doColorOverLT

const string geomMain_PS_v_doColorOverLT
Initial value:
= R"(
vec4 color = vec4(vert[0].color, 1.0); // Particle color)"

◆ geomMain_PS_v_p

const string geomMain_PS_v_p
Initial value:
= R"(
vec4 P = gl_in[0].gl_Position; // Position of the point that we received)"

◆ geomMain_PS_v_rad

const string geomMain_PS_v_rad
Initial value:
= R"(
float radiusW = u_radiusW * scale;
float radiusH = u_radiusH * scale;)"

◆ geomMain_PS_v_rot

const string geomMain_PS_v_rot
Initial value:
= R"(
mat2 rot = mat2(cos(vert[0].rotation),-sin(vert[0].rotation),
sin(vert[0].rotation), cos(vert[0].rotation)); // Matrix of rotation)"

◆ geomMain_PS_v_rotIden

const string geomMain_PS_v_rotIden
Initial value:
= R"(
mat2 rot = mat2(1.0, 0.0, 0.0, 1.0); // Matrix of rotation)"

◆ geomMain_PS_v_s

const string geomMain_PS_v_s
Initial value:
= R"(
float scale = u_scale;)"

◆ geomMain_PS_v_sS

const string geomMain_PS_v_sS
Initial value:
= R"(
scale *= vert[0].size;)"

◆ geomMain_PS_v_withoutColor

const string geomMain_PS_v_withoutColor
Initial value:
= R"(
vec4 color = vec4( 0.0, 0.0, 0.0, 1.0); // Particle color)"

◆ geomOutput_PS_v_pC

const string geomOutput_PS_v_pC
Initial value:
= R"(
out vec4 v_particleColor; // The resulting color per vertex)"

◆ geomOutput_PS_v_tC

const string geomOutput_PS_v_tC
Initial value:
= R"(
out vec2 v_texCoord; // Texture coordinate at vertex)"

◆ vertConstant_PS_pi

const string vertConstant_PS_pi
Initial value:
= R"(
#define PI 3.1415926538
#define TWOPI 6.2831853076
)"

◆ vertFunction_PS_ColorOverLT

const string vertFunction_PS_ColorOverLT
Initial value:
= R"(
vec3 colorByAge(float age)
{
int cachePos = int(clamp(age, 0.0, 1.0) * 255.0) * 3;
vec3 color = vec3(u_colorArr[cachePos], u_colorArr[cachePos + 1], u_colorArr[cachePos + 2]);
return color;
})"

◆ vertInput_a_pn

const string vertInput_a_pn
Initial value:
= R"(
layout (location = 0) in vec4 a_position; // Vertex position attribute
layout (location = 1) in vec3 a_normal; // Vertex normal attribute)"

◆ vertInput_a_tangent

const string vertInput_a_tangent
Initial value:
= R"(
layout (location = 5) in vec4 a_tangent; // Vertex tangent attribute)"

◆ vertInput_a_uv0

const string vertInput_a_uv0
Initial value:
= R"(
layout (location = 2) in vec2 a_uv0; // Vertex tex.coord. 1 for diffuse color)"

◆ vertInput_a_uv1

const string vertInput_a_uv1
Initial value:
= R"(
layout (location = 3) in vec2 a_uv1; // Vertex tex.coord. 2 for AO)"

◆ vertInput_PS_a_initP

const string vertInput_PS_a_initP
Initial value:
= R"(
layout (location = 7) in vec3 a_initialPosition;// Particle initial position attribute)"

◆ vertInput_PS_a_initV

const string vertInput_PS_a_initV
Initial value:
= R"(
layout (location = 3) in vec3 a_initialVelocity;// Particle initial velocity attribute)"

◆ vertInput_PS_a_p

const string vertInput_PS_a_p
Initial value:
= R"(
layout (location = 0) in vec3 a_position; // Particle position attribute)"

◆ vertInput_PS_a_r

const string vertInput_PS_a_r
Initial value:
= R"(
layout (location = 4) in float a_rotation; // Particle rotation attribute)"

◆ vertInput_PS_a_r_angularVelo

const string vertInput_PS_a_r_angularVelo
Initial value:
= R"(
layout (location = 5) in float a_angularVelo; // Particle rotation rate attribute)"

◆ vertInput_PS_a_st

const string vertInput_PS_a_st
Initial value:
= R"(
layout (location = 2) in float a_startTime; // Particle start time attribute)"

◆ vertInput_PS_a_texNum

const string vertInput_PS_a_texNum
Initial value:
= R"(
layout (location = 6) in uint a_texNum; // Particle rotation attribute)"

◆ vertInput_PS_a_v

const string vertInput_PS_a_v
Initial value:
= R"(
layout (location = 1) in vec3 a_velocity; // Particle velocity attribute)"

◆ vertInput_PS_u_a_const

const string vertInput_PS_u_a_const
Initial value:
= R"(
uniform float u_accConst; // Particle acceleration constant)"

◆ vertInput_PS_u_a_diffDir

const string vertInput_PS_u_a_diffDir
Initial value:
= R"(
uniform vec3 u_acceleration; // Particle acceleration)"

◆ vertInput_PS_u_al_bernstein_alpha

const string vertInput_PS_u_al_bernstein_alpha
Initial value:
= R"(
uniform vec4 u_al_bernstein; // Bernstein polynomial for alpha over time)"

◆ vertInput_PS_u_al_bernstein_size

const string vertInput_PS_u_al_bernstein_size
Initial value:
= R"(
uniform vec4 u_si_bernstein; // Bernstein polynomial for size over time)"

◆ vertInput_PS_u_angularVelo

const string vertInput_PS_u_angularVelo
Initial value:
= R"(
uniform float u_angularVelo; // Particle angular velocity)"

◆ vertInput_PS_u_col

const string vertInput_PS_u_col
Initial value:
= R"(
uniform int u_col; // Number of column of flipbook texture)"

◆ vertInput_PS_u_colorOvLF

const string vertInput_PS_u_colorOvLF
Initial value:
= R"(
uniform float u_colorArr[256 * 3]; // Array of color value (for color over life))"

◆ vertInput_PS_u_condFB

const string vertInput_PS_u_condFB
Initial value:
= R"(
uniform int u_condFB; // Condition to update texNum)"

◆ vertInput_PS_u_deltaTime

const string vertInput_PS_u_deltaTime
Initial value:
= R"(
uniform float u_deltaTime; // Elapsed time between frames)"

◆ vertInput_PS_u_g

const string vertInput_PS_u_g
Initial value:
= R"(
uniform vec3 u_gravity; // Particle gravity)"

◆ vertInput_PS_u_pgPos

const string vertInput_PS_u_pgPos
Initial value:
= R"(
uniform vec3 u_pGPosition; // Particle Generator position)"

◆ vertInput_PS_u_row

const string vertInput_PS_u_row
Initial value:
= R"(
uniform int u_row; // Number of row of flipbook texture)"

◆ vertInput_PS_u_time

const string vertInput_PS_u_time
Initial value:
= R"(
uniform float u_time; // Simulation time
uniform float u_difTime; // Simulation delta time after frustum culling
uniform float u_tTL; // Time to live of a particle)"

◆ vertInput_u_lightNm

const string vertInput_u_lightNm
Initial value:
= R"(
uniform vec4 u_lightPosVS[NUM_LIGHTS]; // position of light in view space
uniform vec3 u_lightSpotDir[NUM_LIGHTS]; // spot direction in view space
uniform float u_lightSpotDeg[NUM_LIGHTS]; // spot cutoff angle 1-180 degrees)"

◆ vertInput_u_matrices_all

const string vertInput_u_matrices_all
Initial value:
= R"(
uniform mat4 u_mMatrix; // Model matrix (object to world transform)
uniform mat4 u_vMatrix; // View matrix (world to camera transform)
uniform mat4 u_pMatrix; // Projection matrix (camera to normalize device coords.))"

◆ vertInput_u_matrix_vOmv

const string vertInput_u_matrix_vOmv
Initial value:
= R"(
uniform mat4 u_vOmvMatrix; // view or modelview matrix)"

◆ vertMain_Begin

const string vertMain_Begin
Initial value:
= R"(
void main()
{)"

◆ vertMain_EndAll

const string vertMain_EndAll
Initial value:
= R"(
// pass the vertex w. the fix-function transform
gl_Position = u_pMatrix * mvMatrix * a_position;
}
)"

◆ vertMain_PS_EndAll

const string vertMain_PS_EndAll
Initial value:
= R"(
// Modelview matrix multiplication with (particle position + particle generator position)
// Calculate position in view space
gl_Position = u_vOmvMatrix * vec4(a_position, 1);
}
)"

◆ vertMain_PS_EndAll_VertBillboard

const string vertMain_PS_EndAll_VertBillboard
Initial value:
= R"(
gl_Position = vec4(a_position, 1);
}
)"

◆ vertMain_PS_U_alive_a_const

const string vertMain_PS_U_alive_a_const
Initial value:
= R"(
tf_velocity += tf_initialVelocity * u_deltaTime * u_accConst; // Amplify the velocity)"

◆ vertMain_PS_U_alive_a_diffDir

const string vertMain_PS_U_alive_a_diffDir
Initial value:
= R"(
tf_velocity += u_deltaTime * u_acceleration; // Amplify the velocity)"

◆ vertMain_PS_U_alive_g

const string vertMain_PS_U_alive_g
Initial value:
= R"(
tf_velocity += u_deltaTime * u_gravity; // Apply gravity)"

◆ vertMain_PS_U_alive_p

const string vertMain_PS_U_alive_p
Initial value:
= R"(
} else
{
// The particle is alive, update.
tf_position += tf_velocity * u_deltaTime; // Scale the translation by the delta time)"

◆ vertMain_PS_U_alive_texNum

const string vertMain_PS_U_alive_texNum
Initial value:
= R"(
if(u_condFB == 1)
{
tf_texNum++; // Increment to draw next texture (flipbook)
tf_texNum = uint(mod(float(tf_texNum), float(u_col * u_row))); // Modulo to not exceed the max and reset
})"

◆ vertMain_PS_U_Begin

const string vertMain_PS_U_Begin
Initial value:
= R"(
void main()
{
vec4 P = vec4(a_position.xyz, 1.0); // Need to be here for the compilation
gl_Position = P; // Need to be here for the compilation)"

◆ vertMain_PS_U_bornDead

const string vertMain_PS_U_bornDead
Initial value:
= R"(
tf_startTime += u_difTime; // Add time to resume after frustum culling
if( u_time >= tf_startTime )
{ // Check if the particle is born
float age = u_time - tf_startTime; // Get the age of the particle
if( age > u_tTL)
{ )"

◆ vertMain_PS_U_EndAll

const string vertMain_PS_U_EndAll
Initial value:
= R"(
}
}
})"

◆ vertMain_PS_U_reset_p

const string vertMain_PS_U_reset_p
Initial value:
= R"(
// The particle is past its lifetime, recycle.
tf_position = u_pGPosition; // Reset position)"

◆ vertMain_PS_U_reset_shape_p

const string vertMain_PS_U_reset_shape_p
Initial value:
= R"(
// The particle is past its lifetime, recycle.
tf_position = a_initialPosition + u_pGPosition; // Reset position)"

◆ vertMain_PS_U_reset_st

const string vertMain_PS_U_reset_st
Initial value:
= R"(
tf_startTime = u_time; // Reset start time to actual time)"

◆ vertMain_PS_U_reset_st_counterGap

const string vertMain_PS_U_reset_st_counterGap
Initial value:
= R"(
tf_startTime = u_time + (age - u_tTL); // Reset start time to actual time with counter gap)"

◆ vertMain_PS_U_reset_v

const string vertMain_PS_U_reset_v
Initial value:
= R"(
tf_velocity = a_initialVelocity; // Reset velocity)"

◆ vertMain_PS_U_v_init_initP

const string vertMain_PS_U_v_init_initP
Initial value:
= R"(
tf_initialPosition = a_initialPosition; // Init the output variable)"

◆ vertMain_PS_U_v_init_initV

const string vertMain_PS_U_v_init_initV
Initial value:
= R"(
tf_initialVelocity = a_initialVelocity; // Init the output variable)"

◆ vertMain_PS_U_v_init_p

const string vertMain_PS_U_v_init_p
Initial value:
= R"(
tf_position = a_position; // Init the output variable)"

◆ vertMain_PS_U_v_init_r

const string vertMain_PS_U_v_init_r
Initial value:
= R"(
tf_rotation = a_rotation; // Init the output variable)"

◆ vertMain_PS_U_v_init_r_angularVelo

const string vertMain_PS_U_v_init_r_angularVelo
Initial value:
= R"(
tf_angularVelo = a_angularVelo; // Init the output variable)"

◆ vertMain_PS_U_v_init_st

const string vertMain_PS_U_v_init_st
Initial value:
= R"(
tf_startTime = a_startTime; // Init the output variable)"

◆ vertMain_PS_U_v_init_texNum

const string vertMain_PS_U_v_init_texNum
Initial value:
= R"(
tf_texNum = a_texNum; // Init the output variable)"

◆ vertMain_PS_U_v_init_v

const string vertMain_PS_U_v_init_v
Initial value:
= R"(
tf_velocity = a_velocity; // Init the output variable)"

◆ vertMain_PS_U_v_rConst

const string vertMain_PS_U_v_rConst
Initial value:
= R"(
tf_rotation = mod(tf_rotation + (u_angularVelo*u_deltaTime), TWOPI);)"

◆ vertMain_PS_U_v_rRange

const string vertMain_PS_U_v_rRange
Initial value:
= R"(
tf_rotation = mod(tf_rotation + (tf_angularVelo*u_deltaTime), TWOPI);)"

◆ vertMain_PS_v_a

const string vertMain_PS_v_a
Initial value:
= R"(
float age = u_time - a_startTime; // Get the age of the particle)"

◆ vertMain_PS_v_doColorOverLT

const string vertMain_PS_v_doColorOverLT
Initial value:
= R"(
vert.color = colorByAge(age/u_tTL);)"

◆ vertMain_PS_v_r

const string vertMain_PS_v_r
Initial value:
= R"(
vert.rotation = a_rotation;)"

◆ vertMain_PS_v_s

const string vertMain_PS_v_s
Initial value:
= R"(
vert.size = age / u_tTL;)"

◆ vertMain_PS_v_s_curve

const string vertMain_PS_v_s_curve
Initial value:
= R"(
vert.size = pow(vert.size,3.0) * u_si_bernstein.x +
pow(vert.size,2.0) * u_si_bernstein.y +
vert.size * u_si_bernstein.z +
u_si_bernstein.w; // Get transparency by bezier curve)"

◆ vertMain_PS_v_t_begin

const string vertMain_PS_v_t_begin
Initial value:
= R"(
if(age < 0.0)
vert.transparency = 0.0; // To be discard, because the particle is to be born
else
{
vert.transparency = age / u_tTL; // Get by the ratio age:lifetime)"

◆ vertMain_PS_v_t_curve

const string vertMain_PS_v_t_curve
Initial value:
= R"(
vert.transparency = pow(vert.transparency,3.0) * u_al_bernstein.x +
pow(vert.transparency,2.0) * u_al_bernstein.y +
vert.transparency * u_al_bernstein.z +
u_al_bernstein.w; // Get transparency by bezier curve)"

◆ vertMain_PS_v_t_default

const string vertMain_PS_v_t_default
Initial value:
= R"(
if(age < 0.0)
vert.transparency = 0.0; // To be discard, because the particle is to be born
else
vert.transparency = 1.0;)"

◆ vertMain_PS_v_t_end

const string vertMain_PS_v_t_end
Initial value:
= R"(
})"

◆ vertMain_PS_v_t_linear

const string vertMain_PS_v_t_linear
Initial value:
= R"(
vert.transparency = 1.0 - vert.transparency; // Linear)"

◆ vertMain_PS_v_texNum

const string vertMain_PS_v_texNum
Initial value:
= R"(
vert.texNum = a_texNum;)"

◆ vertMain_TBN_Nm

const string vertMain_TBN_Nm
Initial value:
= R"(
// Building the matrix Eye Space -> Tangent Space
// See the math behind at: http://www.terathon.com/code/tangent.html
vec3 n = normalize(nMatrix * a_normal);
vec3 t = normalize(nMatrix * a_tangent.xyz);
vec3 b = cross(n, t) * a_tangent.w; // bitangent w. corrected handedness
mat3 TBN = mat3(t,b,n);
// Transform vector to the eye into tangent space
v_eyeDirTS = -v_P_VS; // eye vector in view space
v_eyeDirTS *= TBN;
for (int i = 0; i < NUM_LIGHTS; ++i)
{
// Transform spot direction into tangent space
v_spotDirTS[i] = u_lightSpotDir[i];
v_spotDirTS[i] *= TBN;
// Transform vector to the light 0 into tangent space
vec3 L = u_lightPosVS[i].xyz - v_P_VS;
v_lightDirTS[i] = L;
v_lightDirTS[i] *= TBN;
}
)"

◆ vertMain_v_N_VS

const string vertMain_v_N_VS
Initial value:
= R"(
mat3 invMvMatrix = mat3(inverse(mvMatrix));
mat3 nMatrix = transpose(invMvMatrix);
v_N_VS = vec3(nMatrix * a_normal); // vertex normal in view space)"

◆ vertMain_v_P_VS

const string vertMain_v_P_VS
Initial value:
= R"(
mat4 mvMatrix = u_vMatrix * u_mMatrix;
v_P_VS = vec3(mvMatrix * a_position); // vertex position in view space)"

◆ vertMain_v_P_WS_Sm

const string vertMain_v_P_WS_Sm
Initial value:
= R"(
v_P_WS = vec3(u_mMatrix * a_position); // vertex position in world space)"

◆ vertMain_v_R_OS

const string vertMain_v_R_OS
Initial value:
= R"(
vec3 I = normalize(v_P_VS);
vec3 N = normalize(v_N_VS);
v_R_OS = invMvMatrix * reflect(I, N); // R = I-2.0*dot(N,I)*N;)"

◆ vertMain_v_uv0

const string vertMain_v_uv0
Initial value:
= R"(
v_uv0 = a_uv0; // pass diffuse color tex.coord. 1 for interpolation)"

◆ vertMain_v_uv1

const string vertMain_v_uv1
Initial value:
= R"(
v_uv1 = a_uv1; // pass diffuse color tex.coord. 1 for interpolation)"

◆ vertOutput_PS_struct_Begin

const string vertOutput_PS_struct_Begin
Initial value:
= R"(
out vertex
{ )"

◆ vertOutput_PS_struct_c

const string vertOutput_PS_struct_c
Initial value:
= R"(
vec3 color; // Color of a particle )"

◆ vertOutput_PS_struct_End

const string vertOutput_PS_struct_End
Initial value:
= R"(
} vert; )"

◆ vertOutput_PS_struct_r

const string vertOutput_PS_struct_r
Initial value:
= R"(
float rotation; // Rotation of a particle)"

◆ vertOutput_PS_struct_s

const string vertOutput_PS_struct_s
Initial value:
= R"(
float size; // Size of a particle )"

◆ vertOutput_PS_struct_t

const string vertOutput_PS_struct_t
Initial value:
= R"(
float transparency; // Transparency of a particle)"

◆ vertOutput_PS_struct_texNum

const string vertOutput_PS_struct_texNum
Initial value:
= R"(
uint texNum; // Num of texture in flipbook)"

◆ vertOutput_PS_tf_initP

const string vertOutput_PS_tf_initP
Initial value:
= R"(
out vec3 tf_initialPosition; // To transform feedback)"

◆ vertOutput_PS_tf_initV

const string vertOutput_PS_tf_initV
Initial value:
= R"(
out vec3 tf_initialVelocity; // To transform feedback)"

◆ vertOutput_PS_tf_p

const string vertOutput_PS_tf_p
Initial value:
= R"(
out vec3 tf_position; // To transform feedback)"

◆ vertOutput_PS_tf_r

const string vertOutput_PS_tf_r
Initial value:
= R"(
out float tf_rotation; // To transform feedback)"

◆ vertOutput_PS_tf_r_angularVelo

const string vertOutput_PS_tf_r_angularVelo
Initial value:
= R"(
out float tf_angularVelo; // To transform feedback)"

◆ vertOutput_PS_tf_st

const string vertOutput_PS_tf_st
Initial value:
= R"(
out float tf_startTime; // To transform feedback)"

◆ vertOutput_PS_tf_texNum

const string vertOutput_PS_tf_texNum
Initial value:
= R"(
out uint tf_texNum; // To transform feedback)"

◆ vertOutput_PS_tf_v

const string vertOutput_PS_tf_v
Initial value:
= R"(
out vec3 tf_velocity; // To transform feedback)"

◆ vertOutput_v_lightVecTS

const string vertOutput_v_lightVecTS
Initial value:
= R"(
out vec3 v_eyeDirTS; // Vector to the eye in tangent space
out vec3 v_lightDirTS[NUM_LIGHTS]; // Vector to the light 0 in tangent space
out vec3 v_spotDirTS[NUM_LIGHTS]; // Spot direction in tangent space)"

◆ vertOutput_v_N_VS

const string vertOutput_v_N_VS
Initial value:
= R"(
out vec3 v_N_VS; // Normal at P_VS in view space (VS))"

◆ vertOutput_v_P_VS

const string vertOutput_v_P_VS
Initial value:
= R"(
out vec3 v_P_VS; // Point of illumination in view space (VS))"

◆ vertOutput_v_P_WS

const string vertOutput_v_P_WS
Initial value:
= R"(
out vec3 v_P_WS; // Point of illumination in world space (WS))"

◆ vertOutput_v_R_OS

const string vertOutput_v_R_OS
Initial value:
= R"(
out vec3 v_R_OS; // Reflection vector in object space (WS))"

◆ vertOutput_v_uv0

const string vertOutput_v_uv0
Initial value:
= R"(
out vec2 v_uv0; // Texture coordinate 1 output)"

◆ vertOutput_v_uv1

const string vertOutput_v_uv1
Initial value:
= R"(
out vec2 v_uv1; // Texture coordinate 1 output)"