-
Notifications
You must be signed in to change notification settings - Fork 93
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
Added support for transforming homogenous W geometry into world geomtry #199
base: master
Are you sure you want to change the base?
Conversation
Thanks @dkollmann! I will take a look at this soon. |
Also FYI if you try this code with Black & White, things will have a blue tint. This is because the water plane which should be rendered before all the other geometry, is rendered on top of it instead of behind the other geometry. |
… disable lighting. Commented out unneeded XYZW code.
7c87321
to
e8ff88d
Compare
I made some fixes. Of course lpD3DMatrix has to be replaced, after getting the game camera properties from it. The force push was just an update on the commit comment. |
Ok, I figured this out. You have to set |
My only last comment is that I prefer to create a struct and add it to the Other than that, I think this is about ready to merge. |
Ah okay, I created the RenderData.h, because it was not possbile to include the device header in the DebugOverlay.cpp file. |
|
It seems like there may be more than just something wrong with With How it is supposed to look: I can also see it even when just |
Okay, here are the things are are wrong here and why "position" is zero.
The result will be the same, but the code should be a bit clearer. So what happens is...
I hope this all makes sense and is correct. Please take a look. |
Not sure if it is related, but I noticed something curious with the reconstructed world space in Black & White. The whole world is rotated by 24.4° degreees. But the thing is, if you look at the trees at the bottom left, they are straight, which implies that this is correct. I wonder why this is. Is this due to the angle of the reflection? In game, the camera is completely horizontal. I checked the original view matrix. But I also noticed that the Y direction seems to be flipped. It is negative when looking up and positive when looking down. |
Okay this seems to be a Black & White thing. No matter how I look att he view matrix, the angle only seems to be half of the actual angle. MAybe this is related to faking bent normals. |
Hey Elisha, so I finally got around to take a closer look at this for Black & White. So for me, the practical difference between DdrawConvertHomogeneousToWorldUseGameCamera is that I use the original view matrix to remove the camera's tilt, so the world geometry comes out as horizontal. This way I can place a new water plane and it will always correctly align with the terrain. Of course this also means that the code became quite specialised for Black & White now and it might be a better option to remove DdrawConvertHomogeneousToWorldUseGameCamera, unless you see general value in this special case. And just as a note, in the following code, yaw and pitch look like they should be the other way around, but this is indeed correct. Yaw is the rotation of X and pitch is the rotation of a vector around X. Here is what I do now:
|
@dkollmann, sorry for the delay in responding. I updated the code to match your branch. But I am wondering if there is an issue with Could there be an issue because we are losing data in the The reason I ask is because I am still seeing distortion in the sky in Dark Reign 2 whenever |
Hey, I just wanted to say that I am still on this, but I changed my job and am moving to another country, so lately I am super busy. |
@dkollmann, no problem. Take your time. I understand. Real life has to come first. Thanks for letting me know. |
Because there are a lot of things added since this PR was created, I updated it to keep it in-sync with the master branch. |
Keeping PR in-sync with master branch. |
This is an update on the previous pull request #188.