crest icon indicating copy to clipboard operation
crest copied to clipboard

Explore what multiple ocean instances would mean

Open huwb opened this issue 3 years ago • 2 comments

Status: Definitely not ready to merge. I'm creating this as someone enquired about it and it took me a while to find it.

Experiment with what would be required for multiple oceans: #540

This branch should work like before in the case of a single ocean. There are a few issues before it will support multiple instances.

Questions / problems that arose:

  • [ ] RegisterLodDataClipSurface - this sets per-ocean data on MPB. might be tricky to fix..
  • [x] How to connect underwater effect to ocean instance?
  • [ ] How to connect underwater environment lighting with ocean instance?
  • [ ] OceanChunkRenderer.OnWillRenderObject - tiles will need Layer so it only goes in one camera??

Misc notes:

  • [ ] Validation gets passed "AnyInstance" in a few places, is this ok?
  • [ ] RenderData.Validate - uses any instance
  • [ ] Debuggui always takes first instance of ocean, shall we make this selectable?
  • [ ] Lod data resolution should be global setting, right now taken from one instance

huwb avatar Sep 12 '20 18:09 huwb

I have the following assumption:

~~Each camera can have many ocean instances. Each ocean instance must have only one camera.~~

Going with the simpler assumption of a one to one mapping with camera and ocean.

How to connect underwater effect to ocean instance?

~~We could do a camera lookup. It would require #677 so that we have a reference to the camera.~~ Done

How to connect underwater environment lighting with ocean instance?

Same as above. Although, developers would have to use light layers and have two separate lights for it to work. I think we should instead add validation stating that this component doesn't support multiple instances. And maybe add support in the future.

OceanChunkRenderer.OnWillRenderObject - tiles will need Layer so it only goes in one camera??

We already have this for built-in. I think SRP uses something different. We could validate this if we have a camera property.

Validation gets passed "AnyInstance" in a few places, is this ok?

We should be passing all instances. Since these components are shared by both instances, they should be valid for both instances. The validate function will need to be updated to take list of OceanRenderers. I will look into doing this at some point.

daleeidd avatar Oct 28 '20 18:10 daleeidd

Updated above comment.

daleeidd avatar May 24 '21 04:05 daleeidd