← All ideas
  • Published 30 Dec 2019

Screen space derivative nodes

For those that are unfamiliar, screen space derivatives give you the change in some particular value from one fragment (basically, a screen pixel) to the next fragment. They are heavily used in shader coding.

While these would have been useful in Cycles, they would be especially useful (and probably easy to implement) for use with Eevee.

Typical values you'd want to get screen space derivatives on would be world space position (geometry/position), normal (geometry/normal), and texture coordinates, particularly UV.

Screen space derivatives would allow game devs to more accurately create WYSIWYG materials in Eevee to match their own shaders.

They would also allow various tricks for those rendering directly in Blender. A UV derivative could be used to create a measure of UV distortion in nodes (comparing delta UV vs delta position) which can be used to modulate bump maps for quick "stretch" effects or to set the transparency cut off for hair strands, so that deformation of a hair plane leads to hair spreading out or clumping as the plane deforms, rather than getting thicker or thinner.

Delta normal can be used to create a quick curvature map, measuring the difference in angle from fragment to fragment: where that difference is large, the radius of curvature is small.

Although this ought to be something relatively easy to implement in Eevee, I don't know how easy it would be to implement in Cycles. However, given its use in Eevee, and the fact that other engine-specific nodes already exist, even implementation for Eevee alone would worthwhile.

94.4%

Development Status: Open

Upvote 17 Downvote 1
vasiln
30 Dec 2019

1 Comment

3pointedit

Oh I need a way of deriving screen space coordinates from a texture generated by refraction, I guess this could have provided UV coords from it?