mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-28 18:45:54 -05:00
commit
702d2ca9cb
243 changed files with 161 additions and 161 deletions
|
@ -17,12 +17,12 @@ uniform vec4 u_specular_shininess;
|
|||
uniform vec4 u_lightPosRadius[MAX_NUM_LIGHTS];
|
||||
uniform vec4 u_lightRgbInnerR[MAX_NUM_LIGHTS];
|
||||
|
||||
#define u_ambientPass u_params.x
|
||||
#define u_lightningPass u_params.y
|
||||
#define u_lightCount u_params.z
|
||||
#define u_lightIndex u_params.w
|
||||
#define u_specular u_specular_shininess.xyz
|
||||
#define u_shininess u_specular_shininess.w
|
||||
#define u_ambientPass u_params.x
|
||||
#define u_lightingPass u_params.y
|
||||
#define u_lightCount u_params.z
|
||||
#define u_lightIndex u_params.w
|
||||
#define u_specular u_specular_shininess.xyz
|
||||
#define u_shininess u_specular_shininess.w
|
||||
|
||||
vec2 blinn(vec3 _lightDir, vec3 _normal, vec3 _viewDir)
|
||||
{
|
||||
|
@ -76,7 +76,7 @@ void main()
|
|||
}
|
||||
lightColor += calcLight(ii, v_view, normal, viewDir) * condition;
|
||||
}
|
||||
lightColor *= u_lightningPass;
|
||||
lightColor *= u_lightingPass;
|
||||
|
||||
vec3 color = u_color.xyz;
|
||||
|
|
@ -273,7 +273,7 @@ struct Uniforms
|
|||
void init()
|
||||
{
|
||||
m_params.m_ambientPass = 1.0f;
|
||||
m_params.m_lightningPass = 1.0f;
|
||||
m_params.m_lightingPass = 1.0f;
|
||||
m_params.m_lightCount = 4.0f;
|
||||
m_params.m_lightIndex = 4.0f;
|
||||
|
||||
|
@ -352,7 +352,7 @@ struct Uniforms
|
|||
struct Params
|
||||
{
|
||||
float m_ambientPass;
|
||||
float m_lightningPass;
|
||||
float m_lightingPass;
|
||||
float m_lightCount;
|
||||
float m_lightIndex;
|
||||
};
|
||||
|
@ -378,7 +378,7 @@ struct Uniforms
|
|||
|
||||
/**
|
||||
* u_params.x - u_ambientPass
|
||||
* u_params.y - u_lightningPass
|
||||
* u_params.y - u_lightingPass
|
||||
* u_params.z - u_lightCount
|
||||
* u_params.w - u_lightIndex
|
||||
*/
|
||||
|
@ -863,11 +863,11 @@ int _main_(int _argc, char** _argv)
|
|||
|
||||
s_texColor = bgfx::createUniform("s_texColor", bgfx::UniformType::Int1);
|
||||
|
||||
bgfx::ProgramHandle programTextureLightning = loadProgram("vs_stencil_texture_lightning", "fs_stencil_texture_lightning");
|
||||
bgfx::ProgramHandle programColorLightning = loadProgram("vs_stencil_color_lightning", "fs_stencil_color_lightning" );
|
||||
bgfx::ProgramHandle programColorTexture = loadProgram("vs_stencil_color_texture", "fs_stencil_color_texture" );
|
||||
bgfx::ProgramHandle programColorBlack = loadProgram("vs_stencil_color", "fs_stencil_color_black" );
|
||||
bgfx::ProgramHandle programTexture = loadProgram("vs_stencil_texture", "fs_stencil_texture" );
|
||||
bgfx::ProgramHandle programTextureLighting = loadProgram("vs_stencil_texture_lighting", "fs_stencil_texture_lighting");
|
||||
bgfx::ProgramHandle programColorLighting = loadProgram("vs_stencil_color_lighting", "fs_stencil_color_lighting" );
|
||||
bgfx::ProgramHandle programColorTexture = loadProgram("vs_stencil_color_texture", "fs_stencil_color_texture" );
|
||||
bgfx::ProgramHandle programColorBlack = loadProgram("vs_stencil_color", "fs_stencil_color_black" );
|
||||
bgfx::ProgramHandle programTexture = loadProgram("vs_stencil_texture", "fs_stencil_texture" );
|
||||
|
||||
Mesh bunnyMesh;
|
||||
Mesh columnMesh;
|
||||
|
@ -986,7 +986,7 @@ int _main_(int _argc, char** _argv)
|
|||
// Update settings.
|
||||
uint8_t numLights = (uint8_t)settings_numLights;
|
||||
s_uniforms.m_params.m_ambientPass = 1.0f;
|
||||
s_uniforms.m_params.m_lightningPass = 1.0f;
|
||||
s_uniforms.m_params.m_lightingPass = 1.0f;
|
||||
s_uniforms.m_params.m_lightCount = settings_numLights;
|
||||
s_uniforms.m_params.m_lightIndex = 0.0f;
|
||||
s_uniforms.m_color[3] = settings_reflectionValue;
|
||||
|
@ -1124,7 +1124,7 @@ int _main_(int _argc, char** _argv)
|
|||
|
||||
// Setup params for this scene.
|
||||
s_uniforms.m_params.m_ambientPass = 1.0f;
|
||||
s_uniforms.m_params.m_lightningPass = 1.0f;
|
||||
s_uniforms.m_params.m_lightingPass = 1.0f;
|
||||
|
||||
// Floor.
|
||||
hplaneMesh.submit(RENDER_VIEWID_RANGE1_PASS_0
|
||||
|
@ -1158,7 +1158,7 @@ int _main_(int _argc, char** _argv)
|
|||
bx::mtxMul(mtxReflectedBunny, bunnyMtx, reflectMtx);
|
||||
bunnyMesh.submit(RENDER_VIEWID_RANGE1_PASS_1
|
||||
, mtxReflectedBunny
|
||||
, programColorLightning
|
||||
, programColorLighting
|
||||
, s_renderStates[RenderState::StencilReflection_DrawReflected]
|
||||
);
|
||||
|
||||
|
@ -1169,7 +1169,7 @@ int _main_(int _argc, char** _argv)
|
|||
bx::mtxMul(mtxReflectedColumn, columnMtx[ii], reflectMtx);
|
||||
columnMesh.submit(RENDER_VIEWID_RANGE1_PASS_1
|
||||
, mtxReflectedColumn
|
||||
, programColorLightning
|
||||
, programColorLighting
|
||||
, s_renderStates[RenderState::StencilReflection_DrawReflected]
|
||||
);
|
||||
}
|
||||
|
@ -1181,7 +1181,7 @@ int _main_(int _argc, char** _argv)
|
|||
// Floor.
|
||||
hplaneMesh.submit(RENDER_VIEWID_RANGE1_PASS_2
|
||||
, floorMtx
|
||||
, programTextureLightning
|
||||
, programTextureLighting
|
||||
, s_renderStates[RenderState::StencilReflection_BlendPlane]
|
||||
, fieldstoneTex
|
||||
);
|
||||
|
@ -1191,7 +1191,7 @@ int _main_(int _argc, char** _argv)
|
|||
// Bunny.
|
||||
bunnyMesh.submit(RENDER_VIEWID_RANGE1_PASS_3
|
||||
, bunnyMtx
|
||||
, programColorLightning
|
||||
, programColorLighting
|
||||
, s_renderStates[RenderState::StencilReflection_DrawScene]
|
||||
);
|
||||
|
||||
|
@ -1200,7 +1200,7 @@ int _main_(int _argc, char** _argv)
|
|||
{
|
||||
columnMesh.submit(RENDER_VIEWID_RANGE1_PASS_3
|
||||
, columnMtx[ii]
|
||||
, programColorLightning
|
||||
, programColorLighting
|
||||
, s_renderStates[RenderState::StencilReflection_DrawScene]
|
||||
);
|
||||
}
|
||||
|
@ -1212,19 +1212,19 @@ int _main_(int _argc, char** _argv)
|
|||
{
|
||||
// First pass - Draw entire scene. (ambient only).
|
||||
s_uniforms.m_params.m_ambientPass = 1.0f;
|
||||
s_uniforms.m_params.m_lightningPass = 0.0f;
|
||||
s_uniforms.m_params.m_lightingPass = 0.0f;
|
||||
|
||||
// Bunny.
|
||||
bunnyMesh.submit(RENDER_VIEWID_RANGE1_PASS_0
|
||||
, bunnyMtx
|
||||
, programColorLightning
|
||||
, programColorLighting
|
||||
, s_renderStates[RenderState::ProjectionShadows_DrawAmbient]
|
||||
);
|
||||
|
||||
// Floor.
|
||||
hplaneMesh.submit(RENDER_VIEWID_RANGE1_PASS_0
|
||||
, floorMtx
|
||||
, programTextureLightning
|
||||
, programTextureLighting
|
||||
, s_renderStates[RenderState::ProjectionShadows_DrawAmbient]
|
||||
, fieldstoneTex
|
||||
);
|
||||
|
@ -1234,7 +1234,7 @@ int _main_(int _argc, char** _argv)
|
|||
{
|
||||
cubeMesh.submit(RENDER_VIEWID_RANGE1_PASS_0
|
||||
, cubeMtx[ii]
|
||||
, programTextureLightning
|
||||
, programTextureLighting
|
||||
, s_renderStates[RenderState::ProjectionShadows_DrawAmbient]
|
||||
, figureTex
|
||||
);
|
||||
|
@ -1285,23 +1285,23 @@ int _main_(int _argc, char** _argv)
|
|||
);
|
||||
}
|
||||
|
||||
// Draw entire scene. (lightning pass only. blending is on)
|
||||
// Draw entire scene. (lighting pass only. blending is on)
|
||||
s_uniforms.m_params.m_ambientPass = 0.0f;
|
||||
s_uniforms.m_params.m_lightningPass = 1.0f;
|
||||
s_uniforms.m_params.m_lightingPass = 1.0f;
|
||||
s_uniforms.m_params.m_lightCount = 1.0f;
|
||||
s_uniforms.m_params.m_lightIndex = float(ii);
|
||||
|
||||
// Bunny.
|
||||
bunnyMesh.submit(viewId
|
||||
, bunnyMtx
|
||||
, programColorLightning
|
||||
, programColorLighting
|
||||
, s_renderStates[RenderState::ProjectionShadows_DrawDiffuse]
|
||||
);
|
||||
|
||||
// Floor.
|
||||
hplaneMesh.submit(viewId
|
||||
, floorMtx
|
||||
, programTextureLightning
|
||||
, programTextureLighting
|
||||
, s_renderStates[RenderState::ProjectionShadows_DrawDiffuse]
|
||||
, fieldstoneTex
|
||||
);
|
||||
|
@ -1311,7 +1311,7 @@ int _main_(int _argc, char** _argv)
|
|||
{
|
||||
cubeMesh.submit(viewId
|
||||
, cubeMtx[jj]
|
||||
, programTextureLightning
|
||||
, programTextureLighting
|
||||
, s_renderStates[RenderState::ProjectionShadows_DrawDiffuse]
|
||||
, figureTex
|
||||
);
|
||||
|
@ -1320,7 +1320,7 @@ int _main_(int _argc, char** _argv)
|
|||
|
||||
// Reset these to default..
|
||||
s_uniforms.m_params.m_ambientPass = 1.0f;
|
||||
s_uniforms.m_params.m_lightningPass = 1.0f;
|
||||
s_uniforms.m_params.m_lightingPass = 1.0f;
|
||||
}
|
||||
break;
|
||||
};
|
||||
|
@ -1389,8 +1389,8 @@ int _main_(int _argc, char** _argv)
|
|||
bgfx::destroyTexture(fieldstoneTex);
|
||||
bgfx::destroyTexture(flareTex);
|
||||
|
||||
bgfx::destroyProgram(programTextureLightning);
|
||||
bgfx::destroyProgram(programColorLightning);
|
||||
bgfx::destroyProgram(programTextureLighting);
|
||||
bgfx::destroyProgram(programColorLighting);
|
||||
bgfx::destroyProgram(programColorTexture);
|
||||
bgfx::destroyProgram(programColorBlack);
|
||||
bgfx::destroyProgram(programTexture);
|
||||
|
|
|
@ -18,7 +18,7 @@ uniform vec4 u_lightRgbInnerR;
|
|||
SAMPLER2D(s_texStencil, 1);
|
||||
|
||||
#define u_ambientPass u_params.x
|
||||
#define u_lightningPass u_params.y
|
||||
#define u_lightingPass u_params.y
|
||||
#define u_texelHalf u_params.z
|
||||
#define u_specular u_specular_shininess.xyz
|
||||
#define u_shininess u_specular_shininess.w
|
||||
|
@ -65,7 +65,7 @@ void main()
|
|||
|
||||
vec3 normal = normalize(v_normal);
|
||||
vec3 viewDir = -normalize(v_view);
|
||||
vec3 lightColor = calcLight(v_view, normal, viewDir) * u_lightningPass;
|
||||
vec3 lightColor = calcLight(v_view, normal, viewDir) * u_lightingPass;
|
||||
|
||||
vec2 ndc = gl_FragCoord.xy * u_viewTexel.xy + u_viewTexel.xy * u_texelHalf;
|
||||
vec4 texcolor = texture2D(s_texStencil, ndc);
|
|
@ -18,7 +18,7 @@ SAMPLER2D(s_texColor, 0);
|
|||
SAMPLER2D(s_texStencil, 1);
|
||||
|
||||
#define u_ambientPass u_params.x
|
||||
#define u_lightningPass u_params.y
|
||||
#define u_lightingPass u_params.y
|
||||
#define u_texelHalf u_params.z
|
||||
#define u_specular u_specular_shininess.xyz
|
||||
#define u_shininess u_specular_shininess.w
|
||||
|
@ -65,7 +65,7 @@ void main()
|
|||
|
||||
vec3 normal = normalize(v_normal);
|
||||
vec3 viewDir = -normalize(v_view);
|
||||
vec3 lightColor = calcLight(v_view, normal, viewDir) * u_lightningPass;
|
||||
vec3 lightColor = calcLight(v_view, normal, viewDir) * u_lightingPass;
|
||||
|
||||
vec2 ndc = gl_FragCoord.xy * u_viewTexel.xy + u_viewTexel.xy * u_texelHalf;
|
||||
vec4 texcolor = texture2D(s_texStencil, ndc);
|
|
@ -205,7 +205,7 @@ struct Uniforms
|
|||
void init()
|
||||
{
|
||||
m_params.m_ambientPass = 1.0f;
|
||||
m_params.m_lightningPass = 1.0f;
|
||||
m_params.m_lightingPass = 1.0f;
|
||||
m_params.m_texelHalf = 0.0f;
|
||||
|
||||
m_ambient[0] = 0.05f;
|
||||
|
@ -299,7 +299,7 @@ struct Uniforms
|
|||
struct Params
|
||||
{
|
||||
float m_ambientPass;
|
||||
float m_lightningPass;
|
||||
float m_lightingPass;
|
||||
float m_texelHalf;
|
||||
float m_unused00;
|
||||
};
|
||||
|
@ -326,7 +326,7 @@ struct Uniforms
|
|||
|
||||
/**
|
||||
* u_params.x - u_ambientPass
|
||||
* u_params.y - u_lightningPass
|
||||
* u_params.y - u_lightingPass
|
||||
* u_params.z - u_texelHalf
|
||||
* u_params.w - unused
|
||||
|
||||
|
@ -1905,10 +1905,10 @@ int _main_(int _argc, char** _argv)
|
|||
s_texColor = bgfx::createUniform("s_texColor", bgfx::UniformType::Int1);
|
||||
s_texStencil = bgfx::createUniform("s_texStencil", bgfx::UniformType::Int1);
|
||||
|
||||
bgfx::ProgramHandle programTextureLightning = loadProgram("vs_shadowvolume_texture_lightning", "fs_shadowvolume_texture_lightning");
|
||||
bgfx::ProgramHandle programColorLightning = loadProgram("vs_shadowvolume_color_lightning", "fs_shadowvolume_color_lightning" );
|
||||
bgfx::ProgramHandle programColorTexture = loadProgram("vs_shadowvolume_color_texture", "fs_shadowvolume_color_texture" );
|
||||
bgfx::ProgramHandle programTexture = loadProgram("vs_shadowvolume_texture", "fs_shadowvolume_texture" );
|
||||
bgfx::ProgramHandle programTextureLighting = loadProgram("vs_shadowvolume_texture_lighting", "fs_shadowvolume_texture_lighting");
|
||||
bgfx::ProgramHandle programColorLighting = loadProgram("vs_shadowvolume_color_lighting", "fs_shadowvolume_color_lighting" );
|
||||
bgfx::ProgramHandle programColorTexture = loadProgram("vs_shadowvolume_color_texture", "fs_shadowvolume_color_texture" );
|
||||
bgfx::ProgramHandle programTexture = loadProgram("vs_shadowvolume_texture", "fs_shadowvolume_texture" );
|
||||
|
||||
bgfx::ProgramHandle programBackBlank = loadProgram("vs_shadowvolume_svback", "fs_shadowvolume_svbackblank" );
|
||||
bgfx::ProgramHandle programSideBlank = loadProgram("vs_shadowvolume_svside", "fs_shadowvolume_svsideblank" );
|
||||
|
@ -1967,28 +1967,28 @@ int _main_(int _argc, char** _argv)
|
|||
Model vplaneModel;
|
||||
|
||||
bunnyHighPolyModel.load("meshes/bunny_patched.bin");
|
||||
bunnyHighPolyModel.m_program = programColorLightning;
|
||||
bunnyHighPolyModel.m_program = programColorLighting;
|
||||
|
||||
bunnyLowPolyModel.load("meshes/bunny_decimated.bin");
|
||||
bunnyLowPolyModel.m_program = programColorLightning;
|
||||
bunnyLowPolyModel.m_program = programColorLighting;
|
||||
|
||||
columnModel.load("meshes/column.bin");
|
||||
columnModel.m_program = programColorLightning;
|
||||
columnModel.m_program = programColorLighting;
|
||||
|
||||
platformModel.load("meshes/platform.bin");
|
||||
platformModel.m_program = programTextureLightning;
|
||||
platformModel.m_program = programTextureLighting;
|
||||
platformModel.m_texture = figureTex;
|
||||
|
||||
cubeModel.load("meshes/cube.bin");
|
||||
cubeModel.m_program = programTextureLightning;
|
||||
cubeModel.m_program = programTextureLighting;
|
||||
cubeModel.m_texture = figureTex;
|
||||
|
||||
hplaneFieldModel.load(s_hplaneVertices, BX_COUNTOF(s_hplaneVertices), PosNormalTexcoordVertex::ms_decl, s_planeIndices, BX_COUNTOF(s_planeIndices) );
|
||||
hplaneFieldModel.m_program = programTextureLightning;
|
||||
hplaneFieldModel.m_program = programTextureLighting;
|
||||
hplaneFieldModel.m_texture = fieldstoneTex;
|
||||
|
||||
hplaneFigureModel.load(s_hplaneVertices, BX_COUNTOF(s_hplaneVertices), PosNormalTexcoordVertex::ms_decl, s_planeIndices, BX_COUNTOF(s_planeIndices) );
|
||||
hplaneFigureModel.m_program = programTextureLightning;
|
||||
hplaneFigureModel.m_program = programTextureLighting;
|
||||
hplaneFigureModel.m_texture = figureTex;
|
||||
|
||||
vplaneModel.load(s_vplaneVertices, BX_COUNTOF(s_vplaneVertices), PosNormalTexcoordVertex::ms_decl, s_planeIndices, BX_COUNTOF(s_planeIndices) );
|
||||
|
@ -2249,7 +2249,7 @@ int _main_(int _argc, char** _argv)
|
|||
|
||||
//update settings
|
||||
s_uniforms.m_params.m_ambientPass = 1.0f;
|
||||
s_uniforms.m_params.m_lightningPass = 1.0f;
|
||||
s_uniforms.m_params.m_lightingPass = 1.0f;
|
||||
s_uniforms.m_params.m_texelHalf = s_texelHalf;
|
||||
s_uniforms.m_svparams.m_useStencilTex = float(settings_useStencilTexture);
|
||||
|
||||
|
@ -2539,7 +2539,7 @@ int _main_(int _argc, char** _argv)
|
|||
|
||||
// Draw ambient only.
|
||||
s_uniforms.m_params.m_ambientPass = 1.0f;
|
||||
s_uniforms.m_params.m_lightningPass = 0.0f;
|
||||
s_uniforms.m_params.m_lightingPass = 0.0f;
|
||||
|
||||
s_uniforms.m_color[0] = 1.0f;
|
||||
s_uniforms.m_color[1] = 1.0f;
|
||||
|
@ -2773,7 +2773,7 @@ int _main_(int _argc, char** _argv)
|
|||
|
||||
// Draw diffuse only.
|
||||
s_uniforms.m_params.m_ambientPass = 0.0f;
|
||||
s_uniforms.m_params.m_lightningPass = 1.0f;
|
||||
s_uniforms.m_params.m_lightingPass = 1.0f;
|
||||
|
||||
RenderState& drawDiffuse = settings_useStencilTexture
|
||||
? s_renderStates[RenderState::ShadowVolume_UsingStencilTexture_DrawDiffuse]
|
||||
|
@ -2851,8 +2851,8 @@ int _main_(int _argc, char** _argv)
|
|||
bgfx::destroyTexture(fieldstoneTex);
|
||||
bgfx::destroyTexture(flareTex);
|
||||
|
||||
bgfx::destroyProgram(programTextureLightning);
|
||||
bgfx::destroyProgram(programColorLightning);
|
||||
bgfx::destroyProgram(programTextureLighting);
|
||||
bgfx::destroyProgram(programColorLighting);
|
||||
bgfx::destroyProgram(programColorTexture);
|
||||
bgfx::destroyProgram(programTexture);
|
||||
|
||||
|
|
|
@ -7,9 +7,9 @@ $input v_normal, v_view, v_shadowcoord
|
|||
|
||||
#define SM_ESM 1
|
||||
|
||||
#include "fs_shadowmaps_color_lightning.sh"
|
||||
#include "fs_shadowmaps_color_lighting.sh"
|
||||
|
||||
void main()
|
||||
{
|
||||
#include "fs_shadowmaps_color_lightning_main.sh"
|
||||
#include "fs_shadowmaps_color_lighting_main.sh"
|
||||
}
|
|
@ -8,10 +8,10 @@ $input v_position, v_normal, v_view, v_texcoord1, v_texcoord2, v_texcoord3, v_te
|
|||
#define SM_ESM 1
|
||||
#define SM_CSM 1
|
||||
|
||||
#include "fs_shadowmaps_color_lightning.sh"
|
||||
#include "fs_shadowmaps_color_lighting.sh"
|
||||
|
||||
void main()
|
||||
{
|
||||
#include "fs_shadowmaps_color_lightning_main.sh"
|
||||
#include "fs_shadowmaps_color_lighting_main.sh"
|
||||
}
|
||||
|
|
@ -8,9 +8,9 @@ $input v_normal, v_view, v_shadowcoord
|
|||
#define SM_ESM 1
|
||||
#define SM_LINEAR 1
|
||||
|
||||
#include "fs_shadowmaps_color_lightning.sh"
|
||||
#include "fs_shadowmaps_color_lighting.sh"
|
||||
|
||||
void main()
|
||||
{
|
||||
#include "fs_shadowmaps_color_lightning_main.sh"
|
||||
#include "fs_shadowmaps_color_lighting_main.sh"
|
||||
}
|
|
@ -9,10 +9,10 @@ $input v_position, v_normal, v_view, v_texcoord1, v_texcoord2, v_texcoord3, v_te
|
|||
#define SM_LINEAR 1
|
||||
#define SM_CSM 1
|
||||
|
||||
#include "fs_shadowmaps_color_lightning.sh"
|
||||
#include "fs_shadowmaps_color_lighting.sh"
|
||||
|
||||
void main()
|
||||
{
|
||||
#include "fs_shadowmaps_color_lightning_main.sh"
|
||||
#include "fs_shadowmaps_color_lighting_main.sh"
|
||||
}
|
||||
|
|
@ -9,9 +9,9 @@ $input v_position, v_normal, v_view, v_texcoord1, v_texcoord2, v_texcoord3, v_te
|
|||
#define SM_LINEAR 1
|
||||
#define SM_OMNI 1
|
||||
|
||||
#include "fs_shadowmaps_color_lightning.sh"
|
||||
#include "fs_shadowmaps_color_lighting.sh"
|
||||
|
||||
void main()
|
||||
{
|
||||
#include "fs_shadowmaps_color_lightning_main.sh"
|
||||
#include "fs_shadowmaps_color_lighting_main.sh"
|
||||
}
|
|
@ -8,9 +8,9 @@ $input v_position, v_normal, v_view, v_texcoord1, v_texcoord2, v_texcoord3, v_te
|
|||
#define SM_ESM 1
|
||||
#define SM_OMNI 1
|
||||
|
||||
#include "fs_shadowmaps_color_lightning.sh"
|
||||
#include "fs_shadowmaps_color_lighting.sh"
|
||||
|
||||
void main()
|
||||
{
|
||||
#include "fs_shadowmaps_color_lightning_main.sh"
|
||||
#include "fs_shadowmaps_color_lighting_main.sh"
|
||||
}
|
|
@ -7,9 +7,9 @@ $input v_normal, v_view, v_shadowcoord
|
|||
|
||||
#define SM_HARD 1
|
||||
|
||||
#include "fs_shadowmaps_color_lightning.sh"
|
||||
#include "fs_shadowmaps_color_lighting.sh"
|
||||
|
||||
void main()
|
||||
{
|
||||
#include "fs_shadowmaps_color_lightning_main.sh"
|
||||
#include "fs_shadowmaps_color_lighting_main.sh"
|
||||
}
|
|
@ -8,9 +8,9 @@ $input v_position, v_normal, v_view, v_texcoord1, v_texcoord2, v_texcoord3, v_te
|
|||
#define SM_HARD 1
|
||||
#define SM_CSM 1
|
||||
|
||||
#include "fs_shadowmaps_color_lightning.sh"
|
||||
#include "fs_shadowmaps_color_lighting.sh"
|
||||
|
||||
void main()
|
||||
{
|
||||
#include "fs_shadowmaps_color_lightning_main.sh"
|
||||
#include "fs_shadowmaps_color_lighting_main.sh"
|
||||
}
|
|
@ -7,9 +7,9 @@ $input v_normal, v_view, v_shadowcoord
|
|||
#define SM_HARD 1
|
||||
#define SM_LINEAR 1
|
||||
|
||||
#include "fs_shadowmaps_color_lightning.sh"
|
||||
#include "fs_shadowmaps_color_lighting.sh"
|
||||
|
||||
void main()
|
||||
{
|
||||
#include "fs_shadowmaps_color_lightning_main.sh"
|
||||
#include "fs_shadowmaps_color_lighting_main.sh"
|
||||
}
|
|
@ -8,10 +8,10 @@ $input v_position, v_normal, v_view, v_texcoord1, v_texcoord2, v_texcoord3, v_te
|
|||
#define SM_LINEAR 1
|
||||
#define SM_CSM 1
|
||||
|
||||
#include "fs_shadowmaps_color_lightning.sh"
|
||||
#include "fs_shadowmaps_color_lighting.sh"
|
||||
|
||||
void main()
|
||||
{
|
||||
#include "fs_shadowmaps_color_lightning_main.sh"
|
||||
#include "fs_shadowmaps_color_lighting_main.sh"
|
||||
}
|
||||
|
|
@ -8,9 +8,9 @@ $input v_position, v_normal, v_view, v_texcoord1, v_texcoord2, v_texcoord3, v_te
|
|||
#define SM_LINEAR 1
|
||||
#define SM_OMNI 1
|
||||
|
||||
#include "fs_shadowmaps_color_lightning.sh"
|
||||
#include "fs_shadowmaps_color_lighting.sh"
|
||||
|
||||
void main()
|
||||
{
|
||||
#include "fs_shadowmaps_color_lightning_main.sh"
|
||||
#include "fs_shadowmaps_color_lighting_main.sh"
|
||||
}
|
|
@ -8,9 +8,9 @@ $input v_position, v_normal, v_view, v_texcoord1, v_texcoord2, v_texcoord3, v_te
|
|||
#define SM_HARD 1
|
||||
#define SM_OMNI 1
|
||||
|
||||
#include "fs_shadowmaps_color_lightning.sh"
|
||||
#include "fs_shadowmaps_color_lighting.sh"
|
||||
|
||||
void main()
|
||||
{
|
||||
#include "fs_shadowmaps_color_lightning_main.sh"
|
||||
#include "fs_shadowmaps_color_lighting_main.sh"
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
#define u_ambientPass u_params0.x
|
||||
#define u_lightningPass u_params0.y
|
||||
#define u_lightingPass u_params0.y
|
||||
|
||||
#define u_shadowMapBias u_params1.x
|
||||
#define u_shadowMapParam0 u_params1.z
|
|
@ -7,9 +7,9 @@ $input v_normal, v_view, v_shadowcoord
|
|||
|
||||
#define SM_PCF 1
|
||||
|
||||
#include "fs_shadowmaps_color_lightning.sh"
|
||||
#include "fs_shadowmaps_color_lighting.sh"
|
||||
|
||||
void main()
|
||||
{
|
||||
#include "fs_shadowmaps_color_lightning_main.sh"
|
||||
#include "fs_shadowmaps_color_lighting_main.sh"
|
||||
}
|
|
@ -8,10 +8,10 @@ $input v_position, v_normal, v_view, v_texcoord1, v_texcoord2, v_texcoord3, v_te
|
|||
#define SM_PCF 1
|
||||
#define SM_CSM 1
|
||||
|
||||
#include "fs_shadowmaps_color_lightning.sh"
|
||||
#include "fs_shadowmaps_color_lighting.sh"
|
||||
|
||||
void main()
|
||||
{
|
||||
#include "fs_shadowmaps_color_lightning_main.sh"
|
||||
#include "fs_shadowmaps_color_lighting_main.sh"
|
||||
}
|
||||
|
|
@ -8,9 +8,9 @@ $input v_normal, v_view, v_shadowcoord
|
|||
#define SM_PCF 1
|
||||
#define SM_LINEAR 1
|
||||
|
||||
#include "fs_shadowmaps_color_lightning.sh"
|
||||
#include "fs_shadowmaps_color_lighting.sh"
|
||||
|
||||
void main()
|
||||
{
|
||||
#include "fs_shadowmaps_color_lightning_main.sh"
|
||||
#include "fs_shadowmaps_color_lighting_main.sh"
|
||||
}
|
|
@ -8,10 +8,10 @@ $input v_position, v_normal, v_view, v_texcoord1, v_texcoord2, v_texcoord3, v_te
|
|||
#define SM_LINEAR 1
|
||||
#define SM_CSM 1
|
||||
|
||||
#include "fs_shadowmaps_color_lightning.sh"
|
||||
#include "fs_shadowmaps_color_lighting.sh"
|
||||
|
||||
void main()
|
||||
{
|
||||
#include "fs_shadowmaps_color_lightning_main.sh"
|
||||
#include "fs_shadowmaps_color_lighting_main.sh"
|
||||
}
|
||||
|
|
@ -8,10 +8,10 @@ $input v_position, v_normal, v_view, v_texcoord1, v_texcoord2, v_texcoord3, v_te
|
|||
#define SM_LINEAR 1
|
||||
#define SM_OMNI 1
|
||||
|
||||
#include "fs_shadowmaps_color_lightning.sh"
|
||||
#include "fs_shadowmaps_color_lighting.sh"
|
||||
|
||||
void main()
|
||||
{
|
||||
#include "fs_shadowmaps_color_lightning_main.sh"
|
||||
#include "fs_shadowmaps_color_lighting_main.sh"
|
||||
}
|
||||
|
|
@ -8,9 +8,9 @@ $input v_position, v_normal, v_view, v_texcoord1, v_texcoord2, v_texcoord3, v_te
|
|||
#define SM_PCF 1
|
||||
#define SM_OMNI 1
|
||||
|
||||
#include "fs_shadowmaps_color_lightning.sh"
|
||||
#include "fs_shadowmaps_color_lighting.sh"
|
||||
|
||||
void main()
|
||||
{
|
||||
#include "fs_shadowmaps_color_lightning_main.sh"
|
||||
#include "fs_shadowmaps_color_lighting_main.sh"
|
||||
}
|
|
@ -7,9 +7,9 @@ $input v_normal, v_view, v_shadowcoord
|
|||
|
||||
#define SM_VSM 1
|
||||
|
||||
#include "fs_shadowmaps_color_lightning.sh"
|
||||
#include "fs_shadowmaps_color_lighting.sh"
|
||||
|
||||
void main()
|
||||
{
|
||||
#include "fs_shadowmaps_color_lightning_main.sh"
|
||||
#include "fs_shadowmaps_color_lighting_main.sh"
|
||||
}
|
|
@ -8,9 +8,9 @@ $input v_position, v_normal, v_view, v_texcoord1, v_texcoord2, v_texcoord3, v_te
|
|||
#define SM_VSM 1
|
||||
#define SM_CSM 1
|
||||
|
||||
#include "fs_shadowmaps_color_lightning.sh"
|
||||
#include "fs_shadowmaps_color_lighting.sh"
|
||||
|
||||
void main()
|
||||
{
|
||||
#include "fs_shadowmaps_color_lightning_main.sh"
|
||||
#include "fs_shadowmaps_color_lighting_main.sh"
|
||||
}
|
|
@ -8,9 +8,9 @@ $input v_normal, v_view, v_shadowcoord
|
|||
#define SM_VSM 1
|
||||
#define SM_LINEAR 1
|
||||
|
||||
#include "fs_shadowmaps_color_lightning.sh"
|
||||
#include "fs_shadowmaps_color_lighting.sh"
|
||||
|
||||
void main()
|
||||
{
|
||||
#include "fs_shadowmaps_color_lightning_main.sh"
|
||||
#include "fs_shadowmaps_color_lighting_main.sh"
|
||||
}
|
|
@ -8,10 +8,10 @@ $input v_position, v_normal, v_view, v_texcoord1, v_texcoord2, v_texcoord3, v_te
|
|||
#define SM_LINEAR 1
|
||||
#define SM_CSM 1
|
||||
|
||||
#include "fs_shadowmaps_color_lightning.sh"
|
||||
#include "fs_shadowmaps_color_lighting.sh"
|
||||
|
||||
void main()
|
||||
{
|
||||
#include "fs_shadowmaps_color_lightning_main.sh"
|
||||
#include "fs_shadowmaps_color_lighting_main.sh"
|
||||
}
|
||||
|
|
@ -8,10 +8,10 @@ $input v_position, v_normal, v_view, v_texcoord1, v_texcoord2, v_texcoord3, v_te
|
|||
#define SM_LINEAR 1
|
||||
#define SM_OMNI 1
|
||||
|
||||
#include "fs_shadowmaps_color_lightning.sh"
|
||||
#include "fs_shadowmaps_color_lighting.sh"
|
||||
|
||||
void main()
|
||||
{
|
||||
#include "fs_shadowmaps_color_lightning_main.sh"
|
||||
#include "fs_shadowmaps_color_lighting_main.sh"
|
||||
}
|
||||
|
|
@ -8,9 +8,9 @@ $input v_position, v_normal, v_view, v_texcoord1, v_texcoord2, v_texcoord3, v_te
|
|||
#define SM_VSM 1
|
||||
#define SM_OMNI 1
|
||||
|
||||
#include "fs_shadowmaps_color_lightning.sh"
|
||||
#include "fs_shadowmaps_color_lighting.sh"
|
||||
|
||||
void main()
|
||||
{
|
||||
#include "fs_shadowmaps_color_lightning_main.sh"
|
||||
#include "fs_shadowmaps_color_lighting_main.sh"
|
||||
}
|
|
@ -412,7 +412,7 @@ struct Uniforms
|
|||
void init()
|
||||
{
|
||||
m_ambientPass = 1.0f;
|
||||
m_lightningPass = 1.0f;
|
||||
m_lightingPass = 1.0f;
|
||||
|
||||
m_shadowMapBias = 0.003f;
|
||||
m_shadowMapOffset = 0.0f;
|
||||
|
@ -571,7 +571,7 @@ struct Uniforms
|
|||
struct
|
||||
{
|
||||
float m_ambientPass;
|
||||
float m_lightningPass;
|
||||
float m_lightingPass;
|
||||
float m_unused00;
|
||||
float m_unused01;
|
||||
};
|
||||
|
@ -1201,48 +1201,48 @@ struct Programs
|
|||
m_packDepth[DepthImpl::Linear][PackDepth::RGBA] = loadProgram("vs_shadowmaps_packdepth_linear", "fs_shadowmaps_packdepth_linear");
|
||||
m_packDepth[DepthImpl::Linear][PackDepth::VSM] = loadProgram("vs_shadowmaps_packdepth_linear", "fs_shadowmaps_packdepth_vsm_linear");
|
||||
|
||||
// Color lightning.
|
||||
m_colorLightning[SmType::Single][DepthImpl::InvZ][SmImpl::Hard] = loadProgram("vs_shadowmaps_color_lightning", "fs_shadowmaps_color_lightning_hard");
|
||||
m_colorLightning[SmType::Single][DepthImpl::InvZ][SmImpl::PCF] = loadProgram("vs_shadowmaps_color_lightning", "fs_shadowmaps_color_lightning_pcf");
|
||||
m_colorLightning[SmType::Single][DepthImpl::InvZ][SmImpl::VSM] = loadProgram("vs_shadowmaps_color_lightning", "fs_shadowmaps_color_lightning_vsm");
|
||||
m_colorLightning[SmType::Single][DepthImpl::InvZ][SmImpl::ESM] = loadProgram("vs_shadowmaps_color_lightning", "fs_shadowmaps_color_lightning_esm");
|
||||
// Color lighting.
|
||||
m_colorLighting[SmType::Single][DepthImpl::InvZ][SmImpl::Hard] = loadProgram("vs_shadowmaps_color_lighting", "fs_shadowmaps_color_lighting_hard");
|
||||
m_colorLighting[SmType::Single][DepthImpl::InvZ][SmImpl::PCF] = loadProgram("vs_shadowmaps_color_lighting", "fs_shadowmaps_color_lighting_pcf");
|
||||
m_colorLighting[SmType::Single][DepthImpl::InvZ][SmImpl::VSM] = loadProgram("vs_shadowmaps_color_lighting", "fs_shadowmaps_color_lighting_vsm");
|
||||
m_colorLighting[SmType::Single][DepthImpl::InvZ][SmImpl::ESM] = loadProgram("vs_shadowmaps_color_lighting", "fs_shadowmaps_color_lighting_esm");
|
||||
|
||||
m_colorLightning[SmType::Single][DepthImpl::Linear][SmImpl::Hard] = loadProgram("vs_shadowmaps_color_lightning_linear", "fs_shadowmaps_color_lightning_hard_linear");
|
||||
m_colorLightning[SmType::Single][DepthImpl::Linear][SmImpl::PCF] = loadProgram("vs_shadowmaps_color_lightning_linear", "fs_shadowmaps_color_lightning_pcf_linear");
|
||||
m_colorLightning[SmType::Single][DepthImpl::Linear][SmImpl::VSM] = loadProgram("vs_shadowmaps_color_lightning_linear", "fs_shadowmaps_color_lightning_vsm_linear");
|
||||
m_colorLightning[SmType::Single][DepthImpl::Linear][SmImpl::ESM] = loadProgram("vs_shadowmaps_color_lightning_linear", "fs_shadowmaps_color_lightning_esm_linear");
|
||||
m_colorLighting[SmType::Single][DepthImpl::Linear][SmImpl::Hard] = loadProgram("vs_shadowmaps_color_lighting_linear", "fs_shadowmaps_color_lighting_hard_linear");
|
||||
m_colorLighting[SmType::Single][DepthImpl::Linear][SmImpl::PCF] = loadProgram("vs_shadowmaps_color_lighting_linear", "fs_shadowmaps_color_lighting_pcf_linear");
|
||||
m_colorLighting[SmType::Single][DepthImpl::Linear][SmImpl::VSM] = loadProgram("vs_shadowmaps_color_lighting_linear", "fs_shadowmaps_color_lighting_vsm_linear");
|
||||
m_colorLighting[SmType::Single][DepthImpl::Linear][SmImpl::ESM] = loadProgram("vs_shadowmaps_color_lighting_linear", "fs_shadowmaps_color_lighting_esm_linear");
|
||||
|
||||
m_colorLightning[SmType::Omni][DepthImpl::InvZ][SmImpl::Hard] = loadProgram("vs_shadowmaps_color_lightning_omni", "fs_shadowmaps_color_lightning_hard_omni");
|
||||
m_colorLightning[SmType::Omni][DepthImpl::InvZ][SmImpl::PCF] = loadProgram("vs_shadowmaps_color_lightning_omni", "fs_shadowmaps_color_lightning_pcf_omni");
|
||||
m_colorLightning[SmType::Omni][DepthImpl::InvZ][SmImpl::VSM] = loadProgram("vs_shadowmaps_color_lightning_omni", "fs_shadowmaps_color_lightning_vsm_omni");
|
||||
m_colorLightning[SmType::Omni][DepthImpl::InvZ][SmImpl::ESM] = loadProgram("vs_shadowmaps_color_lightning_omni", "fs_shadowmaps_color_lightning_esm_omni");
|
||||
m_colorLighting[SmType::Omni][DepthImpl::InvZ][SmImpl::Hard] = loadProgram("vs_shadowmaps_color_lighting_omni", "fs_shadowmaps_color_lighting_hard_omni");
|
||||
m_colorLighting[SmType::Omni][DepthImpl::InvZ][SmImpl::PCF] = loadProgram("vs_shadowmaps_color_lighting_omni", "fs_shadowmaps_color_lighting_pcf_omni");
|
||||
m_colorLighting[SmType::Omni][DepthImpl::InvZ][SmImpl::VSM] = loadProgram("vs_shadowmaps_color_lighting_omni", "fs_shadowmaps_color_lighting_vsm_omni");
|
||||
m_colorLighting[SmType::Omni][DepthImpl::InvZ][SmImpl::ESM] = loadProgram("vs_shadowmaps_color_lighting_omni", "fs_shadowmaps_color_lighting_esm_omni");
|
||||
|
||||
m_colorLightning[SmType::Omni][DepthImpl::Linear][SmImpl::Hard] = loadProgram("vs_shadowmaps_color_lightning_linear_omni", "fs_shadowmaps_color_lightning_hard_linear_omni");
|
||||
m_colorLightning[SmType::Omni][DepthImpl::Linear][SmImpl::PCF] = loadProgram("vs_shadowmaps_color_lightning_linear_omni", "fs_shadowmaps_color_lightning_pcf_linear_omni");
|
||||
m_colorLightning[SmType::Omni][DepthImpl::Linear][SmImpl::VSM] = loadProgram("vs_shadowmaps_color_lightning_linear_omni", "fs_shadowmaps_color_lightning_vsm_linear_omni");
|
||||
m_colorLightning[SmType::Omni][DepthImpl::Linear][SmImpl::ESM] = loadProgram("vs_shadowmaps_color_lightning_linear_omni", "fs_shadowmaps_color_lightning_esm_linear_omni");
|
||||
m_colorLighting[SmType::Omni][DepthImpl::Linear][SmImpl::Hard] = loadProgram("vs_shadowmaps_color_lighting_linear_omni", "fs_shadowmaps_color_lighting_hard_linear_omni");
|
||||
m_colorLighting[SmType::Omni][DepthImpl::Linear][SmImpl::PCF] = loadProgram("vs_shadowmaps_color_lighting_linear_omni", "fs_shadowmaps_color_lighting_pcf_linear_omni");
|
||||
m_colorLighting[SmType::Omni][DepthImpl::Linear][SmImpl::VSM] = loadProgram("vs_shadowmaps_color_lighting_linear_omni", "fs_shadowmaps_color_lighting_vsm_linear_omni");
|
||||
m_colorLighting[SmType::Omni][DepthImpl::Linear][SmImpl::ESM] = loadProgram("vs_shadowmaps_color_lighting_linear_omni", "fs_shadowmaps_color_lighting_esm_linear_omni");
|
||||
|
||||
m_colorLightning[SmType::Cascade][DepthImpl::InvZ][SmImpl::Hard] = loadProgram("vs_shadowmaps_color_lightning_csm", "fs_shadowmaps_color_lightning_hard_csm");
|
||||
m_colorLightning[SmType::Cascade][DepthImpl::InvZ][SmImpl::PCF] = loadProgram("vs_shadowmaps_color_lightning_csm", "fs_shadowmaps_color_lightning_pcf_csm");
|
||||
m_colorLightning[SmType::Cascade][DepthImpl::InvZ][SmImpl::VSM] = loadProgram("vs_shadowmaps_color_lightning_csm", "fs_shadowmaps_color_lightning_vsm_csm");
|
||||
m_colorLightning[SmType::Cascade][DepthImpl::InvZ][SmImpl::ESM] = loadProgram("vs_shadowmaps_color_lightning_csm", "fs_shadowmaps_color_lightning_esm_csm");
|
||||
m_colorLighting[SmType::Cascade][DepthImpl::InvZ][SmImpl::Hard] = loadProgram("vs_shadowmaps_color_lighting_csm", "fs_shadowmaps_color_lighting_hard_csm");
|
||||
m_colorLighting[SmType::Cascade][DepthImpl::InvZ][SmImpl::PCF] = loadProgram("vs_shadowmaps_color_lighting_csm", "fs_shadowmaps_color_lighting_pcf_csm");
|
||||
m_colorLighting[SmType::Cascade][DepthImpl::InvZ][SmImpl::VSM] = loadProgram("vs_shadowmaps_color_lighting_csm", "fs_shadowmaps_color_lighting_vsm_csm");
|
||||
m_colorLighting[SmType::Cascade][DepthImpl::InvZ][SmImpl::ESM] = loadProgram("vs_shadowmaps_color_lighting_csm", "fs_shadowmaps_color_lighting_esm_csm");
|
||||
|
||||
m_colorLightning[SmType::Cascade][DepthImpl::Linear][SmImpl::Hard] = loadProgram("vs_shadowmaps_color_lightning_linear_csm", "fs_shadowmaps_color_lightning_hard_linear_csm");
|
||||
m_colorLightning[SmType::Cascade][DepthImpl::Linear][SmImpl::PCF] = loadProgram("vs_shadowmaps_color_lightning_linear_csm", "fs_shadowmaps_color_lightning_pcf_linear_csm");
|
||||
m_colorLightning[SmType::Cascade][DepthImpl::Linear][SmImpl::VSM] = loadProgram("vs_shadowmaps_color_lightning_linear_csm", "fs_shadowmaps_color_lightning_vsm_linear_csm");
|
||||
m_colorLightning[SmType::Cascade][DepthImpl::Linear][SmImpl::ESM] = loadProgram("vs_shadowmaps_color_lightning_linear_csm", "fs_shadowmaps_color_lightning_esm_linear_csm");
|
||||
m_colorLighting[SmType::Cascade][DepthImpl::Linear][SmImpl::Hard] = loadProgram("vs_shadowmaps_color_lighting_linear_csm", "fs_shadowmaps_color_lighting_hard_linear_csm");
|
||||
m_colorLighting[SmType::Cascade][DepthImpl::Linear][SmImpl::PCF] = loadProgram("vs_shadowmaps_color_lighting_linear_csm", "fs_shadowmaps_color_lighting_pcf_linear_csm");
|
||||
m_colorLighting[SmType::Cascade][DepthImpl::Linear][SmImpl::VSM] = loadProgram("vs_shadowmaps_color_lighting_linear_csm", "fs_shadowmaps_color_lighting_vsm_linear_csm");
|
||||
m_colorLighting[SmType::Cascade][DepthImpl::Linear][SmImpl::ESM] = loadProgram("vs_shadowmaps_color_lighting_linear_csm", "fs_shadowmaps_color_lighting_esm_linear_csm");
|
||||
}
|
||||
|
||||
void destroy()
|
||||
{
|
||||
// Color lightning.
|
||||
// Color lighting.
|
||||
for (uint8_t ii = 0; ii < SmType::Count; ++ii)
|
||||
{
|
||||
for (uint8_t jj = 0; jj < DepthImpl::Count; ++jj)
|
||||
{
|
||||
for (uint8_t kk = 0; kk < SmImpl::Count; ++kk)
|
||||
{
|
||||
bgfx::destroyProgram(m_colorLightning[ii][jj][kk]);
|
||||
bgfx::destroyProgram(m_colorLighting[ii][jj][kk]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1287,7 +1287,7 @@ struct Programs
|
|||
bgfx::ProgramHandle m_hBlur[PackDepth::Count];
|
||||
bgfx::ProgramHandle m_drawDepth[PackDepth::Count];
|
||||
bgfx::ProgramHandle m_packDepth[DepthImpl::Count][PackDepth::Count];
|
||||
bgfx::ProgramHandle m_colorLightning[SmType::Count][DepthImpl::Count][SmImpl::Count];
|
||||
bgfx::ProgramHandle m_colorLighting[SmType::Count][DepthImpl::Count][SmImpl::Count];
|
||||
};
|
||||
|
||||
static Programs s_programs;
|
||||
|
@ -1464,7 +1464,7 @@ int _main_(int _argc, char** _argv)
|
|||
, 1.0f, 0.0f, 3.0f, 0.01f // m_yOffset
|
||||
, true // m_doBlur
|
||||
, &s_programs.m_packDepth[DepthImpl::InvZ][PackDepth::RGBA] //m_progPack
|
||||
, &s_programs.m_colorLightning[SmType::Single][DepthImpl::InvZ][SmImpl::Hard] //m_progDraw
|
||||
, &s_programs.m_colorLighting[SmType::Single][DepthImpl::InvZ][SmImpl::Hard] //m_progDraw
|
||||
},
|
||||
{ //SmImpl::PCF
|
||||
10.0f, 7.0f, 12.0f, 1.0f // m_sizePwrTwo
|
||||
|
@ -1481,7 +1481,7 @@ int _main_(int _argc, char** _argv)
|
|||
, 1.0f, 0.0f, 3.0f, 0.01f // m_yOffset
|
||||
, true // m_doBlur
|
||||
, &s_programs.m_packDepth[DepthImpl::InvZ][PackDepth::RGBA] //m_progPack
|
||||
, &s_programs.m_colorLightning[SmType::Single][DepthImpl::InvZ][SmImpl::PCF] //m_progDraw
|
||||
, &s_programs.m_colorLighting[SmType::Single][DepthImpl::InvZ][SmImpl::PCF] //m_progDraw
|
||||
},
|
||||
{ //SmImpl::VSM
|
||||
10.0f, 7.0f, 12.0f, 1.0f // m_sizePwrTwo
|
||||
|
@ -1498,7 +1498,7 @@ int _main_(int _argc, char** _argv)
|
|||
, 1.0f, 0.0f, 3.0f, 0.01f // m_yOffset
|
||||
, true // m_doBlur
|
||||
, &s_programs.m_packDepth[DepthImpl::InvZ][PackDepth::VSM] //m_progPack
|
||||
, &s_programs.m_colorLightning[SmType::Single][DepthImpl::InvZ][SmImpl::VSM] //m_progDraw
|
||||
, &s_programs.m_colorLighting[SmType::Single][DepthImpl::InvZ][SmImpl::VSM] //m_progDraw
|
||||
},
|
||||
{ //SmImpl::ESM
|
||||
10.0f, 7.0f, 12.0f, 1.0f // m_sizePwrTwo
|
||||
|
@ -1515,7 +1515,7 @@ int _main_(int _argc, char** _argv)
|
|||
, 1.0f, 0.0f, 3.0f, 0.01f // m_yOffset
|
||||
, true // m_doBlur
|
||||
, &s_programs.m_packDepth[DepthImpl::InvZ][PackDepth::RGBA] //m_progPack
|
||||
, &s_programs.m_colorLightning[SmType::Single][DepthImpl::InvZ][SmImpl::ESM] //m_progDraw
|
||||
, &s_programs.m_colorLighting[SmType::Single][DepthImpl::InvZ][SmImpl::ESM] //m_progDraw
|
||||
}
|
||||
|
||||
},
|
||||
|
@ -1536,7 +1536,7 @@ int _main_(int _argc, char** _argv)
|
|||
, 1.0f, 0.0f, 3.0f, 0.01f // m_yOffset
|
||||
, true // m_doBlur
|
||||
, &s_programs.m_packDepth[DepthImpl::Linear][PackDepth::RGBA] //m_progPack
|
||||
, &s_programs.m_colorLightning[SmType::Single][DepthImpl::Linear][SmImpl::Hard] //m_progDraw
|
||||
, &s_programs.m_colorLighting[SmType::Single][DepthImpl::Linear][SmImpl::Hard] //m_progDraw
|
||||
},
|
||||
{ //SmImpl::PCF
|
||||
10.0f, 7.0f, 12.0f, 1.0f // m_sizePwrTwo
|
||||
|
@ -1553,7 +1553,7 @@ int _main_(int _argc, char** _argv)
|
|||
, 1.0f, 0.0f, 3.0f, 0.01f // m_yOffset
|
||||
, true // m_doBlur
|
||||
, &s_programs.m_packDepth[DepthImpl::Linear][PackDepth::RGBA] //m_progPack
|
||||
, &s_programs.m_colorLightning[SmType::Single][DepthImpl::Linear][SmImpl::PCF] //m_progDraw
|
||||
, &s_programs.m_colorLighting[SmType::Single][DepthImpl::Linear][SmImpl::PCF] //m_progDraw
|
||||
},
|
||||
{ //SmImpl::VSM
|
||||
10.0f, 7.0f, 12.0f, 1.0f // m_sizePwrTwo
|
||||
|
@ -1570,7 +1570,7 @@ int _main_(int _argc, char** _argv)
|
|||
, 1.0f, 0.0f, 3.0f, 0.01f // m_yOffset
|
||||
, true // m_doBlur
|
||||
, &s_programs.m_packDepth[DepthImpl::Linear][PackDepth::VSM] //m_progPack
|
||||
, &s_programs.m_colorLightning[SmType::Single][DepthImpl::Linear][SmImpl::VSM] //m_progDraw
|
||||
, &s_programs.m_colorLighting[SmType::Single][DepthImpl::Linear][SmImpl::VSM] //m_progDraw
|
||||
},
|
||||
{ //SmImpl::ESM
|
||||
10.0f, 7.0f, 12.0f, 1.0f // m_sizePwrTwo
|
||||
|
@ -1587,7 +1587,7 @@ int _main_(int _argc, char** _argv)
|
|||
, 1.0f, 0.0f, 3.0f, 0.01f // m_yOffset
|
||||
, true // m_doBlur
|
||||
, &s_programs.m_packDepth[DepthImpl::Linear][PackDepth::RGBA] //m_progPack
|
||||
, &s_programs.m_colorLightning[SmType::Single][DepthImpl::Linear][SmImpl::ESM] //m_progDraw
|
||||
, &s_programs.m_colorLighting[SmType::Single][DepthImpl::Linear][SmImpl::ESM] //m_progDraw
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1612,7 +1612,7 @@ int _main_(int _argc, char** _argv)
|
|||
, 0.25f, 0.0f, 2.0f, 0.001f // m_yOffset
|
||||
, true // m_doBlur
|
||||
, &s_programs.m_packDepth[DepthImpl::InvZ][PackDepth::RGBA] //m_progPack
|
||||
, &s_programs.m_colorLightning[SmType::Omni][DepthImpl::InvZ][SmImpl::Hard] //m_progDraw
|
||||
, &s_programs.m_colorLighting[SmType::Omni][DepthImpl::InvZ][SmImpl::Hard] //m_progDraw
|
||||
},
|
||||
{ //SmImpl::PCF
|
||||
12.0f, 9.0f, 12.0f, 1.0f // m_sizePwrTwo
|
||||
|
@ -1629,7 +1629,7 @@ int _main_(int _argc, char** _argv)
|
|||
, 1.0f, 0.0f, 3.0f, 0.001f // m_yOffset
|
||||
, true // m_doBlur
|
||||
, &s_programs.m_packDepth[DepthImpl::InvZ][PackDepth::RGBA] //m_progPack
|
||||
, &s_programs.m_colorLightning[SmType::Omni][DepthImpl::InvZ][SmImpl::PCF] //m_progDraw
|
||||
, &s_programs.m_colorLighting[SmType::Omni][DepthImpl::InvZ][SmImpl::PCF] //m_progDraw
|
||||
},
|
||||
{ //SmImpl::VSM
|
||||
12.0f, 9.0f, 12.0f, 1.0f // m_sizePwrTwo
|
||||
|
@ -1646,7 +1646,7 @@ int _main_(int _argc, char** _argv)
|
|||
, 0.25f, 0.0f, 2.0f, 0.001f // m_yOffset
|
||||
, true // m_doBlur
|
||||
, &s_programs.m_packDepth[DepthImpl::InvZ][PackDepth::VSM] //m_progPack
|
||||
, &s_programs.m_colorLightning[SmType::Omni][DepthImpl::InvZ][SmImpl::VSM] //m_progDraw
|
||||
, &s_programs.m_colorLighting[SmType::Omni][DepthImpl::InvZ][SmImpl::VSM] //m_progDraw
|
||||
},
|
||||
{ //SmImpl::ESM
|
||||
12.0f, 9.0f, 12.0f, 1.0f // m_sizePwrTwo
|
||||
|
@ -1663,7 +1663,7 @@ int _main_(int _argc, char** _argv)
|
|||
, 0.25f, 0.0f, 2.0f, 0.001f // m_yOffset
|
||||
, true // m_doBlur
|
||||
, &s_programs.m_packDepth[DepthImpl::InvZ][PackDepth::RGBA] //m_progPack
|
||||
, &s_programs.m_colorLightning[SmType::Omni][DepthImpl::InvZ][SmImpl::ESM] //m_progDraw
|
||||
, &s_programs.m_colorLighting[SmType::Omni][DepthImpl::InvZ][SmImpl::ESM] //m_progDraw
|
||||
}
|
||||
|
||||
},
|
||||
|
@ -1684,7 +1684,7 @@ int _main_(int _argc, char** _argv)
|
|||
, 0.25f, 0.0f, 2.0f, 0.001f // m_yOffset
|
||||
, true // m_doBlur
|
||||
, &s_programs.m_packDepth[DepthImpl::Linear][PackDepth::RGBA] //m_progPack
|
||||
, &s_programs.m_colorLightning[SmType::Omni][DepthImpl::Linear][SmImpl::Hard] //m_progDraw
|
||||
, &s_programs.m_colorLighting[SmType::Omni][DepthImpl::Linear][SmImpl::Hard] //m_progDraw
|
||||
},
|
||||
{ //SmImpl::PCF
|
||||
12.0f, 9.0f, 12.0f, 1.0f // m_sizePwrTwo
|
||||
|
@ -1701,7 +1701,7 @@ int _main_(int _argc, char** _argv)
|
|||
, 1.0f, 0.0f, 3.0f, 0.001f // m_yOffset
|
||||
, true // m_doBlur
|
||||
, &s_programs.m_packDepth[DepthImpl::Linear][PackDepth::RGBA] //m_progPack
|
||||
, &s_programs.m_colorLightning[SmType::Omni][DepthImpl::Linear][SmImpl::PCF] //m_progDraw
|
||||
, &s_programs.m_colorLighting[SmType::Omni][DepthImpl::Linear][SmImpl::PCF] //m_progDraw
|
||||
},
|
||||
{ //SmImpl::VSM
|
||||
12.0f, 9.0f, 12.0f, 1.0f // m_sizePwrTwo
|
||||
|
@ -1718,7 +1718,7 @@ int _main_(int _argc, char** _argv)
|
|||
, 0.25f, 0.0f, 2.0f, 0.001f // m_yOffset
|
||||
, true // m_doBlur
|
||||
, &s_programs.m_packDepth[DepthImpl::Linear][PackDepth::VSM] //m_progPack
|
||||
, &s_programs.m_colorLightning[SmType::Omni][DepthImpl::Linear][SmImpl::VSM] //m_progDraw
|
||||
, &s_programs.m_colorLighting[SmType::Omni][DepthImpl::Linear][SmImpl::VSM] //m_progDraw
|
||||
},
|
||||
{ //SmImpl::ESM
|
||||
12.0f, 9.0f, 12.0f, 1.0f // m_sizePwrTwo
|
||||
|
@ -1735,7 +1735,7 @@ int _main_(int _argc, char** _argv)
|
|||
, 0.25f, 0.0f, 2.0f, 0.001f // m_yOffset
|
||||
, true // m_doBlur
|
||||
, &s_programs.m_packDepth[DepthImpl::Linear][PackDepth::RGBA] //m_progPack
|
||||
, &s_programs.m_colorLightning[SmType::Omni][DepthImpl::Linear][SmImpl::ESM] //m_progDraw
|
||||
, &s_programs.m_colorLighting[SmType::Omni][DepthImpl::Linear][SmImpl::ESM] //m_progDraw
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1760,7 +1760,7 @@ int _main_(int _argc, char** _argv)
|
|||
, 0.2f, 0.0f, 1.0f, 0.01f // m_yOffset
|
||||
, true // m_doBlur
|
||||
, &s_programs.m_packDepth[DepthImpl::InvZ][PackDepth::RGBA] //m_progPack
|
||||
, &s_programs.m_colorLightning[SmType::Cascade][DepthImpl::InvZ][SmImpl::Hard] //m_progDraw
|
||||
, &s_programs.m_colorLighting[SmType::Cascade][DepthImpl::InvZ][SmImpl::Hard] //m_progDraw
|
||||
},
|
||||
{ //SmImpl::PCF
|
||||
11.0f, 7.0f, 12.0f, 1.0f // m_sizePwrTwo
|
||||
|
@ -1777,7 +1777,7 @@ int _main_(int _argc, char** _argv)
|
|||
, 1.0f, 0.0f, 3.0f, 0.01f // m_yOffset
|
||||
, true // m_doBlur
|
||||
, &s_programs.m_packDepth[DepthImpl::InvZ][PackDepth::RGBA] //m_progPack
|
||||
, &s_programs.m_colorLightning[SmType::Cascade][DepthImpl::InvZ][SmImpl::PCF] //m_progDraw
|
||||
, &s_programs.m_colorLighting[SmType::Cascade][DepthImpl::InvZ][SmImpl::PCF] //m_progDraw
|
||||
},
|
||||
{ //SmImpl::VSM
|
||||
11.0f, 7.0f, 12.0f, 1.0f // m_sizePwrTwo
|
||||
|
@ -1794,7 +1794,7 @@ int _main_(int _argc, char** _argv)
|
|||
, 0.2f, 0.0f, 1.0f, 0.01f // m_yOffset
|
||||
, true // m_doBlur
|
||||
, &s_programs.m_packDepth[DepthImpl::InvZ][PackDepth::VSM] //m_progPack
|
||||
, &s_programs.m_colorLightning[SmType::Cascade][DepthImpl::InvZ][SmImpl::VSM] //m_progDraw
|
||||
, &s_programs.m_colorLighting[SmType::Cascade][DepthImpl::InvZ][SmImpl::VSM] //m_progDraw
|
||||
},
|
||||
{ //SmImpl::ESM
|
||||
11.0f, 7.0f, 12.0f, 1.0f // m_sizePwrTwo
|
||||
|
@ -1811,7 +1811,7 @@ int _main_(int _argc, char** _argv)
|
|||
, 0.2f, 0.0f, 1.0f, 0.01f // m_yOffset
|
||||
, true // m_doBlur
|
||||
, &s_programs.m_packDepth[DepthImpl::InvZ][PackDepth::RGBA] //m_progPack
|
||||
, &s_programs.m_colorLightning[SmType::Cascade][DepthImpl::InvZ][SmImpl::ESM] //m_progDraw
|
||||
, &s_programs.m_colorLighting[SmType::Cascade][DepthImpl::InvZ][SmImpl::ESM] //m_progDraw
|
||||
}
|
||||
|
||||
},
|
||||
|
@ -1832,7 +1832,7 @@ int _main_(int _argc, char** _argv)
|
|||
, 0.2f, 0.0f, 1.0f, 0.01f // m_yOffset
|
||||
, true // m_doBlur
|
||||
, &s_programs.m_packDepth[DepthImpl::Linear][PackDepth::RGBA] //m_progPack
|
||||
, &s_programs.m_colorLightning[SmType::Cascade][DepthImpl::Linear][SmImpl::Hard] //m_progDraw
|
||||
, &s_programs.m_colorLighting[SmType::Cascade][DepthImpl::Linear][SmImpl::Hard] //m_progDraw
|
||||
},
|
||||
{ //SmImpl::PCF
|
||||
11.0f, 7.0f, 12.0f, 1.0f // m_sizePwrTwo
|
||||
|
@ -1849,7 +1849,7 @@ int _main_(int _argc, char** _argv)
|
|||
, 1.0f, 0.0f, 3.0f, 0.01f // m_yOffset
|
||||
, true // m_doBlur
|
||||
, &s_programs.m_packDepth[DepthImpl::Linear][PackDepth::RGBA] //m_progPack
|
||||
, &s_programs.m_colorLightning[SmType::Cascade][DepthImpl::Linear][SmImpl::PCF] //m_progDraw
|
||||
, &s_programs.m_colorLighting[SmType::Cascade][DepthImpl::Linear][SmImpl::PCF] //m_progDraw
|
||||
},
|
||||
{ //SmImpl::VSM
|
||||
11.0f, 7.0f, 12.0f, 1.0f // m_sizePwrTwo
|
||||
|
@ -1866,7 +1866,7 @@ int _main_(int _argc, char** _argv)
|
|||
, 0.2f, 0.0f, 1.0f, 0.01f // m_yOffset
|
||||
, true // m_doBlur
|
||||
, &s_programs.m_packDepth[DepthImpl::Linear][PackDepth::VSM] //m_progPack
|
||||
, &s_programs.m_colorLightning[SmType::Cascade][DepthImpl::Linear][SmImpl::VSM] //m_progDraw
|
||||
, &s_programs.m_colorLighting[SmType::Cascade][DepthImpl::Linear][SmImpl::VSM] //m_progDraw
|
||||
},
|
||||
{ //SmImpl::ESM
|
||||
11.0f, 7.0f, 12.0f, 1.0f // m_sizePwrTwo
|
||||
|
@ -1883,7 +1883,7 @@ int _main_(int _argc, char** _argv)
|
|||
, 0.2f, 0.0f, 1.0f, 0.01f // m_yOffset
|
||||
, true // m_doBlur
|
||||
, &s_programs.m_packDepth[DepthImpl::Linear][PackDepth::RGBA] //m_progPack
|
||||
, &s_programs.m_colorLightning[SmType::Cascade][DepthImpl::Linear][SmImpl::ESM] //m_progDraw
|
||||
, &s_programs.m_colorLighting[SmType::Cascade][DepthImpl::Linear][SmImpl::ESM] //m_progDraw
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -455,7 +455,7 @@ int _main_(int _argc, char** _argv)
|
|||
// Use debug font to print information about this example.
|
||||
bgfx::dbgTextClear();
|
||||
bgfx::dbgTextPrintf(0, 1, 0x4f, "bgfx/examples/18-ibl");
|
||||
bgfx::dbgTextPrintf(0, 2, 0x6f, "Description: Image based lightning.");
|
||||
bgfx::dbgTextPrintf(0, 2, 0x6f, "Description: Image-based lighting.");
|
||||
bgfx::dbgTextPrintf(0, 3, 0x0f, "Frame: % 7.3f[ms]", double(frameTime)*toMs);
|
||||
|
||||
float at[3] = { 0.0f, 0.0f, 0.0f };
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue