summaryrefslogtreecommitdiffstats
path: root/src/extras/custompipes_gl.cpp
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2021-07-29 19:41:38 +0200
committeraap <aap@papnet.eu>2021-07-29 19:59:34 +0200
commit3f3e258d7769aa3522602687aea1119f32f3c589 (patch)
treeca6beec16a570275e5da7dc83d242e4ca4fb86f6 /src/extras/custompipes_gl.cpp
parentMerge branch 'miami' into lcs (diff)
downloadre3-3f3e258d7769aa3522602687aea1119f32f3c589.tar
re3-3f3e258d7769aa3522602687aea1119f32f3c589.tar.gz
re3-3f3e258d7769aa3522602687aea1119f32f3c589.tar.bz2
re3-3f3e258d7769aa3522602687aea1119f32f3c589.tar.lz
re3-3f3e258d7769aa3522602687aea1119f32f3c589.tar.xz
re3-3f3e258d7769aa3522602687aea1119f32f3c589.tar.zst
re3-3f3e258d7769aa3522602687aea1119f32f3c589.zip
Diffstat (limited to '')
-rw-r--r--src/extras/custompipes_gl.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/extras/custompipes_gl.cpp b/src/extras/custompipes_gl.cpp
index e70bd6db..ed6a529a 100644
--- a/src/extras/custompipes_gl.cpp
+++ b/src/extras/custompipes_gl.cpp
@@ -15,6 +15,7 @@
#include "TxdStore.h"
#include "Renderer.h"
#include "World.h"
+#include "VisibilityPlugins.h"
#include "custompipes.h"
#ifndef LIBRW
@@ -457,9 +458,13 @@ worldRenderCB(rw::Atomic *atomic, rw::gl3::InstanceDataHeader *header)
setTexture(0, m->texture);
- setMaterial(m->color, m->surfaceProps, CustomPipes::WorldPipeSwitch == CustomPipes::WORLDPIPE_PS2 ? 0.5f : 1.0f);
+ rw::RGBA color = m->color;
+#ifdef VIS_DISTANCE_ALPHA
+ color.alpha = (color.alpha * CVisibilityPlugins::GetObjectDistanceAlpha((RwObject*)atomic))/255.0f;
+#endif
+ setMaterial(color, m->surfaceProps, CustomPipes::WorldPipeSwitch == CustomPipes::WORLDPIPE_PS2 ? 0.5f : 1.0f);
- rw::SetRenderState(VERTEXALPHA, inst->vertexAlpha || m->color.alpha != 0xFF);
+ rw::SetRenderState(VERTEXALPHA, inst->vertexAlpha || color.alpha != 0xFF);
drawInst(header, inst);
inst++;