mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 14:53:01 +02:00
Cleaning code
This commit is contained in:
parent
3490e08521
commit
690620d74d
5 changed files with 5 additions and 17 deletions
|
@ -360,11 +360,8 @@ GLBackend::GLTexture* GLBackend::syncGPUObject(const Texture& texture) {
|
||||||
if (bytes && texture.isAutogenerateMips()) {
|
if (bytes && texture.isAutogenerateMips()) {
|
||||||
glGenerateMipmap(GL_TEXTURE_2D);
|
glGenerateMipmap(GL_TEXTURE_2D);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
|
||||||
}/* else {
|
}
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
object->_target = GL_TEXTURE_2D;
|
object->_target = GL_TEXTURE_2D;
|
||||||
|
|
||||||
syncSampler(texture.getSampler(), texture.getType(), object);
|
syncSampler(texture.getSampler(), texture.getType(), object);
|
||||||
|
|
|
@ -129,7 +129,7 @@ void Skybox::render(gpu::Batch& batch, const ViewFrustum& viewFrustum, const Sky
|
||||||
|
|
||||||
batch.draw(gpu::TRIANGLE_STRIP, 4);
|
batch.draw(gpu::TRIANGLE_STRIP, 4);
|
||||||
|
|
||||||
// batch.setResourceTexture(SKYBOX_SKYMAP_SLOT, nullptr);
|
batch.setResourceTexture(SKYBOX_SKYMAP_SLOT, nullptr);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -62,8 +62,6 @@ void Environment::setupAtmosphereProgram(const char* vertSource, const char* fra
|
||||||
auto state = std::make_shared<gpu::State>();
|
auto state = std::make_shared<gpu::State>();
|
||||||
|
|
||||||
state->setCullMode(gpu::State::CULL_NONE);
|
state->setCullMode(gpu::State::CULL_NONE);
|
||||||
// state->setDepthTest(false);
|
|
||||||
// state->setDepthTest(true, false, gpu::LESS_EQUAL);
|
|
||||||
state->setStencilTest(true, 0xFF, gpu::State::StencilTest(0, 0xFF, gpu::EQUAL, gpu::State::STENCIL_OP_KEEP, gpu::State::STENCIL_OP_KEEP, gpu::State::STENCIL_OP_KEEP));
|
state->setStencilTest(true, 0xFF, gpu::State::StencilTest(0, 0xFF, gpu::EQUAL, gpu::State::STENCIL_OP_KEEP, gpu::State::STENCIL_OP_KEEP, gpu::State::STENCIL_OP_KEEP));
|
||||||
state->setBlendFunction(true,
|
state->setBlendFunction(true,
|
||||||
gpu::State::SRC_ALPHA, gpu::State::BLEND_OP_ADD, gpu::State::INV_SRC_ALPHA,
|
gpu::State::SRC_ALPHA, gpu::State::BLEND_OP_ADD, gpu::State::INV_SRC_ALPHA,
|
||||||
|
|
|
@ -314,7 +314,6 @@ const gpu::PipelinePointer& DrawStencilDeferred::getOpaquePipeline() {
|
||||||
|
|
||||||
auto state = std::make_shared<gpu::State>();
|
auto state = std::make_shared<gpu::State>();
|
||||||
state->setStencilTest(true, 0xFF, gpu::State::StencilTest(STENCIL_OPAQUE, 0xFF, gpu::ALWAYS, gpu::State::STENCIL_OP_REPLACE, gpu::State::STENCIL_OP_REPLACE, gpu::State::STENCIL_OP_REPLACE));
|
state->setStencilTest(true, 0xFF, gpu::State::StencilTest(STENCIL_OPAQUE, 0xFF, gpu::ALWAYS, gpu::State::STENCIL_OP_REPLACE, gpu::State::STENCIL_OP_REPLACE, gpu::State::STENCIL_OP_REPLACE));
|
||||||
// state->setStencilTest(false, 0xFF, gpu::State::StencilTest(STENCIL_OPAQUE, 0xFF, gpu::ALWAYS, gpu::State::STENCIL_OP_INCR, gpu::State::STENCIL_OP_INCR, gpu::State::STENCIL_OP_INCR));
|
|
||||||
state->setColorWriteMask(0);
|
state->setColorWriteMask(0);
|
||||||
|
|
||||||
_opaquePipeline.reset(gpu::Pipeline::create(program, state));
|
_opaquePipeline.reset(gpu::Pipeline::create(program, state));
|
||||||
|
|
|
@ -13,18 +13,12 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
in vec2 varTexCoord0;
|
in vec2 varTexCoord0;
|
||||||
out vec4 outFragColor;
|
|
||||||
|
|
||||||
uniform sampler2D depthTexture;
|
uniform sampler2D depthTexture;
|
||||||
|
|
||||||
void main(void) {
|
void main(void) {
|
||||||
// outFragColor = vec4(varTexCoord0, 0.0, 1.0);
|
float depth = texture(depthTexture, varTexCoord0.xy).r;
|
||||||
|
if (depth >= 1.0) {
|
||||||
float depth = texture(depthTexture, varTexCoord0.xy).r;
|
|
||||||
outFragColor = vec4(1.0, 0.0, 0.0, 1.0);
|
|
||||||
if (depth < 1.0) {
|
|
||||||
outFragColor = vec4(0.0, 1.0, 0.0, 1.0);
|
|
||||||
} else {
|
|
||||||
discard;
|
discard;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue