Scene Background - How to disable render texture

Posted: 17 Jul 2022 21:12
by Colin MacLeod

When I use the scene background, it automatically looks for a camera in the scene to attach a texture.

Can I disable this functionality? I have a complex 3D scene, and it wasn't rendering correctly. Also, I've found render textures to be very resource intensive in the past.

I really just want to use a regular camera in my scene and use layers so it doesn't clash with the Naninovel camera.


Re: Scene Background - How to disable render texture

Posted: 18 Jul 2022 07:08
by idaot

It's not possible, all actor implementations except for generic are rendered onto a mesh texture and for scene backgrounds it necessitates a camera.

Use generic backgrounds for when you want a proper 3D background, or create your own actor implementation https://naninovel.com/guide/custom-acto ... -resources.


Re: Scene Background - How to disable render texture

Posted: 18 Jul 2022 14:18
by Colin MacLeod

Here's what I'm doing as a workaround.

I created 2 cameras in the scene: one (dummy) on a disabled gameobect under root, the other (real, perspective) under an empty parent.

The 3D scene background is appearing behind the Naninovel dialogue and characters and it all seems to work as I would like.

The only issue is I have the extra dummy camera and the unnecessary render texture. I was looking for a way to stop it looking for the root camera since it's disabled anyway.


Re: Scene Background - How to disable render texture

Posted: 18 Jul 2022 15:03
by Colin MacLeod

I guess I could just roll my own "load scene" command and use it instead of @back [scene name]?
That would get around another issue - your command forces all the scenes to live in a project root folder called Scenes (I'd prefer to have them under _Project/Scenes to separate project files from assets).


Re: Scene Background - How to disable render texture

Posted: 18 Jul 2022 17:16
by idaot

As I already suggested - use generic backgrounds if you want to get rid of the camera and render texture, or create your own actor implementation. There is no other way around that.

Your other issue can also be fixed by creating a custom actor implementation (you can use SceneBackground.cs as reference).


Re: Scene Background - How to disable render texture

Posted: 19 Jul 2022 14:55
by Colin MacLeod

Sorry, I may be being slow here, but I don't think I understood what you already suggested.

What do you mean by "generic backgrounds"? Surely, I don't want to show one of the standard backgrounds or it will block my scene?

Also, I'm not sure what you mean by:

Your other issue can also be fixed by creating a custom actor implementation (you can use SceneBackground.cs as reference).

What other issue are you referring to here?


Re: Scene Background - How to disable render texture

Posted: 19 Jul 2022 14:57
by Colin MacLeod

to be clear, I have my 3d background organized as multiple Unity scenes. I want to be able to switch between them.


Re: Scene Background - How to disable render texture

Posted: 19 Jul 2022 15:18
by Elringus

If you're using scenes and don't want to use render texture (which is required for a lot of stuff, like transition effects, transforms, semi-transparency overdraw handling, etc), there is no need to use Naninovel's backgrounds at all. Just use @loadScene and @unloadScene commands: https://naninovel.com/api/#loadscene


Re: Scene Background - How to disable render texture

Posted: 19 Jul 2022 15:20
by Elringus

Alternatively, instead of embedding scenes to Naninovel flow you can embed Naninovel to your custom flow / scenes. See integration guide for more info: https://naninovel.com/guide/integration-options


Re: Scene Background - How to disable render texture

Posted: 19 Jul 2022 17:26
by idaot
Colin MacLeod wrote: 19 Jul 2022 14:55

What do you mean by "generic backgrounds"? Surely, I don't want to show one of the standard backgrounds or it will block my scene?

https://naninovel.com/guide/backgrounds ... ackgrounds

Regarding your other issue, I meant changing the path for loading the scene asset. That path of the code is stored in SceneBackground.cs, which you can refer to when creating your own implementation.


Re: Scene Background - How to disable render texture

Posted: 20 Jul 2022 02:19
by Colin MacLeod

Oh, that's excellent - thank you so much for the explanation. This looks like exactly what I was looking for.