Jump to content

Right-handed system does not work with fog?


zhutq
 Share

Recommended Posts

I think it's safe to assume that fFogDistance is not negative, because fog is computed according to its distance to the camera.

If I modify fogVertex.fx to be

#ifdef FOG
fFogDistance = abs((view * worldPos).z);
#endif

and the end of sprites.vertex.fx to be

	// Fog
#ifdef FOG
	fFogDistance = abs(viewPos.z);
#endif

I can get correct fog for both left-handed system and right-handed system.

Is this solution correct?

Link to comment
Share on other sites

Wow, interesting, zhutq!  Sorry for slow replies. 

This is a "big dog" issue... for people much smarter than I.  But I wanted to say... that it is extra cool that you went digging deep for solutions, and in shader code!  Good initiative, and bravery!  Good troubleshooting and interesting findings.

It has been a "sleepy weekend" on the forum.  Now it is a new week - perhaps more readers, soon. 

I am going to ping @Deltakosh and @NasimiAsl and I should probably ping @Nabroski too.  I should ping some other Gods, as well, but we'll start with these 3.  I'll bother more people at mid-week, if replies remain low.  :)  Again, good code-sniffing, z!

Link to comment
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.

Guest
Reply to this topic...

×   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.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...