Fading texture

Started by
6 comments, last by Nik02 8 years, 9 months ago

I'm trying to create something like a Source func_monitor (https://developer.valvesoftware.com/wiki/Func_monitor) in a D3D hook for an old game. I've gotten it to render my view fine at close ranges to the texture, but as I move away, it gradually becomes transparent, or fades to black if I turn alpha blending off. I can't tell why this is happening, especially since it doesn't happen at all if I just render a e.g. a solid green texture the same way, it only happens when I render my RT texture. Does anyone know what could cause this effect?

Advertisement

You are probably not filling the mipmap chain of the texture.

Niko Suni

lol yeah that was it. Thank you. :)

when I render a different view now, it stops rendering parts of the texture at certain angles/positions (depends on the view), and occasionally has a weird transparent silhouette of my char model or other patterns, like http://i.imgur.com/R6Joobp.jpg

With so little information, we're not really going to be able to help. What we *can* do is help you help yourself. Have you tried using a graphical debugging tool to analyze what's going on? If not, I'd suggest RenderDoc (https://github.com/baldurk/renderdoc) or VSGD (Part of Visual Studio 2012+). Other options include Intel's GPA or the much older PIX for Windows (which tends to not work well if you have the Windows Platform Update installed).

That will let you (at a minimum) look at your resources (textures and frame buffers) during the frame, which should help narrow down what's not working.

RenderDoc doesn't support D3D9, VSGD doesn't seem to want to work with dlls, and it doesn't seem like GPA would either

If I render the texture to a section of my screen, it looks fine, though. I'm not sure what else I could check.

My renderer is in a dll and it works just fine with both VSGD and GPA.

If the fading is angle-dependent, it could be anisotropic filtering kicking in. How did you fix the mipmap issue?

EDIT: now that I took a look at the image, I believe you may have some z-buffer issues smile.png

That said, we can't be sure, since we have limited information available.

Niko Suni

This topic is closed to new replies.

Advertisement