Page MenuHome

Smoke: put density/color in separate textures, fixes for workbench shader
ClosedPublic

Authored by Brecht Van Lommel (brecht) on Feb 27 2020, 6:24 PM.

Details

Summary

This is more in line with standard grids and means we don't have to make
many special exceptions in the upcoming patch for arbitrary number of volume
grids support in Eevee.

The workbench shader was also changed to fix bugs where squared density was
used, and the smoke color would affect the density so that black smoke would
be invisible. This can change the look of smoke in workbench significantly.

When using the color grid when smoke has a constant color, the color grid
will no longer be premultiplied by the density. If the color is constant
we want to be able not to store a grid at all. This breaks one test for
Cycles and Eevee, but the setup in that test using a color without density
does not make sense. It suffers from artifacts since the unpremultiplied
color grid by itself will not have smooth boundaries.

Diff Detail

Repository
rB Blender

Event Timeline

All good!

source/blender/gpu/intern/gpu_draw_smoke.c
205

I found the comment above swizzle_texture_channel_rrrr() quite helpful to understand what's going on. Maybe keep it somewhere over here?

This revision is now accepted and ready to land.Mar 10 2020, 3:43 PM