• 0

Need a little help with TrueGlass config


@turbofandude Hello Collin!!

I would like to ask you some help with TrueGlass shader file.
I'm tring to add the TrueGlass on a old project of mine (personal, not commercial, and not ditribuited as freeware or payware, naturally as i signed the contract), but unfortunately i don't have no more the source 3D, so i cannot change the UV mapping of the windshield.
UV mapping in 3D model is 90 degrees rotated :-( so the drops and streaks fall horizontally from left to right.
I've found out that in the TrueGlass.hlsl i can change the BL, TL, BR, TR variables to completely invert the fall direction, for example:
Adding a minus before the variables:

v.p = float4(-bl, 0, 1)
v.p = float4(-tl, 0, 1)
v.p = float4(-br, 0, 1)
v.p = float4(-tr, 0, 1)

i can invert the direction.
How can i just rotate 90 degrees the direction?
Thanks a lot!!!

Share this post

Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

The TrueGlass shader is somewhat hard to read, but one way you could do it would be to edit the v.p and/or v.t coordinates in the GS function. Although it's not the easiest solution, applying a transformation to the vertex data before triStream.append(v) call could rotate it.

Here is a stack overflow post that explains it better: https://stackoverflow.com/questions/28124548/rotate-quad-made-in-geometry-shader

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.