mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 20:56:52 +02:00
Merge pull request #13529 from Zvork/transparent
Fix number of rendering issues with some transparent objects on Mac and AMD GPUs
This commit is contained in:
commit
c7c1cdd8c3
14 changed files with 51 additions and 33 deletions
|
@ -48,12 +48,12 @@ void GLBackend::do_setPipeline(const Batch& batch, size_t paramOffset) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// check the program cache
|
// check the program cache
|
||||||
// pick the program version
|
// pick the program version
|
||||||
// check the program cache
|
// check the program cache
|
||||||
// pick the program version
|
// pick the program version
|
||||||
#ifdef GPU_STEREO_CAMERA_BUFFER
|
#ifdef GPU_STEREO_CAMERA_BUFFER
|
||||||
GLuint glprogram = pipelineObject->_program->getProgram((GLShader::Version) isStereo());
|
GLuint glprogram = pipelineObject->_program->getProgram((GLShader::Version)isStereo());
|
||||||
#else
|
#else
|
||||||
GLuint glprogram = pipelineObject->_program->getProgram();
|
GLuint glprogram = pipelineObject->_program->getProgram();
|
||||||
#endif
|
#endif
|
||||||
|
@ -85,10 +85,11 @@ void GLBackend::do_setPipeline(const Batch& batch, size_t paramOffset) {
|
||||||
} else {
|
} else {
|
||||||
cameraCorrectionBuffer = syncGPUObject(*_pipeline._cameraCorrectionBufferIdentity._buffer);
|
cameraCorrectionBuffer = syncGPUObject(*_pipeline._cameraCorrectionBufferIdentity._buffer);
|
||||||
}
|
}
|
||||||
|
// Invalidate uniform buffer cache slot
|
||||||
|
_uniform._buffers[_pipeline._cameraCorrectionLocation].reset();
|
||||||
glBindBufferRange(GL_UNIFORM_BUFFER, _pipeline._cameraCorrectionLocation, cameraCorrectionBuffer->_id, 0, sizeof(CameraCorrection));
|
glBindBufferRange(GL_UNIFORM_BUFFER, _pipeline._cameraCorrectionLocation, cameraCorrectionBuffer->_id, 0, sizeof(CameraCorrection));
|
||||||
|
|
||||||
}
|
}
|
||||||
(void) CHECK_GL_ERROR();
|
(void)CHECK_GL_ERROR();
|
||||||
_pipeline._invalidProgram = false;
|
_pipeline._invalidProgram = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -97,7 +98,7 @@ void GLBackend::updatePipeline() {
|
||||||
if (_pipeline._invalidProgram) {
|
if (_pipeline._invalidProgram) {
|
||||||
// doing it here is aproblem for calls to glUniform.... so will do it on assing...
|
// doing it here is aproblem for calls to glUniform.... so will do it on assing...
|
||||||
glUseProgram(_pipeline._program);
|
glUseProgram(_pipeline._program);
|
||||||
(void) CHECK_GL_ERROR();
|
(void)CHECK_GL_ERROR();
|
||||||
_pipeline._invalidProgram = false;
|
_pipeline._invalidProgram = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -106,12 +107,12 @@ void GLBackend::updatePipeline() {
|
||||||
// first reset to default what should be
|
// first reset to default what should be
|
||||||
// the fields which were not to default and are default now
|
// the fields which were not to default and are default now
|
||||||
resetPipelineState(_pipeline._state->_signature);
|
resetPipelineState(_pipeline._state->_signature);
|
||||||
|
|
||||||
// Update the signature cache with what's going to be touched
|
// Update the signature cache with what's going to be touched
|
||||||
_pipeline._stateSignatureCache |= _pipeline._state->_signature;
|
_pipeline._stateSignatureCache |= _pipeline._state->_signature;
|
||||||
|
|
||||||
// And perform
|
// And perform
|
||||||
for (auto command: _pipeline._state->_commands) {
|
for (auto command : _pipeline._state->_commands) {
|
||||||
command->run(this);
|
command->run(this);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -142,8 +143,8 @@ void GLBackend::releaseUniformBuffer(uint32_t slot) {
|
||||||
if (buf) {
|
if (buf) {
|
||||||
auto* object = Backend::getGPUObject<GLBuffer>(*buf);
|
auto* object = Backend::getGPUObject<GLBuffer>(*buf);
|
||||||
if (object) {
|
if (object) {
|
||||||
glBindBufferBase(GL_UNIFORM_BUFFER, slot, 0); // RELEASE
|
glBindBufferBase(GL_UNIFORM_BUFFER, slot, 0); // RELEASE
|
||||||
(void) CHECK_GL_ERROR();
|
(void)CHECK_GL_ERROR();
|
||||||
}
|
}
|
||||||
buf.reset();
|
buf.reset();
|
||||||
}
|
}
|
||||||
|
@ -157,8 +158,9 @@ void GLBackend::resetUniformStage() {
|
||||||
|
|
||||||
void GLBackend::do_setUniformBuffer(const Batch& batch, size_t paramOffset) {
|
void GLBackend::do_setUniformBuffer(const Batch& batch, size_t paramOffset) {
|
||||||
GLuint slot = batch._params[paramOffset + 3]._uint;
|
GLuint slot = batch._params[paramOffset + 3]._uint;
|
||||||
if (slot >(GLuint)MAX_NUM_UNIFORM_BUFFERS) {
|
if (slot > (GLuint)MAX_NUM_UNIFORM_BUFFERS) {
|
||||||
qCDebug(gpugllogging) << "GLBackend::do_setUniformBuffer: Trying to set a uniform Buffer at slot #" << slot << " which doesn't exist. MaxNumUniformBuffers = " << getMaxNumUniformBuffers();
|
qCDebug(gpugllogging) << "GLBackend::do_setUniformBuffer: Trying to set a uniform Buffer at slot #" << slot
|
||||||
|
<< " which doesn't exist. MaxNumUniformBuffers = " << getMaxNumUniformBuffers();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
BufferPointer uniformBuffer = batch._buffers.get(batch._params[paramOffset + 2]._uint);
|
BufferPointer uniformBuffer = batch._buffers.get(batch._params[paramOffset + 2]._uint);
|
||||||
|
@ -169,7 +171,7 @@ void GLBackend::do_setUniformBuffer(const Batch& batch, size_t paramOffset) {
|
||||||
releaseUniformBuffer(slot);
|
releaseUniformBuffer(slot);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// check cache before thinking
|
// check cache before thinking
|
||||||
if (_uniform._buffers[slot] == uniformBuffer) {
|
if (_uniform._buffers[slot] == uniformBuffer) {
|
||||||
return;
|
return;
|
||||||
|
@ -181,7 +183,7 @@ void GLBackend::do_setUniformBuffer(const Batch& batch, size_t paramOffset) {
|
||||||
glBindBufferRange(GL_UNIFORM_BUFFER, slot, object->_buffer, rangeStart, rangeSize);
|
glBindBufferRange(GL_UNIFORM_BUFFER, slot, object->_buffer, rangeStart, rangeSize);
|
||||||
|
|
||||||
_uniform._buffers[slot] = uniformBuffer;
|
_uniform._buffers[slot] = uniformBuffer;
|
||||||
(void) CHECK_GL_ERROR();
|
(void)CHECK_GL_ERROR();
|
||||||
} else {
|
} else {
|
||||||
releaseUniformBuffer(slot);
|
releaseUniformBuffer(slot);
|
||||||
return;
|
return;
|
||||||
|
@ -195,8 +197,8 @@ void GLBackend::releaseResourceTexture(uint32_t slot) {
|
||||||
if (object) {
|
if (object) {
|
||||||
GLuint target = object->_target;
|
GLuint target = object->_target;
|
||||||
glActiveTexture(GL_TEXTURE0 + slot);
|
glActiveTexture(GL_TEXTURE0 + slot);
|
||||||
glBindTexture(target, 0); // RELEASE
|
glBindTexture(target, 0); // RELEASE
|
||||||
(void) CHECK_GL_ERROR();
|
(void)CHECK_GL_ERROR();
|
||||||
}
|
}
|
||||||
tex.reset();
|
tex.reset();
|
||||||
}
|
}
|
||||||
|
@ -212,11 +214,11 @@ void GLBackend::resetResourceStage() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void GLBackend::do_setResourceBuffer(const Batch& batch, size_t paramOffset) {
|
void GLBackend::do_setResourceBuffer(const Batch& batch, size_t paramOffset) {
|
||||||
GLuint slot = batch._params[paramOffset + 1]._uint;
|
GLuint slot = batch._params[paramOffset + 1]._uint;
|
||||||
if (slot >= (GLuint)MAX_NUM_RESOURCE_BUFFERS) {
|
if (slot >= (GLuint)MAX_NUM_RESOURCE_BUFFERS) {
|
||||||
qCDebug(gpugllogging) << "GLBackend::do_setResourceBuffer: Trying to set a resource Buffer at slot #" << slot << " which doesn't exist. MaxNumResourceBuffers = " << getMaxNumResourceBuffers();
|
qCDebug(gpugllogging) << "GLBackend::do_setResourceBuffer: Trying to set a resource Buffer at slot #" << slot
|
||||||
|
<< " which doesn't exist. MaxNumResourceBuffers = " << getMaxNumResourceBuffers();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -237,7 +239,7 @@ void GLBackend::do_setResourceBuffer(const Batch& batch, size_t paramOffset) {
|
||||||
// If successful bind then cache it
|
// If successful bind then cache it
|
||||||
if (bindResourceBuffer(slot, resourceBuffer)) {
|
if (bindResourceBuffer(slot, resourceBuffer)) {
|
||||||
_resource._buffers[slot] = resourceBuffer;
|
_resource._buffers[slot] = resourceBuffer;
|
||||||
} else { // else clear slot and cache
|
} else { // else clear slot and cache
|
||||||
releaseResourceBuffer(slot);
|
releaseResourceBuffer(slot);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -245,8 +247,9 @@ void GLBackend::do_setResourceBuffer(const Batch& batch, size_t paramOffset) {
|
||||||
|
|
||||||
void GLBackend::do_setResourceTexture(const Batch& batch, size_t paramOffset) {
|
void GLBackend::do_setResourceTexture(const Batch& batch, size_t paramOffset) {
|
||||||
GLuint slot = batch._params[paramOffset + 1]._uint;
|
GLuint slot = batch._params[paramOffset + 1]._uint;
|
||||||
if (slot >= (GLuint) MAX_NUM_RESOURCE_TEXTURES) {
|
if (slot >= (GLuint)MAX_NUM_RESOURCE_TEXTURES) {
|
||||||
qCDebug(gpugllogging) << "GLBackend::do_setResourceTexture: Trying to set a resource Texture at slot #" << slot << " which doesn't exist. MaxNumResourceTextures = " << getMaxNumResourceTextures();
|
qCDebug(gpugllogging) << "GLBackend::do_setResourceTexture: Trying to set a resource Texture at slot #" << slot
|
||||||
|
<< " which doesn't exist. MaxNumResourceTextures = " << getMaxNumResourceTextures();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -265,11 +268,14 @@ void GLBackend::bindResourceTexture(uint32_t slot, const TexturePointer& resourc
|
||||||
void GLBackend::do_setResourceFramebufferSwapChainTexture(const Batch& batch, size_t paramOffset) {
|
void GLBackend::do_setResourceFramebufferSwapChainTexture(const Batch& batch, size_t paramOffset) {
|
||||||
GLuint slot = batch._params[paramOffset + 1]._uint;
|
GLuint slot = batch._params[paramOffset + 1]._uint;
|
||||||
if (slot >= (GLuint)MAX_NUM_RESOURCE_TEXTURES) {
|
if (slot >= (GLuint)MAX_NUM_RESOURCE_TEXTURES) {
|
||||||
qCDebug(gpugllogging) << "GLBackend::do_setResourceFramebufferSwapChainTexture: Trying to set a resource Texture at slot #" << slot << " which doesn't exist. MaxNumResourceTextures = " << getMaxNumResourceTextures();
|
qCDebug(gpugllogging)
|
||||||
|
<< "GLBackend::do_setResourceFramebufferSwapChainTexture: Trying to set a resource Texture at slot #" << slot
|
||||||
|
<< " which doesn't exist. MaxNumResourceTextures = " << getMaxNumResourceTextures();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto swapChain = std::static_pointer_cast<FramebufferSwapChain>(batch._swapChains.get(batch._params[paramOffset + 0]._uint));
|
auto swapChain =
|
||||||
|
std::static_pointer_cast<FramebufferSwapChain>(batch._swapChains.get(batch._params[paramOffset + 0]._uint));
|
||||||
|
|
||||||
if (!swapChain) {
|
if (!swapChain) {
|
||||||
releaseResourceTexture(slot);
|
releaseResourceTexture(slot);
|
||||||
|
|
|
@ -168,7 +168,9 @@ void GLBackend::TransformStageState::update(size_t commandIndex, const StereoSta
|
||||||
|
|
||||||
void GLBackend::TransformStageState::bindCurrentCamera(int eye) const {
|
void GLBackend::TransformStageState::bindCurrentCamera(int eye) const {
|
||||||
if (_currentCameraOffset != INVALID_OFFSET) {
|
if (_currentCameraOffset != INVALID_OFFSET) {
|
||||||
glBindBufferRange(GL_UNIFORM_BUFFER, TRANSFORM_CAMERA_SLOT, _cameraBuffer, _currentCameraOffset + eye * _cameraUboSize, sizeof(CameraBufferElement));
|
static_assert(TRANSFORM_CAMERA_SLOT >= MAX_NUM_UNIFORM_BUFFERS, "TransformCamera may overlap pipeline uniform buffer slots. Invalidate uniform buffer slot cache for safety (call _uniform._buffers[TRANSFORM_CAMERA_SLOT].reset()).");
|
||||||
|
glBindBufferRange(GL_UNIFORM_BUFFER, TRANSFORM_CAMERA_SLOT, _cameraBuffer, _currentCameraOffset + eye * _cameraUboSize,
|
||||||
|
sizeof(CameraBufferElement));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -198,7 +198,7 @@ vec3 evalGlobalLightingAlphaBlended(mat4 invViewMat, float shadowAttenuation, fl
|
||||||
vec3 directionalSpecular;
|
vec3 directionalSpecular;
|
||||||
evalLightingDirectional(directionalDiffuse, directionalSpecular, lightDirection, lightIrradiance, surfaceWS, metallic, fresnel, albedo, shadowAttenuation);
|
evalLightingDirectional(directionalDiffuse, directionalSpecular, lightDirection, lightIrradiance, surfaceWS, metallic, fresnel, albedo, shadowAttenuation);
|
||||||
color += directionalDiffuse;
|
color += directionalDiffuse;
|
||||||
color += (ambientSpecular + directionalSpecular) / opacity;
|
color += evalSpecularWithOpacity(ambientSpecular + directionalSpecular, opacity);
|
||||||
|
|
||||||
return color;
|
return color;
|
||||||
}
|
}
|
||||||
|
@ -231,7 +231,7 @@ vec3 evalGlobalLightingAlphaBlendedWithHaze(
|
||||||
vec3 directionalSpecular;
|
vec3 directionalSpecular;
|
||||||
evalLightingDirectional(directionalDiffuse, directionalSpecular, lightDirection, lightIrradiance, surfaceWS, metallic, fresnel, albedo, shadowAttenuation);
|
evalLightingDirectional(directionalDiffuse, directionalSpecular, lightDirection, lightIrradiance, surfaceWS, metallic, fresnel, albedo, shadowAttenuation);
|
||||||
color += directionalDiffuse;
|
color += directionalDiffuse;
|
||||||
color += (ambientSpecular + directionalSpecular) / opacity;
|
color += evalSpecularWithOpacity(ambientSpecular + directionalSpecular, opacity);
|
||||||
|
|
||||||
// Haze
|
// Haze
|
||||||
if ((isHazeEnabled() > 0.0) && (hazeParams.hazeMode & HAZE_MODE_IS_ACTIVE) == HAZE_MODE_IS_ACTIVE) {
|
if ((isHazeEnabled() > 0.0) && (hazeParams.hazeMode & HAZE_MODE_IS_ACTIVE) == HAZE_MODE_IS_ACTIVE) {
|
||||||
|
@ -269,7 +269,7 @@ vec3 evalGlobalLightingAlphaBlendedWithHaze(
|
||||||
evalLightingDirectional(directionalDiffuse, directionalSpecular, lightDirection, lightIrradiance, surface, metallic, fresnel, albedo, shadowAttenuation);
|
evalLightingDirectional(directionalDiffuse, directionalSpecular, lightDirection, lightIrradiance, surface, metallic, fresnel, albedo, shadowAttenuation);
|
||||||
|
|
||||||
color += ambientDiffuse + directionalDiffuse;
|
color += ambientDiffuse + directionalDiffuse;
|
||||||
color += (ambientSpecular + directionalSpecular) / opacity;
|
color += evalSpecularWithOpacity(ambientSpecular + directionalSpecular, opacity);
|
||||||
|
|
||||||
// Haze
|
// Haze
|
||||||
if ((isHazeEnabled() > 0.0) && (hazeParams.hazeMode & HAZE_MODE_IS_ACTIVE) == HAZE_MODE_IS_ACTIVE) {
|
if ((isHazeEnabled() > 0.0) && (hazeParams.hazeMode & HAZE_MODE_IS_ACTIVE) == HAZE_MODE_IS_ACTIVE) {
|
||||||
|
|
|
@ -197,7 +197,7 @@ vec3 evalGlobalLightingAlphaBlended(mat4 invViewMat, float shadowAttenuation, fl
|
||||||
vec3 directionalSpecular;
|
vec3 directionalSpecular;
|
||||||
evalLightingDirectional(directionalDiffuse, directionalSpecular, lightDirection, lightIrradiance, surfaceWS, metallic, fresnel, albedo, shadowAttenuation);
|
evalLightingDirectional(directionalDiffuse, directionalSpecular, lightDirection, lightIrradiance, surfaceWS, metallic, fresnel, albedo, shadowAttenuation);
|
||||||
color += directionalDiffuse;
|
color += directionalDiffuse;
|
||||||
color += (ambientSpecular + directionalSpecular) / opacity;
|
color += evalSpecularWithOpacity(ambientSpecular + directionalSpecular, opacity);
|
||||||
|
|
||||||
return color;
|
return color;
|
||||||
}
|
}
|
||||||
|
@ -223,7 +223,7 @@ vec3 evalGlobalLightingAlphaBlendedWithHaze(
|
||||||
vec3 directionalSpecular;
|
vec3 directionalSpecular;
|
||||||
evalLightingDirectional(directionalDiffuse, directionalSpecular, lightDirection, lightIrradiance, surfaceWS, metallic, fresnel, albedo, shadowAttenuation);
|
evalLightingDirectional(directionalDiffuse, directionalSpecular, lightDirection, lightIrradiance, surfaceWS, metallic, fresnel, albedo, shadowAttenuation);
|
||||||
color += directionalDiffuse;
|
color += directionalDiffuse;
|
||||||
color += (ambientSpecular + directionalSpecular) / opacity;
|
color += evalSpecularWithOpacity(ambientSpecular + directionalSpecular, opacity);
|
||||||
|
|
||||||
// Haze
|
// Haze
|
||||||
// FIXME - temporarily removed until we support it for forward...
|
// FIXME - temporarily removed until we support it for forward...
|
||||||
|
|
|
@ -143,6 +143,6 @@ vec4 evalLocalLighting(ivec3 cluster, int numLights, vec3 fragWorldPos, SurfaceD
|
||||||
fragSpecular *= isSpecularEnabled();
|
fragSpecular *= isSpecularEnabled();
|
||||||
|
|
||||||
fragColor.rgb += fragDiffuse;
|
fragColor.rgb += fragDiffuse;
|
||||||
fragColor.rgb += fragSpecular / opacity;
|
fragColor.rgb += evalSpecularWithOpacity(fragSpecular, opacity);
|
||||||
return fragColor;
|
return fragColor;
|
||||||
}
|
}
|
|
@ -314,6 +314,9 @@ void evalFragShadingGloss(out vec3 diffuse, out vec3 specular,
|
||||||
specular = shading.xyz;
|
specular = shading.xyz;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
vec3 evalSpecularWithOpacity(vec3 specular, float opacity) {
|
||||||
|
return specular / opacity;
|
||||||
|
}
|
||||||
|
|
||||||
<@if not GETFRESNEL0@>
|
<@if not GETFRESNEL0@>
|
||||||
<@def GETFRESNEL0@>
|
<@def GETFRESNEL0@>
|
||||||
|
|
|
@ -267,7 +267,7 @@ vec3 fetchLightmapMap(vec2 uv) {
|
||||||
|
|
||||||
<@func discardTransparent(opacity)@>
|
<@func discardTransparent(opacity)@>
|
||||||
{
|
{
|
||||||
if (<$opacity$> < 1.0) {
|
if (<$opacity$> < 1e-6) {
|
||||||
discard;
|
discard;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,6 +41,7 @@ void main(void) {
|
||||||
|
|
||||||
float opacity = getMaterialOpacity(mat) * _alpha;
|
float opacity = getMaterialOpacity(mat) * _alpha;
|
||||||
<$evalMaterialOpacity(albedoTex.a, opacity, matKey, opacity)$>;
|
<$evalMaterialOpacity(albedoTex.a, opacity, matKey, opacity)$>;
|
||||||
|
<$discardTransparent(opacity)$>;
|
||||||
|
|
||||||
vec3 albedo = getMaterialAlbedo(mat);
|
vec3 albedo = getMaterialAlbedo(mat);
|
||||||
<$evalMaterialAlbedo(albedoTex, albedo, matKey, albedo)$>;
|
<$evalMaterialAlbedo(albedoTex, albedo, matKey, albedo)$>;
|
||||||
|
|
|
@ -44,6 +44,7 @@ void main(void) {
|
||||||
|
|
||||||
float opacity = getMaterialOpacity(mat) * _alpha;
|
float opacity = getMaterialOpacity(mat) * _alpha;
|
||||||
<$evalMaterialOpacity(albedoTex.a, opacity, matKey, opacity)$>;
|
<$evalMaterialOpacity(albedoTex.a, opacity, matKey, opacity)$>;
|
||||||
|
<$discardTransparent(opacity)$>;
|
||||||
|
|
||||||
vec3 albedo = getMaterialAlbedo(mat);
|
vec3 albedo = getMaterialAlbedo(mat);
|
||||||
<$evalMaterialAlbedo(albedoTex, albedo, matKey, albedo)$>;
|
<$evalMaterialAlbedo(albedoTex, albedo, matKey, albedo)$>;
|
||||||
|
|
|
@ -46,6 +46,7 @@ void main(void) {
|
||||||
|
|
||||||
float opacity = getMaterialOpacity(mat) * _alpha;
|
float opacity = getMaterialOpacity(mat) * _alpha;
|
||||||
<$evalMaterialOpacity(albedoTex.a, opacity, matKey, opacity)$>;
|
<$evalMaterialOpacity(albedoTex.a, opacity, matKey, opacity)$>;
|
||||||
|
<$discardTransparent(opacity)$>;
|
||||||
|
|
||||||
vec3 albedo = getMaterialAlbedo(mat);
|
vec3 albedo = getMaterialAlbedo(mat);
|
||||||
<$evalMaterialAlbedo(albedoTex, albedo, matKey, albedo)$>;
|
<$evalMaterialAlbedo(albedoTex, albedo, matKey, albedo)$>;
|
||||||
|
|
|
@ -45,6 +45,7 @@ void main(void) {
|
||||||
|
|
||||||
float opacity = getMaterialOpacity(mat) * _alpha;
|
float opacity = getMaterialOpacity(mat) * _alpha;
|
||||||
<$evalMaterialOpacity(albedoTex.a, opacity, matKey, opacity)$>;
|
<$evalMaterialOpacity(albedoTex.a, opacity, matKey, opacity)$>;
|
||||||
|
<$discardTransparent(opacity)$>;
|
||||||
|
|
||||||
vec3 albedo = getMaterialAlbedo(mat);
|
vec3 albedo = getMaterialAlbedo(mat);
|
||||||
<$evalMaterialAlbedo(albedoTex, albedo, matKey, albedo)$>;
|
<$evalMaterialAlbedo(albedoTex, albedo, matKey, albedo)$>;
|
||||||
|
|
|
@ -54,6 +54,7 @@ void main(void) {
|
||||||
|
|
||||||
float opacity = getMaterialOpacity(mat) * _alpha;
|
float opacity = getMaterialOpacity(mat) * _alpha;
|
||||||
<$evalMaterialOpacity(albedoTex.a, opacity, matKey, opacity)$>;
|
<$evalMaterialOpacity(albedoTex.a, opacity, matKey, opacity)$>;
|
||||||
|
<$discardTransparent(opacity)$>;
|
||||||
|
|
||||||
vec3 albedo = getMaterialAlbedo(mat);
|
vec3 albedo = getMaterialAlbedo(mat);
|
||||||
<$evalMaterialAlbedo(albedoTex, albedo, matKey, albedo)$>;
|
<$evalMaterialAlbedo(albedoTex, albedo, matKey, albedo)$>;
|
||||||
|
|
|
@ -31,6 +31,7 @@ void main(void) {
|
||||||
|
|
||||||
float opacity = getMaterialOpacity(mat) * _alpha;
|
float opacity = getMaterialOpacity(mat) * _alpha;
|
||||||
<$evalMaterialOpacity(albedoTex.a, opacity, matKey, opacity)$>;
|
<$evalMaterialOpacity(albedoTex.a, opacity, matKey, opacity)$>;
|
||||||
|
<$discardTransparent(opacity)$>;
|
||||||
|
|
||||||
vec3 albedo = getMaterialAlbedo(mat);
|
vec3 albedo = getMaterialAlbedo(mat);
|
||||||
<$evalMaterialAlbedo(albedoTex, albedo, matKey, albedo)$>;
|
<$evalMaterialAlbedo(albedoTex, albedo, matKey, albedo)$>;
|
||||||
|
|
|
@ -41,6 +41,7 @@ void main(void) {
|
||||||
|
|
||||||
float opacity = getMaterialOpacity(mat) * _alpha;
|
float opacity = getMaterialOpacity(mat) * _alpha;
|
||||||
<$evalMaterialOpacity(albedoTex.a, opacity, matKey, opacity)$>;
|
<$evalMaterialOpacity(albedoTex.a, opacity, matKey, opacity)$>;
|
||||||
|
<$discardTransparent(opacity)$>;
|
||||||
|
|
||||||
vec3 albedo = getMaterialAlbedo(mat);
|
vec3 albedo = getMaterialAlbedo(mat);
|
||||||
<$evalMaterialAlbedo(albedoTex, albedo, matKey, albedo)$>;
|
<$evalMaterialAlbedo(albedoTex, albedo, matKey, albedo)$>;
|
||||||
|
|
Loading…
Reference in a new issue