New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
render.DrawLine alpha doesn't change if WriteZ is true #1086
Comments
I'm not sure what you're trying to do but isn't that completely normal? If you're going to draw something that isn't fully opaque, there is no reason to write it to the Z-buffer. If WriteZ is true then you shouldn't even be using a transparent color in the first place. |
I am pretty sure they just use $noz materials. Those functions are mainly aimed for debugging anyway. |
"write z", not "read z". $noz ignores depth buffer checks so the line renders on top of everything. What he means is making lines write to the depth buffer so that props rendered afterwards do not render on top of them even if they're behind. But as soon as you start using transparency, you can forget about the depth buffer. |
The last parameter is more of a dontIgnoreZ parameter, so right now it's a choice between having alpha or not rendering above everything else, which sucks. Both lines are white with alpha 128. It'd be nice to be able to render lines with alpha and have them clip correctly. The code used to make the picture above:
|
Should work if you draw the lines after the boxes. Again there is no way to do proper depth clipping when transparency is involved, you have to order the draw calls yourself. Which is why opaque and translucent rendering are separated in the first place. Not sure why it's going straight through the floor though, it's not supposed to do that, I'll look into it. |
I just tried it; it does fade in and out; alpha does work?? I'm using DX 8 because of the NVidia Driver Crash when rendering vehicles and client-side models. |
Can you try DX9 and test it? |
Testing it now with mat_dxlevel 90 |
Using the alpha from the line with it just to the left still in frame using second code snippet: http://cloud-3.steampowered.com/ugc/3317210380556220712/F8D75E2102DBB94DE25CD2249F0B7BF95B396355/ http://cloud-3.steampowered.com/ugc/3317210380556223424/B51E836689F9F07D1A1AE440BB3A7CEE31F74CEC/ http://cloud-3.steampowered.com/ugc/3317210380556226701/CD01FF7BDC8BDD4DAAFB9F26227C3E6343A44F93/ Right line doesn't change... Edit: Going to try this last one in dx 81 again to see if there is a change. Same result with DX 81 - the one line does NOT change, also appears funky; you'll see that it the photos. Interesting bug. Testing it in DX Level 11 - mat_dxlevel 110 -- Results are the same.. |
Still nothing... |
The alpha for render.DrawLine is ignored when WriteZ is true.
This also happens for render.DrawWireframe*
Test code:
The text was updated successfully, but these errors were encountered: