![]() |
|
Help required with overrideBlend - 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: Help required with overrideBlend (/thread-3786.html) |
Help required with overrideBlend - The17thDoctor - 29-11-2023 I must say render.overrideBlend gives me a real headache. Im having trouble seeing how this function behaves and neither the GMod Wiki nor the OpenGL docs are helping me. What I want is to apply some color atop of a texture with varying alpha such as fully opaque parts of the texture will be e.g fully red and other parts just transparent red. RE: Help required with overrideBlend - Person8880 - 01-12-2023 Sounds like what you want is to use source colour, and destination alpha, so something like:
This assumes you're rendering this to a render target, as setting colour/alpha values in screen space wouldn't apply the transparency part in a visible way.Bear in mind also that rendering a transparent texture will itself blend with whatever it's rendering on top of, if you render a perfect alpha gradient on top of a black background you might get more colour than you originally expected. RE: Help required with overrideBlend - The17thDoctor - 01-12-2023 Thanks for the explanation, I find the comments very useful to understand what's happening in reality. My main confusion was that I thought that BLEND_ZERO and BLEND_ONE meant either fully black or fully white. This added to the fact that source and destinations were unclear to me made this whole ordeal take much more time than needed. |