• surface.DrawTexturedRect randomly rendering incorrectly.
    3 replies, posted
So I have been working on a sort of Lens Flare Post Process, and it uses this particular function to render flares on screen. However, it seems to randomly not work, and I have absolutely no idea. Basically, there are times where it renders everything correctly, and it looks great. Then, at others, even on the same map, the textures will be almost invisible, and look almost like a bunch of very faint red lines that can barely be seen. This isn't the entire thing, but this is essentially the gist of the parts that actually handle the screen-rendering: [CODE] local function DrawSunFlare() local Flare = Material("sprites/light_glow01") Flare:SetMaterialInt("$spriterendermode",9) Flare:SetMaterialInt("$ignorez",1) Flare:SetMaterialInt("$illumfactor",8) Flare:SetMaterialFloat("$alpha",0.6) Flare:SetMaterialInt("$nocull",1) local DrawColor = Color(ColorR:GetFloat(),ColorG:GetFloat(),ColorB:GetFloat(),ColorA:GetFloat()) surface.SetMaterial(Flare) surface.SetDrawColor( DrawColor ) surface.DrawTexturedRect(blitX,blitY,SizeX*blitScale,SizeY*blitScale) end hook.Add("RenderScreenspaceEffects","postproc_draw_lensflare",DrawSunFlare)[/CODE] Is the weird rendering an engine error? Screenshots: With it enabled: [IMG]http://i.imgur.com/VPpsx.jpg[/IMG] With it Not: [IMG]http://i.imgur.com/g8Hbk.jpg[/IMG]
Updated with Screenshots.
Do you mean the cut edge? Usually that's simply indicative of a poorly-designed sprite.
[QUOTE=wizardsbane;35719556]Do you mean the cut edge? Usually that's simply indicative of a poorly-designed sprite.[/QUOTE] No, it's not the sun. It's a Lens-Flare. Look above it a little. See the random-red lines? The sprite I'm using is completely different, and built into Source Engine by default. Works perfectly normally. I don't understand why it's not rendering the texture, and just spitting out these weird little lines instead.
Sorry, you need to Log In to post a reply to this thread.