|
Post by Jamis on Jan 29, 2019 16:29:09 GMT
The "Groups" chapter of the book gives some tips about how to implement bounding boxes, but really leaves it up to you. If you found the tips hard to follow, fear not! This newest bonus chapter takes you through the process of implementing those bounding boxes, with tests, and then goes even farther! You'll learn how to take those bounding boxes and build a bounding volume hierarchy out of them, which should make it feasible to render even the most complex models in a reasonable length of time. Bounding boxes and hierarchiesA faster renderer is a renderer that you'll be more willing to experiment with. Give it a try!
|
|
fs
New Member
Posts: 28
|
Post by fs on Jan 30, 2019 1:44:15 GMT
You really like that model, don't you
|
|
|
Post by Jamis on Jan 30, 2019 3:26:32 GMT
Yup. Also, it was handy and I wanted something besides the teapot.
|
|
|
Post by hokiecsgrad on Mar 5, 2019 17:47:13 GMT
Are those transparent boxes in the scene a visualization of your bounding boxes? Any tips for making those visible? I've tried a few strategies, but haven't figured it out yet.
|
|
|
Post by ascotti on Mar 5, 2019 21:50:02 GMT
|
|
|
Post by sbehnke on Jul 18, 2019 4:38:18 GMT
I’m making progress here but my inherited materials don’t seem to be working quite right. Also, my bounding boxes appears to be higher in y than should be, but I probably just applied the transformations backwards for those nested defined objects in the Yaml. Any tips on the expected behavior of the material inheritance?
|
|
|
Post by Jamis on Jul 29, 2019 14:21:15 GMT
Alas, my project laptop is off to apple for a battery recall, so I can't dig through my own code to share specifics. However, I've generally implemented material inheritance by having a method on Shape (or a utility function somewhere) that checks to see if the shape has a defined material. If it does not, it then walks the parent chain, looking for the first parent with a valid material. This does require that your language support optional values (perhaps null, or similar). In the root case, where a shape has no parent AND has no defined material, the method returns a new material with default values.
I don't know if that's helpful or not. It looks like you're on the right track, though, as far as the chapter goes!
- Jamis
|
|
|
Post by sbehnke on Jul 29, 2019 15:19:04 GMT
Thanks, Jamis. I got that scene rendering correctly, but I think I still have a problem with material inheritance somewhere in the Orrery scene. The long stems that hold up the planets don't seem to be shading gold, but I haven't dug into it yet. I got all 339 tests passing and took a bit of a break from it before I start adding more of a UI and more performance optimizations.
|
|