Fixed blending (for now)
This commit is contained in:
@ -32,7 +32,7 @@ void RenderManager::init() {
|
||||
// Prepare the initial values
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
|
||||
glDepthMask(GL_TRUE);
|
||||
glDepthFunc(GL_LESS);
|
||||
}
|
||||
|
@ -7,7 +7,7 @@
|
||||
#include "display/shader/Shader.hpp"
|
||||
#include "display/shader/buffers/RenderPipelineShaderBuffer.hpp"
|
||||
|
||||
#define UI_SHADER_PROGRAM_PRIORITY 100
|
||||
#define UI_SHADER_PROGRAM_PRIORITY 1000
|
||||
|
||||
namespace Dawn {
|
||||
struct UICanvasShaderParameterBufferData {
|
||||
|
@ -36,9 +36,17 @@ std::vector<struct ShaderPassItem> SimpleTexturedMaterial::getRenderPasses(IRend
|
||||
onlyPass.matrixValues[shader->paramModel] = this->transform->getWorldTransform();
|
||||
onlyPass.parameterBuffers[shader->bufferRenderPipeline] = &context.renderPipeline->shaderBuffer;
|
||||
|
||||
onlyPass.renderFlags = (
|
||||
RENDER_MANAGER_RENDER_FLAG_BLEND
|
||||
);
|
||||
if(this->opaque) {
|
||||
onlyPass.renderFlags = (
|
||||
RENDER_MANAGER_RENDER_FLAG_DEPTH_TEST
|
||||
);
|
||||
} else {
|
||||
onlyPass.priority = 100;
|
||||
onlyPass.renderFlags = (
|
||||
RENDER_MANAGER_RENDER_FLAG_BLEND
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
if(this->texture != nullptr) {
|
||||
onlyPass.boolValues[shader->paramHasTexture] = true;
|
||||
|
@ -17,6 +17,8 @@ namespace Dawn {
|
||||
Texture *texture = nullptr;
|
||||
// @optional
|
||||
struct Color color = COLOR_WHITE;
|
||||
// @optional
|
||||
bool_t opaque = true;
|
||||
|
||||
/**
|
||||
* SimpleTexturedShader scene item component interface.
|
||||
|
Reference in New Issue
Block a user