Log In  

Cart [#doyusuyepo-0#] | Code | 2019-05-04 | No License | Embed
18

Project started following a question on 3d clipping on this forum and quickly spiraled into a full blown 3d renderer with support for real-time shadows and camera space clipping :/

Shadows are calculated in real-time by extruding a shadow volume from each lit face.
Resulting polygons are added to the face and rendered/sorted with the face.

The shadows are globals e.g. self-shadowing is supported, see torus scene.

Performance-wise this is bordering what pico can support, as many clipping operations are required to generate shadow polygons. There is room for optimization (vertex cache, smart selection of clipping planes) left to the reader!

Sources

Project (including how to add custom 3d models) is available here: github

Acknowledgements:

  • 3d papers from the 70s/80s are pure gold!
  • trifill function from @p01

Update 1.1

  • fixed polygon gaps (using correct middle screen position + ceil)
P#60772 2019-01-12 14:38 ( Edited 2019-05-04 12:54)

:: zep
1

This is great <3

http://people.csail.mit.edu/ericchan/bib/pdf/p275-atherton.pdf

Presented at SIGGRAPH 1978 -- awww yeeah.

The nice thing about using the cornell box example is that you can just imagine the global illumination.

P#60786 2019-01-13 09:16
1

Thanks - once I got the basics working (e.g. clipping), the shadow thing nicely fits into a generic 3d engine.

Now if you could add z-buffer support to pico, I wouldn't mind :)

P#60787 2019-01-13 09:31

[Please log in to post a comment]

About | Contact | Updates | Terms of Use
Follow Lexaloffle:        
Generated 2019-09-20 02:02 | 0.030s | 4194k | Q:31