• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

FSXA Volume Shadow cause flickering

jtanabodee

Resource contributor
Messages
3,924
Country
thailand
Hi,
Regarding this thread :http://www.fsdeveloper.com/forum/threads/volume-sha.dow-cause-the-default-shadow-disappear.427439/#post-650660
There are rules for this volume shadow:
1. The model has to be manifold, water tight.
2. Vertices have to be normalized, no shading just only volume shadow.
3. No base material specular.

I still fighting with volume shadow because I think it will be good for the hangar that the airplanes and stuffs inside will have shadow by the hangar. I need not to do texture baking.

Here it is how it looks in the hangar. The shadow casts nicely over those Air Asia A320.



I didn't plan at first to use volume shadow, so I detach polygons separately and extrude then cap the hole to make it like a box for each polygon. Yes, it is manifold objects but the shadow keeps flickering. You can see at those arrows. It is flickering so much.



Then I make a box on the same scene (same gmax file) but it is still fickering. The box is on the right side of the hangar. So it is not a manifold problem since that box is ABSOLUTELY manifold.

Oh man! It is heartbreaking. I need to do it again all over.

So I tried to make a simple box to test in another file and export as a separate mdl and bgl. The flickering disappear.
I copied the same box and export again, this time contain 2 boxes in the scene.

Those two boxes has no flickering. You can see at this picture, the box was imported from the previous file. So those three boxes are identical.



So to my conclusion, I think if you need volume shadow, you need to do it by primitive box, cylinder. If you make a plane, extrude the polygon and cap the hole, this is not working. Moreover if you have only one piece in the same file doing without primitive boxes, it will ruin the other manifold models to get flickering too.

I will come up again when the things get done and I will have a conclusion for Volume Shadow for scenery.
 
Last edited:
Tic, this looks great, but I really suggest you avoid volume shadows...

Just using them on one or two objects will look odd and using it on everything will destroy performance for such a massive airport.

I have even gotten rid of ground shadows for my low poly cars and have gained 10-15fps.

UK2000's massively high poly airports have shadows disabled too hence they have very high fps.
 
Thanks Shuan for your suggestion. I think if would be benefit for hangar since there are some airplanes and stuff inside and I hate them when it stay bright and stand out from the shadow of hangar. I did try texture baking and it looks bad during early morning and late evening when the sunlight is angle. If it hurts frame rate so much, the user can turn it off. I think it is better to have choices to choose. Most of the reason, I would like to try that and I think I got it now.:yikes:
FPS is not that bad for just only one thing in one place.
This is the final work:



You can see the red frame rate over there. It is 44.4 fps! on WindowsXP QuadCore Q8200 @2.33 GHz only 2.00 Gb of ram. Very impressive! But if there are number of volume shadow objects such as jetways, or light poles, I don't think the frame rate would be like this.

This is how it is done.
I made a box with 2 segment on the width and move vertices to get the shape of the hangar.
Then I clone it and reduce its size a bit and move some poly to do Boolean on the original box.

Finally I got this after Boolean which is absolute manifold.



__Edited: something are deleted due to wrong understanding.____
 
Last edited:
Hi Shuan,
I have a picture to prove that volume shadow casts the same amount of shadow if you Normalized all the vertices.



The hangars near to you are volume shadow. Please notice how the shadow casts on the airplanes inside. Those are static airplane with normal texture.
The hangar far from you is normal texture, no volume shadow. Those two shadows generate by both material are the same shade. You cannot notice any differences.
The airplane inside the big hangar stand out. No shadow on it. Please click on the picture to see more detail.

I would say, I love it so much.
 
One last thing, I did the model in 3dsmax 2012 and exported it with P3d. The whole thing became flickering. But no problem if I make it in Gmax and export to be MDL. I'm not quite sure what cause that. However, if you want to make volume shadow, stay in Gmax make life easier.
 
Sorry what do you mean not normalize the verticies? Assume vertical normal?

Looks good mate!
 
I'm sorry. Yes, Assume vertical normal. I have edited that.

