|
Apprentice, Jr. Member
Posted: 31 August 2011 09:10 AM Total Posts: 45
I’ve recently started working with fog and had some issues with it. I’ve made a simple example that shows it as shown below.
On the left you see two planes, the one in the back is a plane with a non-transparent textured bitmapmaterial, the one in the front is a plane with a transparent textured bitmapmaterial (using a PNG, alphaThreshold = 0.5).
On the right I’ve put a fog method on both materials. As you can see the front plane nearly disappears, leaving a few pixels left (as if alphaThreshold changed to 1.0).
I can fix it using two seperate fogmethods and applying them on the materials separately: material1.addMethod(fog1); material2.addMethod(fog2); (instead of material1.addMethod(fog1); material2.addMethod(fog1);)
It seems I should not be using the same fog method for two different materials (or at least for transparent ones and non-transparent ones).
Is this intended? (Personally I’d like it if I can have one fog method for all materials and if I need to adjust it simply change that one fog method)
—Apprentice
|
Apprentice, Jr. Member
Posted: 12 September 2011 01:48 PM Total Posts: 45
[ # 1 ]
Ok, I now seem to be having this issue on two non-transparent textured materials. Should I always be making separate fog methods for each material?
—Apprentice
|
John Brookes, Moderator
Posted: 12 September 2011 03:04 PM Total Posts: 732
[ # 2 ]
No idea but
Been doing it like this
//loading stuff merging etc
//then
var fm:FogMethod = new FogMethod(200);
for each(var m:MaterialBase in MaterialLibrary.getInstance().materials) //<- I made materials public
{
if (m is BitmapMaterial)
BitmapMaterial(m).addMethod(fm);
}
Not noticed an ‘visual difference’ between
BitmapMaterial(m).addMethod(fm);
and
BitmapMaterial(m).addMethod(new FogMethod(200));
|
Apprentice, Jr. Member
Posted: 12 September 2011 03:26 PM Total Posts: 45
[ # 3 ]
Do you also have transparent materials with an alpha threshold to which you are applying the fog to?
If not, could you test this? Just want to make sure I’m not the only one with this problem which would indicate that I’m doing something wrong and I’d like to know about that.
|
John Brookes, Moderator
Posted: 12 September 2011 03:55 PM Total Posts: 732
[ # 4 ]
Acutally it does make a difference.
Didnt notice it As I was in the cab view.
if I dont use new method for each material the tree and cab body go white.
Cab doesnt have alpha but does have enviro so that also goes white.
|
Apprentice, Jr. Member
Posted: 13 September 2011 07:16 AM Total Posts: 45
[ # 5 ]
Ah, thanks John
Ok, so the question remains: Is this a bug or is the standard usage to make a new (fog) method for each material? If this is standard usage then if we want to remove the fog then we need to have stored each created fog method for every material as we need to supply it in the removeMethod. Not very convenient, but you can’t have everything
|
Alejandro Santander, Administrator
Posted: 13 September 2011 03:23 PM Total Posts: 414
[ # 6 ]
I think that the standard usage of fog does not require one fog method per material. Definitely not.
Let me do some tests to check if there is something wrong with fog in the current state of Away3D 4.x.
Will keep you posted!
|
|
Apprentice, Jr. Member
Posted: 16 September 2011 07:09 AM Total Posts: 45
[ # 8 ]
Thanks for your reply and your issue report
|