AnswerBun.com

Combine box shadow with a signed distance field

I’m using 2d signed distance fields in my current project for drawing shapes (example: https://www.shadertoy.com/view/4llXD7) and I want to add drop shadows to them. At first I thought I could exploit the sdfs distance property to achieve good enough looking drop shadows, but I found that in many cases this left undesirable results in the interior of the shapes where there is often a darker ‘x’ in center.

I found this shadertoy https://www.shadertoy.com/view/tdSGDc which is produces exactly what I am looking for in terms of quality and performance, but I can’t seem to figure out how I would combine this 1d box blur effect with arbitrary sdf shapes to achieve a nice looking drop shadow. Is there a way I can combine these two techniques to get great looking shadows?

Computer Graphics Asked by weichsem on January 2, 2021

0 Answers

Add your own answers!

Related Questions

glutSolid* source code

1  Asked on November 22, 2021 by tado-mi

 

How to retrieve data from Compute Shader to CPU?

0  Asked on November 15, 2021 by ethan-ma

   

unwanted patterns in simplex noise

1  Asked on November 13, 2021 by sam-apostel

 

Procedural generation of biological models

1  Asked on November 13, 2021 by daniel-cooke

 

What method is used for baking grayscale curvature maps

1  Asked on November 10, 2021 by jummit

     

Why are texture coordinates often called UVs?

2  Asked on August 27, 2021 by samanthaj

 

Dynamic Ray-Triangle Intersection

1  Asked on August 27, 2021 by cemklkn

     

Draw Line on Arbitrary Surface

0  Asked on August 27, 2021 by valentin-molina

 

How to raytrace Bezier surfaces?

5  Asked on August 27, 2021 by luser-droog

   

Better Shadow Mapping Techniques

2  Asked on August 27, 2021 by arjan-singh

       

What does GPU assembly look like?

4  Asked on August 27, 2021 by sebastien-finor

   

Ask a Question

Get help from others!

© 2022 AnswerBun.com. All rights reserved.