#rendertarget-optimzation
1 messages · Page 1 of 1 (latest)
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?
by render targets I mean rendering the world as seen by a camera, if you are rendering UI elements onto a mesh/texture then that is much cheaper
ok still how do you "update" it or not? do you have any sample code for your cameras there? they look cool btw
for a license plate you would indeed only render the plate texture once when the entity is streamed in for example
there are controls in the widget for refresh rate and resolution scale, outside of this you can just turn it on or off via script
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
where is that rendertarget option coming from?
is there a component for them or something?
it's in the render target widget
ohhh in the ui editor?
yep
excellent thx
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?
it's a variable in the camera entity Index
you can get and set it
Where do i look for that?
what do you mean? it's defined in ScriptCamera.c on line 25
pip scopes set the Index then they create it I think
Ok, I'll take a look there. Thank you. I'm missing something fundamental and I'll probably have an "ahah" moment
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
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
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)
What component are you using to call the rendertarget?
the render target widget has a function SetWorld
it takes the world and the camera ID as arguments
Sorry, I haven't even got that far, I'm just wondering what component I use to call/reference the targetwidget, which I'm assuming is something like the PictureInPictureSightsLayout?
I was using the SCR_2dOpticsComponent, but all I'm getting is a black material
just make one
you will need scripting for this, I doubt there's something general purpose you can reuse in places
Ah well, unfortunately my scripting skills are pretty trash, so I'll have to wait until I can see how it is done
even if you had a working example you'd still need to write all the functionality that deals with a vehicle mirror
Oh, I'm not trying to do a mirror, just make a simple PIP of anything