mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 13:28:09 +02:00
hide menu, fix shaders
This commit is contained in:
parent
7d68d5fd17
commit
d59f368ad6
52 changed files with 179 additions and 216 deletions
|
@ -2654,6 +2654,12 @@ void Application::initializeUi() {
|
||||||
// Now that the menu is instantiated, ensure the display plugin menu is properly updated
|
// Now that the menu is instantiated, ensure the display plugin menu is properly updated
|
||||||
updateDisplayMode();
|
updateDisplayMode();
|
||||||
flushMenuUpdates();
|
flushMenuUpdates();
|
||||||
|
|
||||||
|
// The display plugins are created before the menu now, so we need to do this here to hide the menu bar
|
||||||
|
// now that it exists
|
||||||
|
if (_window && _window->isFullScreen()) {
|
||||||
|
setFullscreen(nullptr, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -22,10 +22,10 @@
|
||||||
<@include MaterialTextures.slh@>
|
<@include MaterialTextures.slh@>
|
||||||
<$declareMaterialTextures(ALBEDO, ROUGHNESS, _SCRIBE_NULL, METALLIC, EMISSIVE, OCCLUSION)$>
|
<$declareMaterialTextures(ALBEDO, ROUGHNESS, _SCRIBE_NULL, METALLIC, EMISSIVE, OCCLUSION)$>
|
||||||
|
|
||||||
in vec4 _position;
|
in vec4 _positionES;
|
||||||
in vec2 _texCoord0;
|
in vec2 _texCoord0;
|
||||||
in vec2 _texCoord1;
|
in vec2 _texCoord1;
|
||||||
in vec3 _normal;
|
in vec3 _normalWS;
|
||||||
in vec3 _color;
|
in vec3 _color;
|
||||||
|
|
||||||
layout(location = 0) out vec4 _fragColor0;
|
layout(location = 0) out vec4 _fragColor0;
|
||||||
|
@ -54,8 +54,8 @@ void main(void) {
|
||||||
<$evalMaterialMetallic(metallicTex, metallic, matKey, metallic)$>;
|
<$evalMaterialMetallic(metallicTex, metallic, matKey, metallic)$>;
|
||||||
vec3 fresnel = getFresnelF0(metallic, albedo);
|
vec3 fresnel = getFresnelF0(metallic, albedo);
|
||||||
|
|
||||||
vec3 fragPosition = _position.xyz;
|
vec3 fragPosition = _positionES.xyz;
|
||||||
vec3 fragNormal = normalize(_normal);
|
vec3 fragNormal = normalize(_normalWS);
|
||||||
|
|
||||||
TransformCamera cam = getTransformCamera();
|
TransformCamera cam = getTransformCamera();
|
||||||
|
|
||||||
|
|
|
@ -26,8 +26,8 @@
|
||||||
|
|
||||||
in vec2 _texCoord0;
|
in vec2 _texCoord0;
|
||||||
in vec2 _texCoord1;
|
in vec2 _texCoord1;
|
||||||
in vec4 _position;
|
in vec4 _positionES;
|
||||||
in vec3 _normal;
|
in vec3 _normalWS;
|
||||||
in vec3 _color;
|
in vec3 _color;
|
||||||
in float _alpha;
|
in float _alpha;
|
||||||
|
|
||||||
|
@ -56,8 +56,8 @@ void main(void) {
|
||||||
vec3 emissive = getMaterialEmissive(mat);
|
vec3 emissive = getMaterialEmissive(mat);
|
||||||
<$evalMaterialEmissive(emissiveTex, emissive, matKey, emissive)$>;
|
<$evalMaterialEmissive(emissiveTex, emissive, matKey, emissive)$>;
|
||||||
|
|
||||||
vec3 fragPosition = _position.xyz;
|
vec3 fragPosition = _positionES.xyz;
|
||||||
vec3 fragNormal = normalize(_normal);
|
vec3 fragNormal = normalize(_normalWS);
|
||||||
|
|
||||||
TransformCamera cam = getTransformCamera();
|
TransformCamera cam = getTransformCamera();
|
||||||
|
|
||||||
|
|
|
@ -19,9 +19,7 @@
|
||||||
<$declareMaterialTextures(ALBEDO)$>
|
<$declareMaterialTextures(ALBEDO)$>
|
||||||
|
|
||||||
in vec2 _texCoord0;
|
in vec2 _texCoord0;
|
||||||
in vec3 _normal;
|
|
||||||
in vec3 _color;
|
in vec3 _color;
|
||||||
in float _alpha;
|
|
||||||
|
|
||||||
layout(location = 0) out vec4 _fragColor0;
|
layout(location = 0) out vec4 _fragColor0;
|
||||||
|
|
||||||
|
|
|
@ -17,12 +17,9 @@
|
||||||
<$declareEvalSkyboxGlobalColor()$>
|
<$declareEvalSkyboxGlobalColor()$>
|
||||||
|
|
||||||
// the interpolated normal
|
// the interpolated normal
|
||||||
in vec3 _normal;
|
in vec3 _normalWS;
|
||||||
in vec3 _modelNormal;
|
|
||||||
in vec4 _color;
|
in vec4 _color;
|
||||||
in vec2 _texCoord0;
|
in vec4 _positionES;
|
||||||
in vec4 _position;
|
|
||||||
in vec4 _eyePosition;
|
|
||||||
|
|
||||||
layout(location = 0) out vec4 _fragColor0;
|
layout(location = 0) out vec4 _fragColor0;
|
||||||
|
|
||||||
|
@ -33,7 +30,7 @@ layout(location = 0) out vec4 _fragColor0;
|
||||||
|
|
||||||
#line 2030
|
#line 2030
|
||||||
void main(void) {
|
void main(void) {
|
||||||
vec3 normal = normalize(_normal.xyz);
|
vec3 normal = normalize(_normalWS.xyz);
|
||||||
vec3 diffuse = _color.rgb;
|
vec3 diffuse = _color.rgb;
|
||||||
vec3 specular = DEFAULT_SPECULAR;
|
vec3 specular = DEFAULT_SPECULAR;
|
||||||
float shininess = DEFAULT_SHININESS;
|
float shininess = DEFAULT_SHININESS;
|
||||||
|
@ -53,7 +50,7 @@ void main(void) {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
TransformCamera cam = getTransformCamera();
|
TransformCamera cam = getTransformCamera();
|
||||||
vec3 fragPosition = _eyePosition.xyz;
|
vec3 fragPosition = _positionES.xyz;
|
||||||
|
|
||||||
if (emissiveAmount > 0.0) {
|
if (emissiveAmount > 0.0) {
|
||||||
_fragColor0 = vec4(evalSkyboxGlobalColor(
|
_fragColor0 = vec4(evalSkyboxGlobalColor(
|
||||||
|
|
|
@ -23,10 +23,10 @@
|
||||||
uniform sampler2D originalTexture;
|
uniform sampler2D originalTexture;
|
||||||
|
|
||||||
// the interpolated normal
|
// the interpolated normal
|
||||||
in vec3 _normal;
|
in vec3 _normalWS;
|
||||||
in vec4 _color;
|
in vec4 _color;
|
||||||
in vec2 _texCoord0;
|
in vec2 _texCoord0;
|
||||||
in vec4 _eyePosition;
|
in vec4 _positionES;
|
||||||
|
|
||||||
layout(location = 0) out vec4 _fragColor0;
|
layout(location = 0) out vec4 _fragColor0;
|
||||||
|
|
||||||
|
@ -35,14 +35,14 @@ void main(void) {
|
||||||
float colorAlpha = _color.a * texel.a;
|
float colorAlpha = _color.a * texel.a;
|
||||||
|
|
||||||
TransformCamera cam = getTransformCamera();
|
TransformCamera cam = getTransformCamera();
|
||||||
vec3 fragPosition = _eyePosition.xyz;
|
vec3 fragPosition = _positionES.xyz;
|
||||||
|
|
||||||
_fragColor0 = vec4(evalSkyboxGlobalColor(
|
_fragColor0 = vec4(evalSkyboxGlobalColor(
|
||||||
cam._viewInverse,
|
cam._viewInverse,
|
||||||
1.0,
|
1.0,
|
||||||
DEFAULT_OCCLUSION,
|
DEFAULT_OCCLUSION,
|
||||||
fragPosition,
|
fragPosition,
|
||||||
normalize(_normal),
|
normalize(_normalWS),
|
||||||
_color.rgb * texel.rgb,
|
_color.rgb * texel.rgb,
|
||||||
DEFAULT_FRESNEL,
|
DEFAULT_FRESNEL,
|
||||||
DEFAULT_METALLIC,
|
DEFAULT_METALLIC,
|
||||||
|
|
|
@ -23,10 +23,10 @@
|
||||||
uniform sampler2D originalTexture;
|
uniform sampler2D originalTexture;
|
||||||
|
|
||||||
// the interpolated normal
|
// the interpolated normal
|
||||||
in vec3 _normal;
|
in vec3 _normalWS;
|
||||||
in vec4 _color;
|
in vec4 _color;
|
||||||
in vec2 _texCoord0;
|
in vec2 _texCoord0;
|
||||||
in vec4 _eyePosition;
|
in vec4 _positionES;
|
||||||
|
|
||||||
layout(location = 0) out vec4 _fragColor0;
|
layout(location = 0) out vec4 _fragColor0;
|
||||||
|
|
||||||
|
@ -35,14 +35,14 @@ void main(void) {
|
||||||
float colorAlpha = _color.a * texel.a;
|
float colorAlpha = _color.a * texel.a;
|
||||||
|
|
||||||
TransformCamera cam = getTransformCamera();
|
TransformCamera cam = getTransformCamera();
|
||||||
vec3 fragPosition = _eyePosition.xyz;
|
vec3 fragPosition = _positionES.xyz;
|
||||||
|
|
||||||
_fragColor0 = vec4(evalGlobalLightingAlphaBlendedWithHaze(
|
_fragColor0 = vec4(evalGlobalLightingAlphaBlendedWithHaze(
|
||||||
cam._viewInverse,
|
cam._viewInverse,
|
||||||
1.0,
|
1.0,
|
||||||
DEFAULT_OCCLUSION,
|
DEFAULT_OCCLUSION,
|
||||||
fragPosition,
|
fragPosition,
|
||||||
normalize(_normal),
|
normalize(_normalWS),
|
||||||
_color.rgb * texel.rgb,
|
_color.rgb * texel.rgb,
|
||||||
DEFAULT_FRESNEL,
|
DEFAULT_FRESNEL,
|
||||||
DEFAULT_METALLIC,
|
DEFAULT_METALLIC,
|
||||||
|
|
|
@ -17,11 +17,9 @@
|
||||||
<$declareEvalGlobalLightingAlphaBlended()$>
|
<$declareEvalGlobalLightingAlphaBlended()$>
|
||||||
|
|
||||||
// the interpolated normal
|
// the interpolated normal
|
||||||
in vec3 _normal;
|
in vec3 _normalWS;
|
||||||
in vec3 _modelNormal;
|
|
||||||
in vec4 _color;
|
in vec4 _color;
|
||||||
in vec2 _texCoord0;
|
in vec4 _positionES;
|
||||||
in vec4 _eyePosition;
|
|
||||||
|
|
||||||
layout(location = 0) out vec4 _fragColor0;
|
layout(location = 0) out vec4 _fragColor0;
|
||||||
|
|
||||||
|
@ -32,7 +30,7 @@ layout(location = 0) out vec4 _fragColor0;
|
||||||
|
|
||||||
#line 2030
|
#line 2030
|
||||||
void main(void) {
|
void main(void) {
|
||||||
vec3 normal = normalize(_normal.xyz);
|
vec3 normal = normalize(_normalWS.xyz);
|
||||||
vec3 diffuse = _color.rgb;
|
vec3 diffuse = _color.rgb;
|
||||||
vec3 specular = DEFAULT_SPECULAR;
|
vec3 specular = DEFAULT_SPECULAR;
|
||||||
float shininess = DEFAULT_SHININESS;
|
float shininess = DEFAULT_SHININESS;
|
||||||
|
@ -52,7 +50,7 @@ void main(void) {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
TransformCamera cam = getTransformCamera();
|
TransformCamera cam = getTransformCamera();
|
||||||
vec3 fragPosition = _eyePosition.xyz;
|
vec3 fragPosition = _positionES.xyz;
|
||||||
|
|
||||||
if (emissiveAmount > 0.0) {
|
if (emissiveAmount > 0.0) {
|
||||||
_fragColor0 = vec4(evalGlobalLightingAlphaBlendedWithHaze(
|
_fragColor0 = vec4(evalGlobalLightingAlphaBlendedWithHaze(
|
||||||
|
|
|
@ -19,10 +19,9 @@
|
||||||
<@include MaterialTextures.slh@>
|
<@include MaterialTextures.slh@>
|
||||||
<$declareMaterialTextures(ALBEDO, ROUGHNESS, _SCRIBE_NULL, METALLIC, EMISSIVE, OCCLUSION, SCATTERING)$>
|
<$declareMaterialTextures(ALBEDO, ROUGHNESS, _SCRIBE_NULL, METALLIC, EMISSIVE, OCCLUSION, SCATTERING)$>
|
||||||
|
|
||||||
in vec4 _position;
|
|
||||||
in vec2 _texCoord0;
|
in vec2 _texCoord0;
|
||||||
in vec2 _texCoord1;
|
in vec2 _texCoord1;
|
||||||
in vec3 _normal;
|
in vec3 _normalWS;
|
||||||
in vec3 _color;
|
in vec3 _color;
|
||||||
|
|
||||||
|
|
||||||
|
@ -53,7 +52,7 @@ void main(void) {
|
||||||
<$evalMaterialScattering(scatteringTex, scattering, matKey, scattering)$>;
|
<$evalMaterialScattering(scatteringTex, scattering, matKey, scattering)$>;
|
||||||
|
|
||||||
packDeferredFragment(
|
packDeferredFragment(
|
||||||
normalize(_normal),
|
normalize(_normalWS),
|
||||||
opacity,
|
opacity,
|
||||||
albedo,
|
albedo,
|
||||||
roughness,
|
roughness,
|
||||||
|
|
|
@ -23,8 +23,8 @@ out vec3 _color;
|
||||||
out float _alpha;
|
out float _alpha;
|
||||||
out vec2 _texCoord0;
|
out vec2 _texCoord0;
|
||||||
out vec2 _texCoord1;
|
out vec2 _texCoord1;
|
||||||
out vec4 _position;
|
out vec4 _positionES;
|
||||||
out vec3 _normal;
|
out vec3 _normalWS;
|
||||||
|
|
||||||
void main(void) {
|
void main(void) {
|
||||||
_color = color_sRGBToLinear(inColor.xyz);
|
_color = color_sRGBToLinear(inColor.xyz);
|
||||||
|
@ -37,6 +37,6 @@ void main(void) {
|
||||||
// standard transform
|
// standard transform
|
||||||
TransformCamera cam = getTransformCamera();
|
TransformCamera cam = getTransformCamera();
|
||||||
TransformObject obj = getTransformObject();
|
TransformObject obj = getTransformObject();
|
||||||
<$transformModelToEyeAndClipPos(cam, obj, inPosition, _position, gl_Position)$>
|
<$transformModelToEyeAndClipPos(cam, obj, inPosition, _positionES, gl_Position)$>
|
||||||
<$transformModelToWorldDir(cam, obj, inNormal.xyz, _normal)$>
|
<$transformModelToWorldDir(cam, obj, inNormal.xyz, _normalWS)$>
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,6 @@
|
||||||
<@include Fade.slh@>
|
<@include Fade.slh@>
|
||||||
<$declareFadeFragment()$>
|
<$declareFadeFragment()$>
|
||||||
|
|
||||||
in vec4 _positionES;
|
|
||||||
in vec2 _texCoord0;
|
in vec2 _texCoord0;
|
||||||
in vec2 _texCoord1;
|
in vec2 _texCoord1;
|
||||||
in vec3 _normalWS;
|
in vec3 _normalWS;
|
||||||
|
|
|
@ -20,10 +20,9 @@
|
||||||
<$declareMaterialTextures(ALBEDO, ROUGHNESS, _SCRIBE_NULL, METALLIC)$>
|
<$declareMaterialTextures(ALBEDO, ROUGHNESS, _SCRIBE_NULL, METALLIC)$>
|
||||||
<$declareMaterialLightmap()$>
|
<$declareMaterialLightmap()$>
|
||||||
|
|
||||||
in vec4 _position;
|
|
||||||
in vec2 _texCoord0;
|
in vec2 _texCoord0;
|
||||||
in vec2 _texCoord1;
|
in vec2 _texCoord1;
|
||||||
in vec3 _normal;
|
in vec3 _normalWS;
|
||||||
in vec3 _color;
|
in vec3 _color;
|
||||||
|
|
||||||
void main(void) {
|
void main(void) {
|
||||||
|
@ -33,7 +32,7 @@ void main(void) {
|
||||||
<$fetchMaterialTexturesCoord1(matKey, _texCoord1, _SCRIBE_NULL, lightmapVal)$>
|
<$fetchMaterialTexturesCoord1(matKey, _texCoord1, _SCRIBE_NULL, lightmapVal)$>
|
||||||
|
|
||||||
packDeferredFragmentLightmap(
|
packDeferredFragmentLightmap(
|
||||||
normalize(_normal),
|
normalize(_normalWS),
|
||||||
evalOpaqueFinalAlpha(getMaterialOpacity(mat), albedo.a),
|
evalOpaqueFinalAlpha(getMaterialOpacity(mat), albedo.a),
|
||||||
getMaterialAlbedo(mat) * albedo.rgb * _color,
|
getMaterialAlbedo(mat) * albedo.rgb * _color,
|
||||||
getMaterialRoughness(mat) * roughness,
|
getMaterialRoughness(mat) * roughness,
|
||||||
|
|
|
@ -20,10 +20,10 @@
|
||||||
<@include MaterialTextures.slh@>
|
<@include MaterialTextures.slh@>
|
||||||
<$declareMaterialTexMapArrayBuffer()$>
|
<$declareMaterialTexMapArrayBuffer()$>
|
||||||
|
|
||||||
out vec4 _position;
|
out vec4 _positionES;
|
||||||
out vec2 _texCoord0;
|
out vec2 _texCoord0;
|
||||||
out vec2 _texCoord1;
|
out vec2 _texCoord1;
|
||||||
out vec3 _normal;
|
out vec3 _normalWS;
|
||||||
out vec3 _color;
|
out vec3 _color;
|
||||||
|
|
||||||
void main(void) {
|
void main(void) {
|
||||||
|
@ -38,7 +38,6 @@ void main(void) {
|
||||||
// standard transform
|
// standard transform
|
||||||
TransformCamera cam = getTransformCamera();
|
TransformCamera cam = getTransformCamera();
|
||||||
TransformObject obj = getTransformObject();
|
TransformObject obj = getTransformObject();
|
||||||
<$transformModelToEyeAndClipPos(cam, obj, inPosition, _position, gl_Position)$>
|
<$transformModelToEyeAndClipPos(cam, obj, inPosition, _positionES, gl_Position)$>
|
||||||
<$transformModelToWorldDir(cam, obj, inNormal.xyz, _normal)$>
|
<$transformModelToWorldDir(cam, obj, inNormal.xyz, _normalWS)$>
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,19 +23,18 @@
|
||||||
<@include Fade.slh@>
|
<@include Fade.slh@>
|
||||||
<$declareFadeFragment()$>
|
<$declareFadeFragment()$>
|
||||||
|
|
||||||
in vec4 _position;
|
|
||||||
in vec2 _texCoord0;
|
in vec2 _texCoord0;
|
||||||
in vec2 _texCoord1;
|
in vec2 _texCoord1;
|
||||||
in vec3 _normal;
|
in vec3 _normalWS;
|
||||||
in vec3 _color;
|
in vec3 _color;
|
||||||
in vec4 _worldPosition;
|
in vec4 _positionWS;
|
||||||
|
|
||||||
void main(void) {
|
void main(void) {
|
||||||
vec3 fadeEmissive;
|
vec3 fadeEmissive;
|
||||||
FadeObjectParams fadeParams;
|
FadeObjectParams fadeParams;
|
||||||
|
|
||||||
<$fetchFadeObjectParams(fadeParams)$>
|
<$fetchFadeObjectParams(fadeParams)$>
|
||||||
applyFade(fadeParams, _worldPosition.xyz, fadeEmissive);
|
applyFade(fadeParams, _positionWS.xyz, fadeEmissive);
|
||||||
|
|
||||||
Material mat = getMaterial();
|
Material mat = getMaterial();
|
||||||
BITFIELD matKey = getMaterialKey(mat);
|
BITFIELD matKey = getMaterialKey(mat);
|
||||||
|
@ -43,7 +42,7 @@ void main(void) {
|
||||||
<$fetchMaterialTexturesCoord1(matKey, _texCoord1, _SCRIBE_NULL, lightmapVal)$>
|
<$fetchMaterialTexturesCoord1(matKey, _texCoord1, _SCRIBE_NULL, lightmapVal)$>
|
||||||
|
|
||||||
packDeferredFragmentLightmap(
|
packDeferredFragmentLightmap(
|
||||||
normalize(_normal),
|
normalize(_normalWS),
|
||||||
evalOpaqueFinalAlpha(getMaterialOpacity(mat), albedo.a),
|
evalOpaqueFinalAlpha(getMaterialOpacity(mat), albedo.a),
|
||||||
getMaterialAlbedo(mat) * albedo.rgb * _color,
|
getMaterialAlbedo(mat) * albedo.rgb * _color,
|
||||||
getMaterialRoughness(mat) * roughness,
|
getMaterialRoughness(mat) * roughness,
|
||||||
|
|
|
@ -20,12 +20,12 @@
|
||||||
<@include MaterialTextures.slh@>
|
<@include MaterialTextures.slh@>
|
||||||
<$declareMaterialTexMapArrayBuffer()$>
|
<$declareMaterialTexMapArrayBuffer()$>
|
||||||
|
|
||||||
out vec4 _position;
|
out vec4 _positionES;
|
||||||
out vec2 _texCoord0;
|
out vec2 _texCoord0;
|
||||||
out vec2 _texCoord1;
|
out vec2 _texCoord1;
|
||||||
out vec3 _normal;
|
out vec3 _normalWS;
|
||||||
out vec3 _color;
|
out vec3 _color;
|
||||||
out vec4 _worldPosition;
|
out vec4 _positionWS;
|
||||||
|
|
||||||
void main(void) {
|
void main(void) {
|
||||||
// pass along the color in linear space
|
// pass along the color in linear space
|
||||||
|
@ -39,8 +39,8 @@ void main(void) {
|
||||||
// standard transform
|
// standard transform
|
||||||
TransformCamera cam = getTransformCamera();
|
TransformCamera cam = getTransformCamera();
|
||||||
TransformObject obj = getTransformObject();
|
TransformObject obj = getTransformObject();
|
||||||
<$transformModelToEyeAndClipPos(cam, obj, inPosition, _position, gl_Position)$>
|
<$transformModelToEyeAndClipPos(cam, obj, inPosition, _positionES, gl_Position)$>
|
||||||
<$transformModelToWorldPos(obj, inPosition, _worldPosition)$>
|
<$transformModelToWorldPos(obj, inPosition, _positionWS)$>
|
||||||
<$transformModelToWorldDir(cam, obj, inNormal.xyz, _normal)$>
|
<$transformModelToWorldDir(cam, obj, inNormal.xyz, _normalWS)$>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,11 +20,11 @@
|
||||||
<$declareMaterialTextures(ALBEDO, ROUGHNESS, NORMAL, METALLIC)$>
|
<$declareMaterialTextures(ALBEDO, ROUGHNESS, NORMAL, METALLIC)$>
|
||||||
<$declareMaterialLightmap()$>
|
<$declareMaterialLightmap()$>
|
||||||
|
|
||||||
in vec4 _position;
|
in vec4 _positionES;
|
||||||
in vec2 _texCoord0;
|
in vec2 _texCoord0;
|
||||||
in vec2 _texCoord1;
|
in vec2 _texCoord1;
|
||||||
in vec3 _normal;
|
in vec3 _normalWS;
|
||||||
in vec3 _tangent;
|
in vec3 _tangentWS;
|
||||||
in vec3 _color;
|
in vec3 _color;
|
||||||
|
|
||||||
void main(void) {
|
void main(void) {
|
||||||
|
@ -34,7 +34,7 @@ void main(void) {
|
||||||
<$fetchMaterialTexturesCoord1(matKey, _texCoord1, _SCRIBE_NULL, lightmapVal)$>
|
<$fetchMaterialTexturesCoord1(matKey, _texCoord1, _SCRIBE_NULL, lightmapVal)$>
|
||||||
|
|
||||||
vec3 fragNormal;
|
vec3 fragNormal;
|
||||||
<$evalMaterialNormalLOD(_position, normalTexel, _normal, _tangent, fragNormal)$>
|
<$evalMaterialNormalLOD(_positionES, normalTexel, _normalWS, _tangentWS, fragNormal)$>
|
||||||
|
|
||||||
packDeferredFragmentLightmap(
|
packDeferredFragmentLightmap(
|
||||||
normalize(fragNormal.xyz),
|
normalize(fragNormal.xyz),
|
||||||
|
|
|
@ -20,11 +20,11 @@
|
||||||
<@include MaterialTextures.slh@>
|
<@include MaterialTextures.slh@>
|
||||||
<$declareMaterialTexMapArrayBuffer()$>
|
<$declareMaterialTexMapArrayBuffer()$>
|
||||||
|
|
||||||
out vec4 _position;
|
out vec4 _positionES;
|
||||||
out vec2 _texCoord0;
|
out vec2 _texCoord0;
|
||||||
out vec2 _texCoord1;
|
out vec2 _texCoord1;
|
||||||
out vec3 _normal;
|
out vec3 _normalWS;
|
||||||
out vec3 _tangent;
|
out vec3 _tangentWS;
|
||||||
out vec3 _color;
|
out vec3 _color;
|
||||||
|
|
||||||
void main(void) {
|
void main(void) {
|
||||||
|
@ -38,7 +38,7 @@ void main(void) {
|
||||||
// standard transform
|
// standard transform
|
||||||
TransformCamera cam = getTransformCamera();
|
TransformCamera cam = getTransformCamera();
|
||||||
TransformObject obj = getTransformObject();
|
TransformObject obj = getTransformObject();
|
||||||
<$transformModelToEyeAndClipPos(cam, obj, inPosition, _position, gl_Position)$>
|
<$transformModelToEyeAndClipPos(cam, obj, inPosition, _positionES, gl_Position)$>
|
||||||
<$transformModelToWorldDir(cam, obj, inNormal.xyz, _normal)$>
|
<$transformModelToWorldDir(cam, obj, inNormal.xyz, _normalWS)$>
|
||||||
<$transformModelToWorldDir(cam, obj, inTangent.xyz, _tangent)$>
|
<$transformModelToWorldDir(cam, obj, inTangent.xyz, _tangentWS)$>
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,20 +23,20 @@
|
||||||
<@include Fade.slh@>
|
<@include Fade.slh@>
|
||||||
<$declareFadeFragment()$>
|
<$declareFadeFragment()$>
|
||||||
|
|
||||||
in vec4 _position;
|
in vec4 _positionES;
|
||||||
in vec2 _texCoord0;
|
in vec2 _texCoord0;
|
||||||
in vec2 _texCoord1;
|
in vec2 _texCoord1;
|
||||||
in vec3 _normal;
|
in vec3 _normalWS;
|
||||||
in vec3 _tangent;
|
in vec3 _tangentWS;
|
||||||
in vec3 _color;
|
in vec3 _color;
|
||||||
in vec4 _worldPosition;
|
in vec4 _positionWS;
|
||||||
|
|
||||||
void main(void) {
|
void main(void) {
|
||||||
vec3 fadeEmissive;
|
vec3 fadeEmissive;
|
||||||
FadeObjectParams fadeParams;
|
FadeObjectParams fadeParams;
|
||||||
|
|
||||||
<$fetchFadeObjectParams(fadeParams)$>
|
<$fetchFadeObjectParams(fadeParams)$>
|
||||||
applyFade(fadeParams, _worldPosition.xyz, fadeEmissive);
|
applyFade(fadeParams, _positionWS.xyz, fadeEmissive);
|
||||||
|
|
||||||
Material mat = getMaterial();
|
Material mat = getMaterial();
|
||||||
BITFIELD matKey = getMaterialKey(mat);
|
BITFIELD matKey = getMaterialKey(mat);
|
||||||
|
@ -44,7 +44,7 @@ void main(void) {
|
||||||
<$fetchMaterialTexturesCoord1(matKey, _texCoord1, _SCRIBE_NULL, lightmapVal)$>
|
<$fetchMaterialTexturesCoord1(matKey, _texCoord1, _SCRIBE_NULL, lightmapVal)$>
|
||||||
|
|
||||||
vec3 fragNormal;
|
vec3 fragNormal;
|
||||||
<$evalMaterialNormalLOD(_position, normalTexel, _normal, _tangent, fragNormal)$>
|
<$evalMaterialNormalLOD(_positionES, normalTexel, _normalWS, _tangentWS, fragNormal)$>
|
||||||
|
|
||||||
packDeferredFragmentLightmap(
|
packDeferredFragmentLightmap(
|
||||||
normalize(fragNormal.xyz),
|
normalize(fragNormal.xyz),
|
||||||
|
|
|
@ -20,13 +20,13 @@
|
||||||
<@include MaterialTextures.slh@>
|
<@include MaterialTextures.slh@>
|
||||||
<$declareMaterialTexMapArrayBuffer()$>
|
<$declareMaterialTexMapArrayBuffer()$>
|
||||||
|
|
||||||
out vec4 _position;
|
out vec4 _positionES;
|
||||||
out vec2 _texCoord0;
|
out vec2 _texCoord0;
|
||||||
out vec2 _texCoord1;
|
out vec2 _texCoord1;
|
||||||
out vec3 _normal;
|
out vec3 _normalWS;
|
||||||
out vec3 _tangent;
|
out vec3 _tangentWS;
|
||||||
out vec3 _color;
|
out vec3 _color;
|
||||||
out vec4 _worldPosition;
|
out vec4 _positionWS;
|
||||||
|
|
||||||
void main(void) {
|
void main(void) {
|
||||||
// pass along the color in linear space
|
// pass along the color in linear space
|
||||||
|
@ -39,8 +39,8 @@ void main(void) {
|
||||||
// standard transform
|
// standard transform
|
||||||
TransformCamera cam = getTransformCamera();
|
TransformCamera cam = getTransformCamera();
|
||||||
TransformObject obj = getTransformObject();
|
TransformObject obj = getTransformObject();
|
||||||
<$transformModelToEyeAndClipPos(cam, obj, inPosition, _position, gl_Position)$>
|
<$transformModelToEyeAndClipPos(cam, obj, inPosition, _positionES, gl_Position)$>
|
||||||
<$transformModelToWorldPos(obj, inPosition, _worldPosition)$>
|
<$transformModelToWorldPos(obj, inPosition, _positionWS)$>
|
||||||
<$transformModelToWorldDir(cam, obj, inNormal.xyz, _normal)$>
|
<$transformModelToWorldDir(cam, obj, inNormal.xyz, _normalWS)$>
|
||||||
<$transformModelToWorldDir(cam, obj, inTangent.xyz, _tangent)$>
|
<$transformModelToWorldDir(cam, obj, inTangent.xyz, _tangentWS)$>
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,13 +17,13 @@
|
||||||
|
|
||||||
layout(location = 0) out vec4 _fragColor;
|
layout(location = 0) out vec4 _fragColor;
|
||||||
|
|
||||||
in vec4 _worldPosition;
|
in vec4 _positionWS;
|
||||||
|
|
||||||
void main(void) {
|
void main(void) {
|
||||||
FadeObjectParams fadeParams;
|
FadeObjectParams fadeParams;
|
||||||
|
|
||||||
<$fetchFadeObjectParams(fadeParams)$>
|
<$fetchFadeObjectParams(fadeParams)$>
|
||||||
applyFadeClip(fadeParams, _worldPosition.xyz);
|
applyFadeClip(fadeParams, _positionWS.xyz);
|
||||||
|
|
||||||
// pass-through to set z-buffer
|
// pass-through to set z-buffer
|
||||||
_fragColor = vec4(1.0, 1.0, 1.0, 0.0);
|
_fragColor = vec4(1.0, 1.0, 1.0, 0.0);
|
||||||
|
|
|
@ -18,12 +18,12 @@
|
||||||
|
|
||||||
<$declareStandardTransform()$>
|
<$declareStandardTransform()$>
|
||||||
|
|
||||||
out vec4 _worldPosition;
|
out vec4 _positionWS;
|
||||||
|
|
||||||
void main(void) {
|
void main(void) {
|
||||||
// standard transform
|
// standard transform
|
||||||
TransformCamera cam = getTransformCamera();
|
TransformCamera cam = getTransformCamera();
|
||||||
TransformObject obj = getTransformObject();
|
TransformObject obj = getTransformObject();
|
||||||
<$transformModelToClipPos(cam, obj, inPosition, gl_Position)$>
|
<$transformModelToClipPos(cam, obj, inPosition, gl_Position)$>
|
||||||
<$transformModelToWorldPos(obj, inPosition, _worldPosition)$>
|
<$transformModelToWorldPos(obj, inPosition, _positionWS)$>
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
<$declareMaterialTextures(ALBEDO)$>
|
<$declareMaterialTextures(ALBEDO)$>
|
||||||
|
|
||||||
in vec2 _texCoord0;
|
in vec2 _texCoord0;
|
||||||
in vec3 _normal;
|
in vec3 _normalWS;
|
||||||
in vec3 _color;
|
in vec3 _color;
|
||||||
in float _alpha;
|
in float _alpha;
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ void main(void) {
|
||||||
albedo *= _color;
|
albedo *= _color;
|
||||||
|
|
||||||
packDeferredFragmentUnlit(
|
packDeferredFragmentUnlit(
|
||||||
normalize(_normal),
|
normalize(_normalWS),
|
||||||
opacity,
|
opacity,
|
||||||
albedo * isUnlitEnabled());
|
albedo * isUnlitEnabled());
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,8 +34,6 @@ vec4 evalGlobalColor(float shadowAttenuation, vec3 position, vec3 normal, vec3 a
|
||||||
LightAmbient ambient = getLightAmbient();
|
LightAmbient ambient = getLightAmbient();
|
||||||
|
|
||||||
TransformCamera cam = getTransformCamera();
|
TransformCamera cam = getTransformCamera();
|
||||||
vec3 fragNormal;
|
|
||||||
<$transformEyeToWorldDir(cam, normal, fragNormal)$>
|
|
||||||
vec3 fragEyeVectorView = normalize(-position);
|
vec3 fragEyeVectorView = normalize(-position);
|
||||||
vec3 fragEyeDir;
|
vec3 fragEyeDir;
|
||||||
<$transformEyeToWorldDir(cam, fragEyeVectorView, fragEyeDir)$>
|
<$transformEyeToWorldDir(cam, fragEyeVectorView, fragEyeDir)$>
|
||||||
|
@ -57,8 +55,8 @@ vec4 evalGlobalColor(float shadowAttenuation, vec3 position, vec3 normal, vec3 a
|
||||||
uniform sampler2D originalTexture;
|
uniform sampler2D originalTexture;
|
||||||
|
|
||||||
in vec2 _texCoord0;
|
in vec2 _texCoord0;
|
||||||
in vec4 _position;
|
in vec4 _positionES;
|
||||||
in vec3 _normal;
|
in vec3 _normalWS;
|
||||||
in vec3 _color;
|
in vec3 _color;
|
||||||
in float _alpha;
|
in float _alpha;
|
||||||
|
|
||||||
|
@ -67,8 +65,8 @@ out vec4 _fragColor;
|
||||||
void main(void) {
|
void main(void) {
|
||||||
vec4 albedo = texture(originalTexture, _texCoord0);
|
vec4 albedo = texture(originalTexture, _texCoord0);
|
||||||
|
|
||||||
vec3 fragPosition = _position.xyz;
|
vec3 fragPosition = _positionES.xyz;
|
||||||
vec3 fragNormal = normalize(_normal);
|
vec3 fragNormal = normalize(_normalWS);
|
||||||
vec3 fragAlbedo = albedo.rgb * _color;
|
vec3 fragAlbedo = albedo.rgb * _color;
|
||||||
float fragMetallic = 0.0;
|
float fragMetallic = 0.0;
|
||||||
vec3 fragSpecular = vec3(0.1);
|
vec3 fragSpecular = vec3(0.1);
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
out vec3 _color;
|
out vec3 _color;
|
||||||
out float _alpha;
|
out float _alpha;
|
||||||
out vec2 _texCoord0;
|
out vec2 _texCoord0;
|
||||||
out vec4 _position;
|
out vec4 _positionES;
|
||||||
out vec3 _normal;
|
out vec3 _normalWS;
|
||||||
|
|
||||||
void main(void) {
|
void main(void) {
|
||||||
_color = color_sRGBToLinear(inColor.xyz);
|
_color = color_sRGBToLinear(inColor.xyz);
|
||||||
|
@ -31,6 +31,6 @@ void main(void) {
|
||||||
// standard transform
|
// standard transform
|
||||||
TransformCamera cam = getTransformCamera();
|
TransformCamera cam = getTransformCamera();
|
||||||
TransformObject obj = getTransformObject();
|
TransformObject obj = getTransformObject();
|
||||||
<$transformModelToEyeAndClipPos(cam, obj, inPosition, _position, gl_Position)$>
|
<$transformModelToEyeAndClipPos(cam, obj, inPosition, _positionES, gl_Position)$>
|
||||||
<$transformModelToWorldDir(cam, obj, inNormal.xyz, _normal)$>
|
<$transformModelToWorldDir(cam, obj, inNormal.xyz, _normalWS)$>
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,8 +24,8 @@
|
||||||
|
|
||||||
in vec2 _texCoord0;
|
in vec2 _texCoord0;
|
||||||
in vec2 _texCoord1;
|
in vec2 _texCoord1;
|
||||||
in vec4 _position;
|
in vec4 _positionES;
|
||||||
in vec3 _normal;
|
in vec3 _normalWS;
|
||||||
in vec3 _color;
|
in vec3 _color;
|
||||||
in float _alpha;
|
in float _alpha;
|
||||||
|
|
||||||
|
@ -55,19 +55,16 @@ void main(void) {
|
||||||
<$evalMaterialEmissive(emissiveTex, emissive, matKey, emissive)$>;
|
<$evalMaterialEmissive(emissiveTex, emissive, matKey, emissive)$>;
|
||||||
|
|
||||||
|
|
||||||
vec3 fragPosition = _position.xyz;
|
vec3 fragPosition = _positionES.xyz;
|
||||||
//vec3 fragNormal = normalize(_normal);
|
|
||||||
|
|
||||||
TransformCamera cam = getTransformCamera();
|
TransformCamera cam = getTransformCamera();
|
||||||
vec3 fragNormal;
|
|
||||||
<$transformEyeToWorldDir(cam, _normal, fragNormal)$>;
|
|
||||||
|
|
||||||
vec4 color = vec4(evalSkyboxGlobalColor(
|
vec4 color = vec4(evalSkyboxGlobalColor(
|
||||||
cam._viewInverse,
|
cam._viewInverse,
|
||||||
1.0,
|
1.0,
|
||||||
occlusionTex,
|
occlusionTex,
|
||||||
fragPosition,
|
fragPosition,
|
||||||
fragNormal,
|
normalize(_normalWS),
|
||||||
albedo,
|
albedo,
|
||||||
fresnel,
|
fresnel,
|
||||||
metallic,
|
metallic,
|
||||||
|
|
|
@ -23,10 +23,9 @@
|
||||||
|
|
||||||
in vec2 _texCoord0;
|
in vec2 _texCoord0;
|
||||||
in vec2 _texCoord1;
|
in vec2 _texCoord1;
|
||||||
in vec4 _position;
|
in vec4 _positionES;
|
||||||
in vec3 _normal;
|
in vec3 _normalWS;
|
||||||
in vec3 _color;
|
in vec3 _color;
|
||||||
in float _alpha;
|
|
||||||
|
|
||||||
out vec4 _fragColor;
|
out vec4 _fragColor;
|
||||||
|
|
||||||
|
@ -52,19 +51,15 @@ void main(void) {
|
||||||
vec3 emissive = getMaterialEmissive(mat);
|
vec3 emissive = getMaterialEmissive(mat);
|
||||||
<$evalMaterialEmissive(emissiveTex, emissive, matKey, emissive)$>;
|
<$evalMaterialEmissive(emissiveTex, emissive, matKey, emissive)$>;
|
||||||
|
|
||||||
|
vec3 fragPosition = _positionES.xyz;
|
||||||
vec3 fragPosition = _position.xyz;
|
|
||||||
|
|
||||||
TransformCamera cam = getTransformCamera();
|
TransformCamera cam = getTransformCamera();
|
||||||
vec3 fragNormal;
|
|
||||||
<$transformEyeToWorldDir(cam, _normal, fragNormal)$>
|
|
||||||
|
|
||||||
vec4 color = vec4(evalGlobalLightingAlphaBlendedWithHaze(
|
vec4 color = vec4(evalGlobalLightingAlphaBlendedWithHaze(
|
||||||
cam._viewInverse,
|
cam._viewInverse,
|
||||||
1.0,
|
1.0,
|
||||||
occlusionTex,
|
occlusionTex,
|
||||||
fragPosition,
|
fragPosition,
|
||||||
fragNormal,
|
normalize(_normalWS),
|
||||||
albedo,
|
albedo,
|
||||||
fresnel,
|
fresnel,
|
||||||
metallic,
|
metallic,
|
||||||
|
|
|
@ -18,9 +18,7 @@
|
||||||
<$declareMaterialTextures(ALBEDO)$>
|
<$declareMaterialTextures(ALBEDO)$>
|
||||||
|
|
||||||
in vec2 _texCoord0;
|
in vec2 _texCoord0;
|
||||||
in vec3 _normal;
|
|
||||||
in vec3 _color;
|
in vec3 _color;
|
||||||
in float _alpha;
|
|
||||||
|
|
||||||
out vec4 _fragColor;
|
out vec4 _fragColor;
|
||||||
|
|
||||||
|
|
|
@ -18,9 +18,7 @@
|
||||||
<$declareMaterialTextures(ALBEDO)$>
|
<$declareMaterialTextures(ALBEDO)$>
|
||||||
|
|
||||||
in vec2 _texCoord0;
|
in vec2 _texCoord0;
|
||||||
in vec3 _normal;
|
|
||||||
in vec3 _color;
|
in vec3 _color;
|
||||||
in float _alpha;
|
|
||||||
|
|
||||||
out vec4 _fragColor;
|
out vec4 _fragColor;
|
||||||
|
|
||||||
|
|
|
@ -34,8 +34,6 @@ vec4 evalGlobalColor(float shadowAttenuation, vec3 position, vec3 normal, vec3 a
|
||||||
LightAmbient ambient = getLightAmbient();
|
LightAmbient ambient = getLightAmbient();
|
||||||
|
|
||||||
TransformCamera cam = getTransformCamera();
|
TransformCamera cam = getTransformCamera();
|
||||||
vec3 fragNormal;
|
|
||||||
<$transformEyeToWorldDir(cam, normal, fragNormal)$>
|
|
||||||
vec3 fragEyeVectorView = normalize(-position);
|
vec3 fragEyeVectorView = normalize(-position);
|
||||||
vec3 fragEyeDir;
|
vec3 fragEyeDir;
|
||||||
<$transformEyeToWorldDir(cam, fragEyeVectorView, fragEyeDir)$>
|
<$transformEyeToWorldDir(cam, fragEyeVectorView, fragEyeDir)$>
|
||||||
|
@ -57,8 +55,8 @@ vec4 evalGlobalColor(float shadowAttenuation, vec3 position, vec3 normal, vec3 a
|
||||||
uniform sampler2D originalTexture;
|
uniform sampler2D originalTexture;
|
||||||
|
|
||||||
in vec2 _texCoord0;
|
in vec2 _texCoord0;
|
||||||
in vec4 _position;
|
in vec4 _positionES;
|
||||||
in vec3 _normal;
|
in vec3 _normalWS;
|
||||||
in vec3 _color;
|
in vec3 _color;
|
||||||
in float _alpha;
|
in float _alpha;
|
||||||
|
|
||||||
|
@ -67,8 +65,8 @@ out vec4 _fragColor;
|
||||||
void main(void) {
|
void main(void) {
|
||||||
vec4 albedo = texture(originalTexture, _texCoord0);
|
vec4 albedo = texture(originalTexture, _texCoord0);
|
||||||
|
|
||||||
vec3 fragPosition = _position.xyz;
|
vec3 fragPosition = _positionES.xyz;
|
||||||
vec3 fragNormal = normalize(_normal);
|
vec3 fragNormal = normalize(_normalWS);
|
||||||
vec3 fragAlbedo = albedo.rgb * _color;
|
vec3 fragAlbedo = albedo.rgb * _color;
|
||||||
float fragMetallic = 0.0;
|
float fragMetallic = 0.0;
|
||||||
vec3 fragSpecular = vec3(0.1);
|
vec3 fragSpecular = vec3(0.1);
|
||||||
|
|
|
@ -17,7 +17,7 @@ uniform bool Outline;
|
||||||
uniform vec4 Color;
|
uniform vec4 Color;
|
||||||
|
|
||||||
// the interpolated normal
|
// the interpolated normal
|
||||||
in vec3 _normal;
|
in vec3 _normalWS;
|
||||||
in vec2 _texCoord0;
|
in vec2 _texCoord0;
|
||||||
|
|
||||||
const float gamma = 2.2;
|
const float gamma = 2.2;
|
||||||
|
@ -47,7 +47,7 @@ void main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
packDeferredFragment(
|
packDeferredFragment(
|
||||||
normalize(_normal),
|
normalize(_normalWS),
|
||||||
a * Color.a,
|
a * Color.a,
|
||||||
Color.rgb,
|
Color.rgb,
|
||||||
DEFAULT_ROUGHNESS,
|
DEFAULT_ROUGHNESS,
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
<$declareStandardTransform()$>
|
<$declareStandardTransform()$>
|
||||||
|
|
||||||
// the interpolated normal
|
// the interpolated normal
|
||||||
out vec3 _normal;
|
out vec3 _normalWS;
|
||||||
out vec2 _texCoord0;
|
out vec2 _texCoord0;
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
|
@ -28,5 +28,5 @@ void main() {
|
||||||
TransformObject obj = getTransformObject();
|
TransformObject obj = getTransformObject();
|
||||||
<$transformModelToClipPos(cam, obj, inPosition, gl_Position)$>
|
<$transformModelToClipPos(cam, obj, inPosition, gl_Position)$>
|
||||||
const vec3 normal = vec3(0, 0, 1);
|
const vec3 normal = vec3(0, 0, 1);
|
||||||
<$transformModelToWorldDir(cam, obj, normal, _normal)$>
|
<$transformModelToWorldDir(cam, obj, normal, _normalWS)$>
|
||||||
}
|
}
|
|
@ -17,7 +17,7 @@ uniform bool Outline;
|
||||||
uniform vec4 Color;
|
uniform vec4 Color;
|
||||||
|
|
||||||
// the interpolated normal
|
// the interpolated normal
|
||||||
in vec3 _normal;
|
in vec3 _normalWS;
|
||||||
in vec2 _texCoord0;
|
in vec2 _texCoord0;
|
||||||
|
|
||||||
const float gamma = 2.2;
|
const float gamma = 2.2;
|
||||||
|
@ -47,7 +47,7 @@ void main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
packDeferredFragmentTranslucent(
|
packDeferredFragmentTranslucent(
|
||||||
normalize(_normal),
|
normalize(_normalWS),
|
||||||
a * Color.a,
|
a * Color.a,
|
||||||
Color.rgb,
|
Color.rgb,
|
||||||
DEFAULT_FRESNEL,
|
DEFAULT_FRESNEL,
|
||||||
|
|
|
@ -15,11 +15,8 @@
|
||||||
<@include DeferredBufferWrite.slh@>
|
<@include DeferredBufferWrite.slh@>
|
||||||
|
|
||||||
// the interpolated normal
|
// the interpolated normal
|
||||||
in vec3 _normal;
|
in vec3 _normalWS;
|
||||||
in vec3 _modelNormal;
|
|
||||||
in vec4 _color;
|
in vec4 _color;
|
||||||
in vec2 _texCoord0;
|
|
||||||
in vec4 _position;
|
|
||||||
|
|
||||||
//PROCEDURAL_COMMON_BLOCK
|
//PROCEDURAL_COMMON_BLOCK
|
||||||
|
|
||||||
|
@ -28,7 +25,7 @@ in vec4 _position;
|
||||||
|
|
||||||
#line 2030
|
#line 2030
|
||||||
void main(void) {
|
void main(void) {
|
||||||
vec3 normal = normalize(_normal.xyz);
|
vec3 normal = normalize(_normalWS.xyz);
|
||||||
vec3 diffuse = _color.rgb;
|
vec3 diffuse = _color.rgb;
|
||||||
vec3 specular = DEFAULT_SPECULAR;
|
vec3 specular = DEFAULT_SPECULAR;
|
||||||
float shininess = DEFAULT_SHININESS;
|
float shininess = DEFAULT_SHININESS;
|
||||||
|
|
|
@ -18,22 +18,22 @@
|
||||||
<$declareStandardTransform()$>
|
<$declareStandardTransform()$>
|
||||||
|
|
||||||
// the interpolated normal
|
// the interpolated normal
|
||||||
out vec3 _normal;
|
out vec3 _normalWS;
|
||||||
out vec3 _modelNormal;
|
out vec3 _normalMS;
|
||||||
out vec4 _color;
|
out vec4 _color;
|
||||||
out vec2 _texCoord0;
|
out vec2 _texCoord0;
|
||||||
out vec4 _position;
|
out vec4 _positionMS;
|
||||||
out vec4 _eyePosition;
|
out vec4 _positionES;
|
||||||
|
|
||||||
void main(void) {
|
void main(void) {
|
||||||
_color = color_sRGBAToLinear(inColor);
|
_color = color_sRGBAToLinear(inColor);
|
||||||
_texCoord0 = inTexCoord0.st;
|
_texCoord0 = inTexCoord0.st;
|
||||||
_position = inPosition;
|
_positionMS = inPosition;
|
||||||
_modelNormal = inNormal.xyz;
|
_normalMS = inNormal.xyz;
|
||||||
|
|
||||||
// standard transform
|
// standard transform
|
||||||
TransformCamera cam = getTransformCamera();
|
TransformCamera cam = getTransformCamera();
|
||||||
TransformObject obj = getTransformObject();
|
TransformObject obj = getTransformObject();
|
||||||
<$transformModelToEyeAndClipPos(cam, obj, inPosition, _eyePosition, gl_Position)$>
|
<$transformModelToEyeAndClipPos(cam, obj, inPosition, _positionES, gl_Position)$>
|
||||||
<$transformModelToWorldDir(cam, obj, inNormal.xyz, _normal)$>
|
<$transformModelToWorldDir(cam, obj, inNormal.xyz, _normalWS)$>
|
||||||
}
|
}
|
|
@ -18,12 +18,9 @@
|
||||||
<$declareFadeFragmentInstanced()$>
|
<$declareFadeFragmentInstanced()$>
|
||||||
|
|
||||||
// the interpolated normal
|
// the interpolated normal
|
||||||
in vec3 _normal;
|
in vec3 _normalWS;
|
||||||
in vec3 _modelNormal;
|
|
||||||
in vec4 _color;
|
in vec4 _color;
|
||||||
in vec2 _texCoord0;
|
in vec4 _positionWS;
|
||||||
in vec4 _position;
|
|
||||||
in vec4 _worldPosition;
|
|
||||||
|
|
||||||
//PROCEDURAL_COMMON_BLOCK
|
//PROCEDURAL_COMMON_BLOCK
|
||||||
|
|
||||||
|
@ -36,9 +33,9 @@ void main(void) {
|
||||||
FadeObjectParams fadeParams;
|
FadeObjectParams fadeParams;
|
||||||
|
|
||||||
<$fetchFadeObjectParamsInstanced(fadeParams)$>
|
<$fetchFadeObjectParamsInstanced(fadeParams)$>
|
||||||
applyFade(fadeParams, _worldPosition.xyz, fadeEmissive);
|
applyFade(fadeParams, _positionWS.xyz, fadeEmissive);
|
||||||
|
|
||||||
vec3 normal = normalize(_normal.xyz);
|
vec3 normal = normalize(_normalWS.xyz);
|
||||||
vec3 diffuse = _color.rgb;
|
vec3 diffuse = _color.rgb;
|
||||||
vec3 specular = DEFAULT_SPECULAR;
|
vec3 specular = DEFAULT_SPECULAR;
|
||||||
float shininess = DEFAULT_SHININESS;
|
float shininess = DEFAULT_SHININESS;
|
||||||
|
|
|
@ -21,25 +21,25 @@
|
||||||
<$declareFadeVertexInstanced()$>
|
<$declareFadeVertexInstanced()$>
|
||||||
|
|
||||||
// the interpolated normal
|
// the interpolated normal
|
||||||
out vec3 _normal;
|
out vec3 _normalWS;
|
||||||
out vec3 _modelNormal;
|
out vec3 _normalMS;
|
||||||
out vec4 _color;
|
out vec4 _color;
|
||||||
out vec2 _texCoord0;
|
out vec2 _texCoord0;
|
||||||
out vec4 _position;
|
out vec4 _positionMS;
|
||||||
out vec4 _eyePosition;
|
out vec4 _positionES;
|
||||||
out vec4 _worldPosition;
|
out vec4 _positionWS;
|
||||||
|
|
||||||
void main(void) {
|
void main(void) {
|
||||||
_color = color_sRGBAToLinear(inColor);
|
_color = color_sRGBAToLinear(inColor);
|
||||||
_texCoord0 = inTexCoord0.st;
|
_texCoord0 = inTexCoord0.st;
|
||||||
_position = inPosition;
|
_positionMS = inPosition;
|
||||||
_modelNormal = inNormal.xyz;
|
_normalMS = inNormal.xyz;
|
||||||
|
|
||||||
// standard transform
|
// standard transform
|
||||||
TransformCamera cam = getTransformCamera();
|
TransformCamera cam = getTransformCamera();
|
||||||
TransformObject obj = getTransformObject();
|
TransformObject obj = getTransformObject();
|
||||||
<$transformModelToEyeAndClipPos(cam, obj, inPosition, _eyePosition, gl_Position)$>
|
<$transformModelToEyeAndClipPos(cam, obj, inPosition, _positionES, gl_Position)$>
|
||||||
<$transformModelToWorldPos(obj, inPosition, _worldPosition)$>
|
<$transformModelToWorldPos(obj, inPosition, _positionWS)$>
|
||||||
<$transformModelToWorldDir(cam, obj, inNormal.xyz, _normal)$>
|
<$transformModelToWorldDir(cam, obj, inNormal.xyz, _normalWS)$>
|
||||||
<$passThroughFadeObjectParams()$>
|
<$passThroughFadeObjectParams()$>
|
||||||
}
|
}
|
|
@ -19,12 +19,12 @@
|
||||||
uniform sampler2D originalTexture;
|
uniform sampler2D originalTexture;
|
||||||
|
|
||||||
// the interpolated normal
|
// the interpolated normal
|
||||||
in vec3 _normal;
|
in vec3 _normalWS;
|
||||||
in vec4 _color;
|
in vec4 _color;
|
||||||
in vec2 _texCoord0;
|
in vec2 _texCoord0;
|
||||||
|
|
||||||
void main(void) {
|
void main(void) {
|
||||||
vec4 texel = texture(originalTexture, _texCoord0.st);
|
vec4 texel = texture(originalTexture, _texCoord0.st);
|
||||||
texel = color_sRGBAToLinear(texel);
|
texel = color_sRGBAToLinear(texel);
|
||||||
packDeferredFragmentUnlit(normalize(_normal), 1.0, _color.rgb * texel.rgb);
|
packDeferredFragmentUnlit(normalize(_normalWS), 1.0, _color.rgb * texel.rgb);
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
uniform sampler2D originalTexture;
|
uniform sampler2D originalTexture;
|
||||||
|
|
||||||
// the interpolated normal
|
// the interpolated normal
|
||||||
in vec3 _normal;
|
in vec3 _normalWS;
|
||||||
in vec4 _color;
|
in vec4 _color;
|
||||||
in vec2 _texCoord0;
|
in vec2 _texCoord0;
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ void main(void) {
|
||||||
vec4 texel = texture(originalTexture, _texCoord0);
|
vec4 texel = texture(originalTexture, _texCoord0);
|
||||||
|
|
||||||
packDeferredFragment(
|
packDeferredFragment(
|
||||||
normalize(_normal),
|
normalize(_normalWS),
|
||||||
1.0,
|
1.0,
|
||||||
_color.rgb * texel.rgb,
|
_color.rgb * texel.rgb,
|
||||||
DEFAULT_ROUGHNESS,
|
DEFAULT_ROUGHNESS,
|
||||||
|
|
|
@ -21,10 +21,10 @@
|
||||||
uniform sampler2D originalTexture;
|
uniform sampler2D originalTexture;
|
||||||
|
|
||||||
// the interpolated normal
|
// the interpolated normal
|
||||||
in vec3 _normal;
|
in vec3 _normalWS;
|
||||||
in vec4 _color;
|
in vec4 _color;
|
||||||
in vec2 _texCoord0;
|
in vec2 _texCoord0;
|
||||||
in vec4 _worldPosition;
|
in vec4 _positionWS;
|
||||||
|
|
||||||
// Declare after all samplers to prevent sampler location mix up with originalTexture
|
// Declare after all samplers to prevent sampler location mix up with originalTexture
|
||||||
<$declareFadeFragmentInstanced()$>
|
<$declareFadeFragmentInstanced()$>
|
||||||
|
@ -34,7 +34,7 @@ void main(void) {
|
||||||
FadeObjectParams fadeParams;
|
FadeObjectParams fadeParams;
|
||||||
|
|
||||||
<$fetchFadeObjectParamsInstanced(fadeParams)$>
|
<$fetchFadeObjectParamsInstanced(fadeParams)$>
|
||||||
applyFade(fadeParams, _worldPosition.xyz, fadeEmissive);
|
applyFade(fadeParams, _positionWS.xyz, fadeEmissive);
|
||||||
|
|
||||||
vec4 texel = texture(originalTexture, _texCoord0);
|
vec4 texel = texture(originalTexture, _texCoord0);
|
||||||
float colorAlpha = _color.a;
|
float colorAlpha = _color.a;
|
||||||
|
@ -46,14 +46,14 @@ void main(void) {
|
||||||
const float ALPHA_THRESHOLD = 0.999;
|
const float ALPHA_THRESHOLD = 0.999;
|
||||||
if (colorAlpha * texel.a < ALPHA_THRESHOLD) {
|
if (colorAlpha * texel.a < ALPHA_THRESHOLD) {
|
||||||
packDeferredFragmentTranslucent(
|
packDeferredFragmentTranslucent(
|
||||||
normalize(_normal),
|
normalize(_normalWS),
|
||||||
colorAlpha * texel.a,
|
colorAlpha * texel.a,
|
||||||
_color.rgb * texel.rgb + fadeEmissive,
|
_color.rgb * texel.rgb + fadeEmissive,
|
||||||
DEFAULT_FRESNEL,
|
DEFAULT_FRESNEL,
|
||||||
DEFAULT_ROUGHNESS);
|
DEFAULT_ROUGHNESS);
|
||||||
} else {
|
} else {
|
||||||
packDeferredFragment(
|
packDeferredFragment(
|
||||||
normalize(_normal),
|
normalize(_normalWS),
|
||||||
1.0,
|
1.0,
|
||||||
_color.rgb * texel.rgb,
|
_color.rgb * texel.rgb,
|
||||||
DEFAULT_ROUGHNESS,
|
DEFAULT_ROUGHNESS,
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
uniform sampler2D originalTexture;
|
uniform sampler2D originalTexture;
|
||||||
|
|
||||||
// the interpolated normal
|
// the interpolated normal
|
||||||
in vec3 _normal;
|
in vec3 _normalWS;
|
||||||
in vec4 _color;
|
in vec4 _color;
|
||||||
in vec2 _texCoord0;
|
in vec2 _texCoord0;
|
||||||
|
|
||||||
|
@ -34,14 +34,14 @@ void main(void) {
|
||||||
const float ALPHA_THRESHOLD = 0.999;
|
const float ALPHA_THRESHOLD = 0.999;
|
||||||
if (colorAlpha * texel.a < ALPHA_THRESHOLD) {
|
if (colorAlpha * texel.a < ALPHA_THRESHOLD) {
|
||||||
packDeferredFragmentTranslucent(
|
packDeferredFragmentTranslucent(
|
||||||
normalize(_normal),
|
normalize(_normalWS),
|
||||||
colorAlpha * texel.a,
|
colorAlpha * texel.a,
|
||||||
_color.rgb * texel.rgb,
|
_color.rgb * texel.rgb,
|
||||||
DEFAULT_FRESNEL,
|
DEFAULT_FRESNEL,
|
||||||
DEFAULT_ROUGHNESS);
|
DEFAULT_ROUGHNESS);
|
||||||
} else {
|
} else {
|
||||||
packDeferredFragmentUnlit(
|
packDeferredFragmentUnlit(
|
||||||
normalize(_normal),
|
normalize(_normalWS),
|
||||||
1.0,
|
1.0,
|
||||||
_color.rgb * texel.rgb);
|
_color.rgb * texel.rgb);
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,10 +21,10 @@
|
||||||
uniform sampler2D originalTexture;
|
uniform sampler2D originalTexture;
|
||||||
|
|
||||||
// the interpolated normal
|
// the interpolated normal
|
||||||
in vec3 _normal;
|
in vec3 _normalWS;
|
||||||
in vec4 _color;
|
in vec4 _color;
|
||||||
in vec2 _texCoord0;
|
in vec2 _texCoord0;
|
||||||
in vec4 _worldPosition;
|
in vec4 _positionWS;
|
||||||
|
|
||||||
// Declare after all samplers to prevent sampler location mix up with originalTexture
|
// Declare after all samplers to prevent sampler location mix up with originalTexture
|
||||||
<$declareFadeFragmentInstanced()$>
|
<$declareFadeFragmentInstanced()$>
|
||||||
|
@ -34,7 +34,7 @@ void main(void) {
|
||||||
FadeObjectParams fadeParams;
|
FadeObjectParams fadeParams;
|
||||||
|
|
||||||
<$fetchFadeObjectParamsInstanced(fadeParams)$>
|
<$fetchFadeObjectParamsInstanced(fadeParams)$>
|
||||||
applyFade(fadeParams, _worldPosition.xyz, fadeEmissive);
|
applyFade(fadeParams, _positionWS.xyz, fadeEmissive);
|
||||||
|
|
||||||
vec4 texel = texture(originalTexture, _texCoord0.st);
|
vec4 texel = texture(originalTexture, _texCoord0.st);
|
||||||
float colorAlpha = _color.a;
|
float colorAlpha = _color.a;
|
||||||
|
@ -46,14 +46,14 @@ void main(void) {
|
||||||
const float ALPHA_THRESHOLD = 0.999;
|
const float ALPHA_THRESHOLD = 0.999;
|
||||||
if (colorAlpha * texel.a < ALPHA_THRESHOLD) {
|
if (colorAlpha * texel.a < ALPHA_THRESHOLD) {
|
||||||
packDeferredFragmentTranslucent(
|
packDeferredFragmentTranslucent(
|
||||||
normalize(_normal),
|
normalize(_normalWS),
|
||||||
colorAlpha * texel.a,
|
colorAlpha * texel.a,
|
||||||
_color.rgb * texel.rgb+fadeEmissive,
|
_color.rgb * texel.rgb+fadeEmissive,
|
||||||
DEFAULT_FRESNEL,
|
DEFAULT_FRESNEL,
|
||||||
DEFAULT_ROUGHNESS);
|
DEFAULT_ROUGHNESS);
|
||||||
} else {
|
} else {
|
||||||
packDeferredFragmentUnlit(
|
packDeferredFragmentUnlit(
|
||||||
normalize(_normal),
|
normalize(_normalWS),
|
||||||
1.0,
|
1.0,
|
||||||
_color.rgb * texel.rgb+fadeEmissive);
|
_color.rgb * texel.rgb+fadeEmissive);
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,11 +15,8 @@
|
||||||
<@include DeferredBufferWrite.slh@>
|
<@include DeferredBufferWrite.slh@>
|
||||||
|
|
||||||
// the interpolated normal
|
// the interpolated normal
|
||||||
in vec3 _normal;
|
in vec3 _normalWS;
|
||||||
in vec3 _modelNormal;
|
|
||||||
in vec4 _color;
|
in vec4 _color;
|
||||||
in vec2 _texCoord0;
|
|
||||||
in vec4 _position;
|
|
||||||
|
|
||||||
//PROCEDURAL_COMMON_BLOCK
|
//PROCEDURAL_COMMON_BLOCK
|
||||||
|
|
||||||
|
@ -28,7 +25,7 @@ in vec4 _position;
|
||||||
|
|
||||||
#line 2030
|
#line 2030
|
||||||
void main(void) {
|
void main(void) {
|
||||||
vec3 normal = normalize(_normal.xyz);
|
vec3 normal = normalize(_normalWS.xyz);
|
||||||
vec3 diffuse = _color.rgb;
|
vec3 diffuse = _color.rgb;
|
||||||
vec3 specular = DEFAULT_SPECULAR;
|
vec3 specular = DEFAULT_SPECULAR;
|
||||||
float shininess = DEFAULT_SHININESS;
|
float shininess = DEFAULT_SHININESS;
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
uniform sampler2D originalTexture;
|
uniform sampler2D originalTexture;
|
||||||
|
|
||||||
// the interpolated normal
|
// the interpolated normal
|
||||||
in vec3 _normal;
|
in vec3 _normalWS;
|
||||||
in vec4 _color;
|
in vec4 _color;
|
||||||
in vec2 _texCoord0;
|
in vec2 _texCoord0;
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ void main(void) {
|
||||||
float colorAlpha = _color.a * texel.a;
|
float colorAlpha = _color.a * texel.a;
|
||||||
|
|
||||||
packDeferredFragmentTranslucent(
|
packDeferredFragmentTranslucent(
|
||||||
normalize(_normal),
|
normalize(_normalWS),
|
||||||
colorAlpha,
|
colorAlpha,
|
||||||
_color.rgb * texel.rgb,
|
_color.rgb * texel.rgb,
|
||||||
DEFAULT_FRESNEL,
|
DEFAULT_FRESNEL,
|
||||||
|
|
|
@ -26,12 +26,11 @@
|
||||||
// the albedo texture
|
// the albedo texture
|
||||||
uniform sampler2D originalTexture;
|
uniform sampler2D originalTexture;
|
||||||
|
|
||||||
// the interpolated normal
|
in vec4 _positionES;
|
||||||
in vec4 _position;
|
in vec3 _normalWS;
|
||||||
in vec3 _normal;
|
|
||||||
in vec4 _color;
|
in vec4 _color;
|
||||||
in vec2 _texCoord0;
|
in vec2 _texCoord0;
|
||||||
in vec4 _worldPosition;
|
in vec4 _positionWS;
|
||||||
|
|
||||||
// Declare after all samplers to prevent sampler location mix up with originalTexture
|
// Declare after all samplers to prevent sampler location mix up with originalTexture
|
||||||
<$declareFadeFragmentInstanced()$>
|
<$declareFadeFragmentInstanced()$>
|
||||||
|
@ -41,7 +40,7 @@ void main(void) {
|
||||||
FadeObjectParams fadeParams;
|
FadeObjectParams fadeParams;
|
||||||
|
|
||||||
<$fetchFadeObjectParamsInstanced(fadeParams)$>
|
<$fetchFadeObjectParamsInstanced(fadeParams)$>
|
||||||
applyFade(fadeParams, _worldPosition.xyz, fadeEmissive);
|
applyFade(fadeParams, _positionWS.xyz, fadeEmissive);
|
||||||
|
|
||||||
vec4 texel = texture(originalTexture, _texCoord0.st);
|
vec4 texel = texture(originalTexture, _texCoord0.st);
|
||||||
float opacity = _color.a;
|
float opacity = _color.a;
|
||||||
|
@ -52,8 +51,8 @@ void main(void) {
|
||||||
opacity *= texel.a;
|
opacity *= texel.a;
|
||||||
vec3 albedo = _color.rgb * texel.rgb;
|
vec3 albedo = _color.rgb * texel.rgb;
|
||||||
|
|
||||||
vec3 fragPosition = _position.xyz;
|
vec3 fragPosition = _positionES.xyz;
|
||||||
vec3 fragNormal = normalize(_normal);
|
vec3 fragNormal = normalize(_normalWS);
|
||||||
|
|
||||||
TransformCamera cam = getTransformCamera();
|
TransformCamera cam = getTransformCamera();
|
||||||
|
|
||||||
|
|
|
@ -17,12 +17,9 @@
|
||||||
// the albedo texture
|
// the albedo texture
|
||||||
uniform sampler2D originalTexture;
|
uniform sampler2D originalTexture;
|
||||||
|
|
||||||
// the interpolated normal
|
|
||||||
in vec3 _normal;
|
|
||||||
in vec4 _color;
|
in vec4 _color;
|
||||||
in vec2 _texCoord0;
|
in vec2 _texCoord0;
|
||||||
|
|
||||||
|
|
||||||
layout(location = 0) out vec4 _fragColor0;
|
layout(location = 0) out vec4 _fragColor0;
|
||||||
|
|
||||||
void main(void) {
|
void main(void) {
|
||||||
|
|
|
@ -19,11 +19,9 @@
|
||||||
// the albedo texture
|
// the albedo texture
|
||||||
uniform sampler2D originalTexture;
|
uniform sampler2D originalTexture;
|
||||||
|
|
||||||
// the interpolated normal
|
|
||||||
in vec3 _normal;
|
|
||||||
in vec4 _color;
|
in vec4 _color;
|
||||||
in vec2 _texCoord0;
|
in vec2 _texCoord0;
|
||||||
in vec4 _worldPosition;
|
in vec4 _positionWS;
|
||||||
|
|
||||||
layout(location = 0) out vec4 _fragColor0;
|
layout(location = 0) out vec4 _fragColor0;
|
||||||
|
|
||||||
|
@ -35,7 +33,7 @@ void main(void) {
|
||||||
FadeObjectParams fadeParams;
|
FadeObjectParams fadeParams;
|
||||||
|
|
||||||
<$fetchFadeObjectParamsInstanced(fadeParams)$>
|
<$fetchFadeObjectParamsInstanced(fadeParams)$>
|
||||||
applyFade(fadeParams, _worldPosition.xyz, fadeEmissive);
|
applyFade(fadeParams, _positionWS.xyz, fadeEmissive);
|
||||||
|
|
||||||
vec4 texel = texture(originalTexture, _texCoord0.st);
|
vec4 texel = texture(originalTexture, _texCoord0.st);
|
||||||
float colorAlpha = _color.a;
|
float colorAlpha = _color.a;
|
||||||
|
@ -43,5 +41,5 @@ void main(void) {
|
||||||
texel = color_sRGBAToLinear(texel);
|
texel = color_sRGBAToLinear(texel);
|
||||||
colorAlpha = -_color.a;
|
colorAlpha = -_color.a;
|
||||||
}
|
}
|
||||||
_fragColor0 = vec4(_color.rgb * texel.rgb+fadeEmissive, colorAlpha * texel.a);
|
_fragColor0 = vec4(_color.rgb * texel.rgb + fadeEmissive, colorAlpha * texel.a);
|
||||||
}
|
}
|
|
@ -19,7 +19,7 @@
|
||||||
uniform sampler2D originalTexture;
|
uniform sampler2D originalTexture;
|
||||||
|
|
||||||
// the interpolated normal
|
// the interpolated normal
|
||||||
in vec3 _normal;
|
in vec3 _normalWS;
|
||||||
in vec4 _color;
|
in vec4 _color;
|
||||||
in vec2 _texCoord0;
|
in vec2 _texCoord0;
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ void main(void) {
|
||||||
vec4 texel = texture(originalTexture, _texCoord0.st);
|
vec4 texel = texture(originalTexture, _texCoord0.st);
|
||||||
texel = color_sRGBAToLinear(texel);
|
texel = color_sRGBAToLinear(texel);
|
||||||
packDeferredFragmentTranslucent(
|
packDeferredFragmentTranslucent(
|
||||||
normalize(_normal),
|
normalize(_normalWS),
|
||||||
_color.a,
|
_color.a,
|
||||||
_color.rgb * texel.rgb,
|
_color.rgb * texel.rgb,
|
||||||
DEFAULT_FRESNEL,
|
DEFAULT_FRESNEL,
|
||||||
|
|
|
@ -23,10 +23,10 @@
|
||||||
<@include MaterialTextures.slh@>
|
<@include MaterialTextures.slh@>
|
||||||
<$declareMaterialTexMapArrayBuffer()$>
|
<$declareMaterialTexMapArrayBuffer()$>
|
||||||
|
|
||||||
out vec4 _position;
|
out vec4 _positionES;
|
||||||
out vec2 _texCoord0;
|
out vec2 _texCoord0;
|
||||||
out vec2 _texCoord1;
|
out vec2 _texCoord1;
|
||||||
out vec3 _normal;
|
out vec3 _normalWS;
|
||||||
out vec3 _color;
|
out vec3 _color;
|
||||||
out float _alpha;
|
out float _alpha;
|
||||||
|
|
||||||
|
@ -47,6 +47,6 @@ void main(void) {
|
||||||
// standard transform
|
// standard transform
|
||||||
TransformCamera cam = getTransformCamera();
|
TransformCamera cam = getTransformCamera();
|
||||||
TransformObject obj = getTransformObject();
|
TransformObject obj = getTransformObject();
|
||||||
<$transformModelToEyeAndClipPos(cam, obj, position, _position, gl_Position)$>
|
<$transformModelToEyeAndClipPos(cam, obj, position, _positionES, gl_Position)$>
|
||||||
<$transformModelToWorldDir(cam, obj, interpolatedNormal.xyz, _normal.xyz)$>
|
<$transformModelToWorldDir(cam, obj, interpolatedNormal.xyz, _normalWS.xyz)$>
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,10 +23,10 @@
|
||||||
<@include MaterialTextures.slh@>
|
<@include MaterialTextures.slh@>
|
||||||
<$declareMaterialTexMapArrayBuffer()$>
|
<$declareMaterialTexMapArrayBuffer()$>
|
||||||
|
|
||||||
out vec4 _position;
|
out vec4 _positionES;
|
||||||
out vec2 _texCoord0;
|
out vec2 _texCoord0;
|
||||||
out vec2 _texCoord1;
|
out vec2 _texCoord1;
|
||||||
out vec3 _normal;
|
out vec3 _normalWS;
|
||||||
out vec3 _color;
|
out vec3 _color;
|
||||||
out float _alpha;
|
out float _alpha;
|
||||||
|
|
||||||
|
@ -47,6 +47,6 @@ void main(void) {
|
||||||
// standard transform
|
// standard transform
|
||||||
TransformCamera cam = getTransformCamera();
|
TransformCamera cam = getTransformCamera();
|
||||||
TransformObject obj = getTransformObject();
|
TransformObject obj = getTransformObject();
|
||||||
<$transformModelToEyeAndClipPos(cam, obj, position, _position, gl_Position)$>
|
<$transformModelToEyeAndClipPos(cam, obj, position, _positionES, gl_Position)$>
|
||||||
<$transformModelToWorldDir(cam, obj, interpolatedNormal.xyz, _normal.xyz)$>
|
<$transformModelToWorldDir(cam, obj, interpolatedNormal.xyz, _normalWS.xyz)$>
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
<@include Fade.slh@>
|
<@include Fade.slh@>
|
||||||
<$declareFadeFragment()$>
|
<$declareFadeFragment()$>
|
||||||
|
|
||||||
in vec4 _worldPosition;
|
in vec4 _positionWS;
|
||||||
|
|
||||||
layout(location = 0) out vec4 _fragColor;
|
layout(location = 0) out vec4 _fragColor;
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ void main(void) {
|
||||||
FadeObjectParams fadeParams;
|
FadeObjectParams fadeParams;
|
||||||
|
|
||||||
<$fetchFadeObjectParams(fadeParams)$>
|
<$fetchFadeObjectParams(fadeParams)$>
|
||||||
applyFadeClip(fadeParams, _worldPosition.xyz);
|
applyFadeClip(fadeParams, _positionWS.xyz);
|
||||||
|
|
||||||
// pass-through to set z-buffer
|
// pass-through to set z-buffer
|
||||||
_fragColor = vec4(1.0, 1.0, 1.0, 0.0);
|
_fragColor = vec4(1.0, 1.0, 1.0, 0.0);
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
<@include Skinning.slh@>
|
<@include Skinning.slh@>
|
||||||
<$declareUseDualQuaternionSkinning()$>
|
<$declareUseDualQuaternionSkinning()$>
|
||||||
|
|
||||||
out vec4 _worldPosition;
|
out vec4 _positionWS;
|
||||||
|
|
||||||
void main(void) {
|
void main(void) {
|
||||||
vec4 position = vec4(0.0, 0.0, 0.0, 0.0);
|
vec4 position = vec4(0.0, 0.0, 0.0, 0.0);
|
||||||
|
@ -29,5 +29,5 @@ void main(void) {
|
||||||
TransformCamera cam = getTransformCamera();
|
TransformCamera cam = getTransformCamera();
|
||||||
TransformObject obj = getTransformObject();
|
TransformObject obj = getTransformObject();
|
||||||
<$transformModelToClipPos(cam, obj, position, gl_Position)$>
|
<$transformModelToClipPos(cam, obj, position, gl_Position)$>
|
||||||
<$transformModelToWorldPos(obj, position, _worldPosition)$>
|
<$transformModelToWorldPos(obj, position, _positionWS)$>
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
<@include Skinning.slh@>
|
<@include Skinning.slh@>
|
||||||
<$declareUseDualQuaternionSkinning(1)$>
|
<$declareUseDualQuaternionSkinning(1)$>
|
||||||
|
|
||||||
out vec4 _worldPosition;
|
out vec4 _positionWS;
|
||||||
|
|
||||||
void main(void) {
|
void main(void) {
|
||||||
vec4 position = vec4(0.0, 0.0, 0.0, 0.0);
|
vec4 position = vec4(0.0, 0.0, 0.0, 0.0);
|
||||||
|
@ -29,5 +29,5 @@ void main(void) {
|
||||||
TransformCamera cam = getTransformCamera();
|
TransformCamera cam = getTransformCamera();
|
||||||
TransformObject obj = getTransformObject();
|
TransformObject obj = getTransformObject();
|
||||||
<$transformModelToClipPos(cam, obj, position, gl_Position)$>
|
<$transformModelToClipPos(cam, obj, position, gl_Position)$>
|
||||||
<$transformModelToWorldPos(obj, position, _worldPosition)$>
|
<$transformModelToWorldPos(obj, position, _positionWS)$>
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue