1
0
mirror of https://github.com/XProger/OpenLara.git synced 2025-08-12 08:04:09 +02:00

#23 fix sprites color and alpha; #22 fix waterfalls

This commit is contained in:
XProger
2017-09-10 03:00:35 +03:00
parent 50625c8796
commit bb6959b0fa
2 changed files with 10 additions and 1 deletions

View File

@@ -67,8 +67,17 @@ struct Sprite : Controller {
}
virtual void render(Frustum *frustum, MeshBuilder *mesh, Shader::Type type, bool caustics) {
Core::setBlending(bmAlpha);
TR::Entity::Type eType = getEntity().type;
if (eType == TR::Entity::SMOKE || eType == TR::Entity::WATER_SPLASH)
Core::active.shader->setParam(uMaterial, vec4(0.5f, 1.0f, 0.0f, 0.75f));
else
Core::active.shader->setParam(uMaterial, vec4(0.5f, 1.0f, 0.0f, 1.0f));
Core::active.shader->setParam(uBasis, Basis(Core::mViewInv.getRot(), pos));
mesh->renderSprite(-(getEntity().modelIndex + 1), frame);
Core::setBlending(bmNone);
}
};

View File

@@ -608,7 +608,7 @@ struct Waterfall : Controller {
virtual void update() {
updateAnimation(true);
vec3 delta = (((Controller*)level->cameraController)->pos - pos) * (1.0f / 1024.0f);
vec3 delta = (((ICamera*)level->cameraController)->pos - pos) * (1.0f / 1024.0f);
if (delta.length2() > 100.0f)
return;