fix: ViewDirection not working for Wave mesh#1258
Conversation
The wavelet nif is not a skinned/envmap/parallax mesh But it should still have a proper world matrix and view direction. RenderDoc capture shows its current ViewVector is mostly -input.Position. With the eye position fixed, I think we should always use the world position instead model space position.
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (1)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
|
✅ A pre-release build is available for this PR: |
doodlum
left a comment
There was a problem hiding this comment.
This will break anything that uses model space view direction. If you want to use worldspace, you can do so specifically on the pixel shader for translucency using worldspaceViewDirection and worldspaceNormal. tbn is worldspace at that point in the shader, you just need to reinit tbnTri
|
Thanks for the clearification, I think we are probably missing a #if defined flag for that nif's setting. that mesh certainly looks like a world space one, but I'll go confirm it:) I'll try find the define flags instead. #Btw, is MODELSPACE_NORMAL the flag indicating model space rendering? |
|
Model space is the default unless envmap, skinned whatever. check the defines. probably i will do some more patches tomorrow to force worldspace on everything |
|
Yeah, this is certainly redundant with the doodlum magic in #1266 :) |
|
Until the other pr is merged, we can't know if this is redundant. Perhaps the other pr permanently breaks something so we can't use it. |
|
I'll do some play with this change and see whats broken locally as a backup plan :) |
When investigating #1230 , I notice the wavelet nif is not a skinned/envmap/parallax mesh.

And RenderDoc capture shows its current ViewVector is mostly -input. Position.
Because these wavelet quads are just z-up rectangle, with constant normal
(0,0,1), the angle between view and normal,dot(view, normal)was evaluate to constant 0, not affecting by view angle at all...With the eye position fixed, I think we should always use the world position instead of the model space position.