-
Notifications
You must be signed in to change notification settings - Fork 363
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
Reflect Glasses effect problem. #367
Comments
I have a fix/workaround for this, but TBH it looks kinda shitty: d3-mirrors.mp4Note that "ghost" of the player to the right (well, you mostly see a big hand with a flashlight), which (I think) is the reflection of your reflection of your reflection, or something like that? |
Hmm could also be that it's not a reflection of a reflection but that it looks so weird because |
It used to crash because after recursing into R_MirrorPoint(), which calls tr.CropRenderSize(), about MAX_RENDER_CROPS times, CropRenderSize() wrote behind the end of tr.renderCrops[] and damaged a pointer. Even if it didn't crash because of that, endlessly recursing is a bad idea, so it's limited now. The limit can be configued with the new r_maxMirrorRecursion CVar, but the hard limit is MAX_RENDER_CROPS-3 = 5 Another problem was that mirrors and other subviews render into a texture, specifically globalImages->scratchImage ("_scratch"), so it could happen that it got written to several times before being used. Now there are 8 scratch images (+ the original "_scratch" which is also used by gamecode) that the subview code cycles through to minimize the chance of overwriting something that's still in use.
See #646. Not sure it's really correct now, sometimes things appear in the mirror that shouldn't.. but OTOH Doom3 is a horror game so that might be ok ¯\(ツ)/¯ Looks better than before though and, most importantly, doesn't crash anymore. |
Updated video now that it's less broken: d3-mirrors-fixed.mp4 |
This effect is present in Doom 3 Alpha Leaked, from 2002.
So I've found a file for materials to implement this effect into the game.
The file is implemented in:
materials\glass.mtr
Here's the code:
However, this have a problems causing crash when there's more 1 windows/glasses in one scene.
So if anybody can suggest me a way to implement this, this will be great.
Also have a znear problem when you're close next to the windows, you can see how some part of the player model are cutting through the scene in the glass.
So, this have a lot of problems that need to be solved.
I'll make a MODDB channel to share this soon.
Take a look:
https://i.imgur.com/vAEvfda.jpg
https://i.imgur.com/kHRl2B7.jpg
Video:
https://www.youtube.com/watch?v=YeGRvsxSWG4
reflectglass.zip
The text was updated successfully, but these errors were encountered: