mirror of
https://github.com/minetest/minetest.git
synced 2024-12-01 20:13:48 +01:00
Skip face culling in shadows for double-sided materials (e.g. plantlike) (#13500)
* Skip face culling in shadows for double-sided materials (e.g. plantlike) * Keep previous face culling for transparent surfaces e.g. water
This commit is contained in:
parent
a88e61c2cf
commit
e36b2226b9
@ -1198,8 +1198,14 @@ void ClientMap::renderMapShadows(video::IVideoDriver *driver,
|
|||||||
// override some material properties
|
// override some material properties
|
||||||
video::SMaterial local_material = buf->getMaterial();
|
video::SMaterial local_material = buf->getMaterial();
|
||||||
local_material.MaterialType = material.MaterialType;
|
local_material.MaterialType = material.MaterialType;
|
||||||
|
// do not override culling if the original material renders both back
|
||||||
|
// and front faces in solid mode (e.g. plantlike)
|
||||||
|
// Transparent plants would still render shadows only from one side,
|
||||||
|
// but this conflicts with water which occurs much more frequently
|
||||||
|
if (is_transparent_pass || local_material.BackfaceCulling || local_material.FrontfaceCulling) {
|
||||||
local_material.BackfaceCulling = material.BackfaceCulling;
|
local_material.BackfaceCulling = material.BackfaceCulling;
|
||||||
local_material.FrontfaceCulling = material.FrontfaceCulling;
|
local_material.FrontfaceCulling = material.FrontfaceCulling;
|
||||||
|
}
|
||||||
local_material.BlendOperation = material.BlendOperation;
|
local_material.BlendOperation = material.BlendOperation;
|
||||||
local_material.Lighting = false;
|
local_material.Lighting = false;
|
||||||
driver->setMaterial(local_material);
|
driver->setMaterial(local_material);
|
||||||
|
Loading…
Reference in New Issue
Block a user