Some Materials not working through Fog



Users browsing this forum: No registered users and 1 guest

Next topic
Previous topic
Post new topic Reply to topic  NeoAxis Forum Index » General » Help - Programming
Search for:
Author Message

Joined: Sat Apr 12, 2014
Posts: 5
PostPosted: Sat Jan 07, 2017 3:09 am Post subject: Some Materials not working through Fog
Reply with quote Bottom of Page Back to top
I've found an issue with certain materials rendering badly through fog. Particularly anything using AlphaBlend:-
neoaxis-fogissue.png

How to reproduce:-
Open "\Data\Types\DecorativeObjects\GrassGreen\GrassGreen.highMaterial".
Add the line "Blending = AlphaBlend" in the global section at the top.
Open the Map Editor and load the "MainMenu" map.
Delete the "MapCompositorManager" object to better see what's happening.
Adjust the "Fog" down to color "8 8 8" and "ExpDensity" to "999".


Possible code locations?:- ("\ProjectCommon\HighLevel Materials\ShaderBaseMaterial.cs")
line 2915
Code: Select all   Expand view
                     case MaterialBlendingTypes.AlphaBlend:
                        pass.DepthWrite = false;
                        pass.SourceBlendFactor = SceneBlendFactor.SourceAlpha;
                        if( lighting && !ambientPass )
                           pass.DestBlendFactor = SceneBlendFactor.One;
                        else
                           pass.DestBlendFactor = SceneBlendFactor.OneMinusSourceAlpha;
                        break;
                     }
line 3448
Code: Select all   Expand view
               case MaterialBlendingTypes.AlphaBlend:
                  pass.SourceBlendFactor = SceneBlendFactor.SourceAlpha;
                  pass.DestBlendFactor = SceneBlendFactor.OneMinusSourceAlpha;
                  break;
               }

Perhaps it needs something similar to how AlphaAdd works? (which works fine with fog):-
line 3474
Code: Select all   Expand view
            if( !allowFog || blending == MaterialBlendingTypes.AlphaAdd )
               pass.SetFogOverride( FogMode.None, new ColorValue( 0, 0, 0 ), 0, 0, 0 );

 
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  NeoAxis Forum Index » General » Help - Programming

Jump to:  

Next topic
Previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron

All times are UTC




Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group