fs
New Member
Posts: 28
|
Post by fs on Dec 30, 2018 22:09:10 GMT
I was playing with a reconstruction of the CSG chapter's banner image, and decided to investigate the "dark" core visible in the sphere with the wedges removed (it's in the book image, and I had reproduced it). Analogous to the extra feature to allow shapes to opt out of casting shadows (mentioned at end of chapter 11), I added an option to opt out of visibility too. I have two versions of hit(intersections); one for visibility checks, and one for shadow checks - they skip invisible shapes, and shapes that don't cast shadows respectively. Here's the reconstruction, when the wedges are visible, which is broadly in agreement with the book image: Here's the reconstruction where the wedges are invisible:
|
|
|
Post by Jamis on Dec 30, 2018 22:15:54 GMT
That looks great!
|
|
|
Post by ascotti on Dec 30, 2018 23:52:48 GMT
Wow, it looks fantastic! :-o
I have just implemented CSG but haven't played with it much yet.
How is the sphere done? Could you get the "invisible" effect by difference with another smaller sphere inside?
|
|
fs
New Member
Posts: 28
|
Post by fs on Dec 31, 2018 2:08:52 GMT
Thanks, but Jamis put together the scene I just took Jamis' hint - in the last paragraph just before the Putting it Together section at the end of Chapter 16; rotate and squash/scale a cube to make a wedge, make several copies rotated around the Y axis in a group, and CSG difference that from a sphere. Here's the wedges I'm removing: Yes, with a small caveat; the sphere shell needs to have some remaining thickness instead of being an "infinitely thin skin". Probably a minimum thickness of at least 2 EPSILON to avoid unexpected interactions with the over_point in the prepared comps. Here's an example where I used that approach instead of the invisibility option: csg(difference, csg(difference, sphere, wedges), sphere scaled 95%) IMHO it looks better this way - and there's no need for "opt out of shadows" support either (actually the shadows will look wrong with this approach if that option is used). However, I tried the invisibility approach because I wanted to try to get the thin skin look as per the book image, and also to later experiment with invisible shapes (eg can't be seen but cast shadows).
|
|
|
Post by ascotti on Dec 31, 2018 9:50:26 GMT
HI fs, thanks for the explanation! I think the shape invisibility is a cool idea and the carved sphere looks great in both versions!
|
|