Scene Background - How to disable render texture

Using Naninovel C# APIs: adding custom actor implementations or commands, overriding engine services, integrating with other systems, etc.
Post Reply
Colin MacLeod
Posts: 7
Joined: 17 Jul 2022 21:09

Scene Background - How to disable render texture

Post 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.

idaot
support
Posts: 275
Joined: 01 Aug 2020 08:25

Re: Scene Background - How to disable render texture

Post 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.

Colin MacLeod
Posts: 7
Joined: 17 Jul 2022 21:09

Re: Scene Background - How to disable render texture

Post 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.

Colin MacLeod
Posts: 7
Joined: 17 Jul 2022 21:09

Re: Scene Background - How to disable render texture

Post 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).

idaot
support
Posts: 275
Joined: 01 Aug 2020 08:25

Re: Scene Background - How to disable render texture

Post 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).

Colin MacLeod
Posts: 7
Joined: 17 Jul 2022 21:09

Re: Scene Background - How to disable render texture

Post 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?

Last edited by Colin MacLeod on 19 Jul 2022 15:03, edited 1 time in total.
Colin MacLeod
Posts: 7
Joined: 17 Jul 2022 21:09

Re: Scene Background - How to disable render texture

Post 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.

Elringus
admin
Posts: 538
Joined: 11 May 2020 18:03

Re: Scene Background - How to disable render texture

Post 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

Elringus
admin
Posts: 538
Joined: 11 May 2020 18:03

Re: Scene Background - How to disable render texture

Post 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

idaot
support
Posts: 275
Joined: 01 Aug 2020 08:25

Re: Scene Background - How to disable render texture

Post 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.

Colin MacLeod
Posts: 7
Joined: 17 Jul 2022 21:09

Re: Scene Background - How to disable render texture

Post by Colin MacLeod »

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

Post Reply