Deferred renderer: fix shadows behind transparent objects
This commit is contained in:
parent
e799771a40
commit
dd520c4cae
1 changed files with 4 additions and 1 deletions
|
|
@ -777,6 +777,9 @@ void main()
|
|||
if (o.mat.lit && o.mat.transparent)
|
||||
throw std::runtime_error("Materials that are both tit & transparent are not supported");
|
||||
|
||||
if (o.casts_shadow && o.mat.transparent)
|
||||
throw std::runtime_error("Transparent objects cannot cast shadow");
|
||||
|
||||
objects_by_mask[mask(objects[i])].push_back(i);
|
||||
|
||||
if (o.mat.lit) lit_bbox |= o.bbox;
|
||||
|
|
@ -900,7 +903,7 @@ void main()
|
|||
impl().transparent_pass_program["u_max_intensity"] = opts.max_intensity;
|
||||
|
||||
gl::Enable(gl::BLEND);
|
||||
gl::BlendFuncSeparate(gl::SRC_ALPHA, gl::ONE_MINUS_SRC_ALPHA, gl::ONE, gl::ZERO);
|
||||
gl::BlendFuncSeparate(gl::SRC_ALPHA, gl::ONE_MINUS_SRC_ALPHA, gl::ZERO, gl::ONE);
|
||||
|
||||
gl::DepthMask(gl::FALSE);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue