[Softpoly] Mirrors crash the renderer
Posted: Tue Dec 06, 2016 2:59
https://github.com/raa-eruanna/qzdoom/c ... a3d7b8bd6b
I was able to load in a debugger and put in these pointer checks (one affects the ZDoom code, however, which is why I didn't merge it into the master, but feel free to merge it if you like).
Basically, it seems like the portals for mirrors are yet undefined.
From my understanding, mirrors are done like this:
MirrorViewPosition = (xyz)MirrorStart * 2 - (xyz)View // (edit: come to think of it, this needs to also be rotated based on the MirrorLine angle, too, and then rotated back)
MirrorViewAngle = (angle)MirrorLine * 2 - (angle)PlayerView
MirrorViewMatrix.Z *= -1
I do not know how to hook that up into the triangle drawer, though.
I was able to load in a debugger and put in these pointer checks (one affects the ZDoom code, however, which is why I didn't merge it into the master, but feel free to merge it if you like).
Basically, it seems like the portals for mirrors are yet undefined.
From my understanding, mirrors are done like this:
MirrorViewPosition = (xyz)MirrorStart * 2 - (xyz)View // (edit: come to think of it, this needs to also be rotated based on the MirrorLine angle, too, and then rotated back)
MirrorViewAngle = (angle)MirrorLine * 2 - (angle)PlayerView
MirrorViewMatrix.Z *= -1
I do not know how to hook that up into the triangle drawer, though.