aaronwalsman / splendor-render

MIT License
4 stars 0 forks source link

textures and cube_maps as separate asset types #16

Open aaronwalsman opened 3 years ago

aaronwalsman commented 3 years ago

textures and cube_maps are currently owned as part of a material or image_light. These should be broken out into separate asset types that materials and image_lights point to.

aaronwalsman commented 3 years ago

Did this for textures, and so far I like it. Doing it for cubemaps too, may also break out background_cubemap as a separate entity rather than making image lights renderable.

aaronwalsman commented 3 years ago

Cubemaps are now their own separate assets too. I started to think about the background-cubemap idea, but some weirdness arose: what do we do about the offset matrix that used to live in the image_light in one place? We want to be able to rotate the image light, but when we do, the background should also rotate. We could add an offset to the background as well, but then it's the users' responsibility to make sure ever thing stays in sync. We could add an offset matrix to the cubemap asset itself, but then we need to make sure the reflection and diffuse cubemaps stay in sync. A final idea would be to include offsets in the cubemap assets, but then also build a grouping structure that could also be used by instances to make hierarchies. Then you simply group the diffuse and reflect cubemaps, and transform the group. This is a bit more involved though. Not sure how I want to handle it, so I'm tabling the issue for now.