mirror of https://github.com/bkaradzic/bgfx
Cleanup.
This commit is contained in:
parent
67997930e3
commit
72454acc8e
|
@ -13,8 +13,8 @@ uniform vec4 u_flags;
|
|||
uniform vec4 u_rgbDiff;
|
||||
uniform vec4 u_rgbSpec;
|
||||
|
||||
SAMPLERCUBE(u_texCube, 4);
|
||||
SAMPLERCUBE(u_texCubeIrr, 5);
|
||||
SAMPLERCUBE(s_texCube, 0);
|
||||
SAMPLERCUBE(s_texCubeIrr, 1);
|
||||
|
||||
#define u_glossiness u_params.x
|
||||
#define u_exposure u_params.y
|
||||
|
@ -51,7 +51,7 @@ void main()
|
|||
vec3 cubeN = normalize(mul(u_mtx, vec4(n, 0.0)).xyz);
|
||||
|
||||
float mipLevel = min((1.0 - u_glossiness)*11.0 + 1.0, 8.0);
|
||||
vec3 cenv = textureCubeLod(u_texCube, cubeR, mipLevel).xyz;
|
||||
vec3 cenv = textureCubeLod(s_texCube, cubeR, mipLevel).xyz;
|
||||
|
||||
vec3 kd = u_rgbDiff.xyz;
|
||||
vec3 ks = u_rgbSpec.xyz;
|
||||
|
@ -64,7 +64,7 @@ void main()
|
|||
vec3 spec = cs * pow(ndoth, pwr) * ( (pwr + 8.0)/8.0) * fresnel(cs, vdoth);
|
||||
|
||||
vec3 ambspec = fresnel(cs, ndotv) * cenv;
|
||||
vec3 ambdiff = cd * textureCube(u_texCubeIrr, cubeN).xyz;
|
||||
vec3 ambdiff = cd * textureCube(s_texCubeIrr, cubeN).xyz;
|
||||
|
||||
vec3 lc = ( diff * u_doDiffuse + spec * u_doSpecular ) * ndotl * clight;
|
||||
vec3 ec = (ambdiff * u_doDiffuseIbl + ambspec * u_doSpecularIbl);
|
||||
|
|
|
@ -7,7 +7,7 @@ $input v_dir
|
|||
|
||||
#include "../common/common.sh"
|
||||
|
||||
SAMPLERCUBE(u_texCube, 4);
|
||||
SAMPLERCUBE(s_texCube, 0);
|
||||
|
||||
uniform vec4 u_params;
|
||||
#define u_exposure u_params.y
|
||||
|
@ -16,7 +16,7 @@ void main()
|
|||
{
|
||||
vec3 dir = normalize(v_dir);
|
||||
|
||||
vec4 color = textureCubeLod(u_texCube, dir, 0.0);
|
||||
vec4 color = textureCubeLod(s_texCube, dir, 0.0);
|
||||
color *= exp2(u_exposure);
|
||||
|
||||
gl_FragColor = toFilmic(color);
|
||||
|
|
|
@ -347,7 +347,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
|
|||
{
|
||||
settings.m_crossCubemapPreview = ImguiCubemap::Enum( (settings.m_crossCubemapPreview+1) % ImguiCubemap::Count);
|
||||
}
|
||||
imguiSlider("Texture LOD", lod, float(0.0f), 10.1f, 0.1f);
|
||||
imguiSlider("Texture LOD", lod, 0.0f, 10.1f, 0.1f);
|
||||
|
||||
imguiEndScrollArea();
|
||||
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue