![]() |
|
Get RenderTarget texture names - Printable Version +- Team Spartan Cookies & Milk Forums (https://teamscm.co.uk) +-- Forum: Garry's Mod (https://teamscm.co.uk/forum-4.html) +--- Forum: Starfall (https://teamscm.co.uk/forum-7.html) +--- Thread: Get RenderTarget texture names (/thread-3656.html) |
Get RenderTarget texture names - frdhog - 09-06-2021 It'd be really handy if we could get a function that is able to get a render target's texture name (starfall_rt_[x]_[width]_[height]) without resorting to brute force or checking the texture list. Of course, this would become invalid when an RT is freed and overridden but it would still be invaluable when avoiding rendering common elements multiple times if it is communicated between starfall chips RE: Get RenderTarget texture names - The17thDoctor - 09-06-2021 (09-06-2021, 07:47 PM)frdhog Wrote: It'd be really handy if we could get a function that is able to get a render target's texture name (starfall_rt_[x]_[width]_[height]) without resorting to brute force or checking the texture list. I support this idea, it could be really handy. Even handier could be to be able to get renders from other screens / emitters ( that we own ) through starfall this way. That way we could make things like simple starfall emitter repeaters and such. ( If its possible ) RE: Get RenderTarget texture names - Red The Blue Color - 10-06-2021 You can use globaltables and channels to send the RT to different screens/emitters/huds/whatever else renders kek, so making emitter repeaters and etc is rather easy. RE: Get RenderTarget texture names - The17thDoctor - 10-06-2021 Thought about that too, never tested it. However itd mean that I have to use 2RTs in my render which is doable but not ideal imo. RE: Get RenderTarget texture names - frdhog - 10-06-2021 After trying it out, I can't deny the usefulness of sending the object itself but I feel it would be more efficient to just send the texture name itself. But through my testing, I have found that the name alone doesn't seem to be very helpful as it can't be used with the Material, render.getTextureID or render.setTexture functions. This means we are unable to use 2D render operations such as drawTexturedRectRotated or drawTexturedRectUV. Although I admit a similar effect could be gained with some 3D contexts. Getting the name would give the ability to get the width and height get if they were lost of somehow, but that would be better suited to a metatable addition. I realise a texture name may just create more problems (having to create compatability with other render operations) but it allows alternative transportation methods, such as the net library. RE: Get RenderTarget texture names - Person8880 - 10-06-2021 You can already pass the texture object into render.setTexture(). There's no need to have the name. |