#rendertarget-optimzation

1 messages · Page 1 of 1 (latest)

brave wolf
#

How did you decide when to update a render target? We used them for an early prototype of license plates on vehicles and in theory they only ever need to be rendered once. Also Even if the license plate is front and back they show the same thing, so any way to re-use them to reduce the amount of gpu work to handle them?

prime vessel
brave wolf
#

ok still how do you "update" it or not? do you have any sample code for your cameras there? they look cool btw

prime vessel
#

for a license plate you would indeed only render the plate texture once when the entity is streamed in for example

prime vessel
#

I imagine something as small as a vehicle mirror does not need 100% resolution scale and might be just fine with refreshing every second frame, which should drastically reduce performance impact

#

also you could only "turn on" the mirrors when the player is in the vehicle

brave wolf
#

where is that rendertarget option coming from?

#

is there a component for them or something?

prime vessel
#

it's in the render target widget

brave wolf
#

ohhh in the ui editor?

prime vessel
#

yep

brave wolf
#

excellent thx

livid vine
#

How do you know what the camera number is?

#

The only examples i have are of the pip scopes, but i don't see any additional camera entities created which confuses me? Is there somewhere i can check the camera instances and their id?

prime vessel
#

you can get and set it

livid vine
#

Where do i look for that?

prime vessel
#

what do you mean? it's defined in ScriptCamera.c on line 25

#

pip scopes set the Index then they create it I think

livid vine
#

Ok, I'll take a look there. Thank you. I'm missing something fundamental and I'll probably have an "ahah" moment

prime vessel
#

one thing I don't know much about is how do you know which camera index you can use, as in making sure you use one that is not already used by some other camera

#

and there is a limit of 32, which if you only need a couple locally is no biggie but still

median jackal
#

This gave me an idea:

  • have multiple sizes of a small object with RT texture that's placeable.
  • create prefabs of those
  • add the prefabs to cars, transform, rotate to fit the mirror
    boom you got mirrors on all vanila vehicles
prime vessel
#

I would suggest only turning "on" the mirrors for the vehicle if you're inside it

#

spawn the cameras when you get in, delete when you get out (or vehicle dies etc)

livid vine
#

What component are you using to call the rendertarget?

prime vessel
#

it takes the world and the camera ID as arguments

livid vine
#

I was using the SCR_2dOpticsComponent, but all I'm getting is a black material

prime vessel
#

you will need scripting for this, I doubt there's something general purpose you can reuse in places

livid vine
#

Ah well, unfortunately my scripting skills are pretty trash, so I'll have to wait until I can see how it is done

prime vessel
#

even if you had a working example you'd still need to write all the functionality that deals with a vehicle mirror

livid vine
#

Oh, I'm not trying to do a mirror, just make a simple PIP of anything