I did some more experiments in Gmax. I made a plane and extrude and cap the hole. It works! Even I attached them together it still works. I doubt that the problem of flickering is the exporter of P3d . I still use the old one not P3d v2.0. But in Gmax it works fine.
 
Last edited:
I try to use MCX for drawcall batching and it cause flickering shadow. Any ideas?
 
Hi,

And if you used 3ds max it also flickers? The 3ds max output has drawcall batching by default. Maybe that's the problem.

Did you try to compile the 3ds max output with an empty xanim file to see if the flickering is then gone?

Sounds like the drawcall batching logic in the engine might cause this. So maybe volume shaded buildings should not have drawcall batching?
 
3dmax does cause flickering all the time. So I guess you are right about drawcall batching cause that.

I did it once on animated train so it should not has any batching. That train casts shadow fine with volume shadow.

I will try to do just only earth curvature correction and do the LOD without drawcall batching. I will tell you how it does later.
 
Last edited:
So all the problem of flickering shadow caused by drawcall batching only.
3dsmax has drawcall batching by default, so exporting from 3dsmax cause flickering shadow.
Gmax has no drawcall batching, so exporting from it cause no flickering.

Conclusion would be:

1. Manifold shape, water tight. No mater of what it is from, you can make plane extrude and cap the hole. You can attach everything together.
2. Assume vertical normal. To eliminate the shading from the game engine make it too dark on the sunshades area.
3. Do not do drawcall batching. If you do this in 3dsmax, you need to add empty xanim to prevent drawcall batching. If you work from Gmax, just export as it is and don't do drawcall batching through MCX.
4. Do not use two material together. You need to use volume shadow to all the model in the scene that you are going to export as MDL. If you do that the shadow from conventional material will be eliminated.

I have tested on my i5 3.3 ghz 4G of ram and Win7 64 bit. I got almost 40-50 fps in this area, in other area is almost 60fps. So a few things of volume shadow do not hurt much fps.
 
Last edited:
Hi Tic,

Thanks for sharing, interesting finds.

For the performance the drawcall batching is very important, but it seems to have so negative side effects for some other features as well. Like the volume shadows and I have also read about issues with shadow offset for normal shadows caused by the drawcall batching.

I'm afraid that's due to the way the engine is coded to do the drawcall batching.

Since most developers would use the volume shadow only on important objects, I guess these can live without drawcall batching. Such objects usually have an unique texture already.
 
This is how to make empty xanim;
1. Open notepad
2. Copy the text below.
3. Save it.
4. Edit it from .txt to be ---your x file name--.xanim.
5. Compile to be as animation x file to get MDL file.

<?xml version="1.0" encoding="ISO-8859-1" ?>
<AnimLib version="9.1">
</AnimLib>

Without xanim, the shadow flickering.



With xanim, the problem goes away completely.



Thanks Arno for your information. I have spent a week for this understanding and I think it worth the time.
 
Did you try to compile the 3ds max output with an empty xanim file to see if the flickering is then gone?

Late confirmation from my side that when exporting to BGL from Blender via B2FSX, volume shadows stop flickering when Export Animations/LOD is enabled in the export dialogue.

This measure was sufficient and in the FSX/P3D material params I only had to enable Volume shadows without any other checkboxes ticked (so no Assume vertical normal needed here). I could also retain my variety of materials.

Since I do not mesh but always work with solids in AutoCAD before exporting to Blender, I could obviously rule out any non-manifold issues.

Finally I did not knowingly get in touch with drawcall batching so far and thus can't comment on it (I assume B2FSX is doing it by itself).

So thanks for the hint, Arno and all the rest of the tip of the spear - your assistance is off the scale valuable and to the point... I can't tell how much wasted time and effort you spared me already!
 
I use vertices normal since it makes too dark shade of the wall that has no light on. The wall of the building facing the sun is ok but the opposite side is too dark. The shadow it cast on the ground is the same.
 
I use vertices normal since [..] too dark shade of the wall that has no light on.

I have to admit, I did not test that one so far. Thank you for getting back to me with the hint - I was already wondering how to improve that one (FSX draws me a sharp edge far too dark on my sun-adverse shelter slope).

I'll report back in an appropriate new thread, so it can be found later on!
 
Back
Top