Jump to content
Sign in to follow this  
RGS

DX10 Fixer - VC Shadows Discussion/Questions for Steve

Recommended Posts

Hi guys,

 

I got the fixer today primarily for the VC shadows, but am having a few issues with them which I thought were worth posting here. Hopefully Steve can clarify why things are the way they are and whether or not any of these issues can be resolved.

 

Here are the problems I'm facing:

 

ISSUE 1: Resolution.

Though the edges of the shadows are now softened (and much better than FSX default) they are still a bit low resolution.

This not only shows the 'jaggies' but also the constant jiggling movement effect even when the a/c and eye point are stationary.

(It's not that I feel they need to be sharper as such, I don't have an issue with the amount of blur, but rather the resolution of the source that's being blurred)

 

QUESTION 1:

Would there be any way way to increase the resolution here? I know you have found a workaround for the jets, but not without the loss of shadows on the external fixed cameras.

 

ISSUE 2: Inaccuracy.

Shadows tend to display oddly at times, meaning that sometimes you will still get a very harsh, jagged shadow where it appears to 'cut through' the geometry. You will also see strange effects such as a shadow disappearing or only part rendering.

 

I believe this issue is caused by the fact that the shadow creation/placement is simply too inaccurate - For e.g. Looking back into the cabin I see a lot of light bleeding through from the exterior at the top edges of the cabin walls, this also happens at the bottom of doors (and yes there is a shadow casting mesh shell beyond the walls and doors).

 

Upon further inspection it appears that the shadows are offset from the actual mesh! If I have a seat post going to the floor the shadow from it will not start at the base of the post as you'd expect, but some distance away from it. This inaccuracy causes *a lot* of issues: Let's say you're looking at the main panel, you'd expect a nice shadow cast from the shroud. It starts out as a nice shadow, but then as the a/c moves round it stops rendering the shadow where the panel meets the shroud with a nice jagged line, giving you a light panel at the point where it should be in deepest shadow and a shadow 'strip' across the panel. The bottom of the shadow strip is the correct shadow edge and the top is where it's just 'cut off'... I'm not sure if the shroud's shadow is offset from the mesh or if there's a minimum distance at which shadows will not be cast - Either way it looks really broken sometimes and these issues out do all the 'wow' factor for me.

(Additionally if you move your eye point around the cockpit you will see that the positioning of shadows actually alters quite a lot which is pretty strange when the aircraft is totally stationary, though possibly this rendering technique is a compromise for FPS/performance?)

 

QUESTION 2:

Is there anyway way to resolve this inaccuracy problem via the shader?

QUESTION 3:

What is going on here technically: Are the shadows offset? Is there a minimum distance for casting (and if so is that on a polygon, element or object basis)?

QUESTION 4:

Is there anyway this effect can be lessened with the construction of the a/c model/materials prior to export?

 

ISSUE 3: Refusal of certain elements to cast shadows.

Some elements simply don't want to cast shadows - For e.g. the joystick and shaft shadow cast fine (I can even make out the hat switch and buttons!) but the material boot at the base of the stick just doesn't cast a shadow at all, judging from the shadow cast it would appear as though the joystick is floating in the air! There seem to be quite a few inconsistencies like this. It may well be related to issue 2; i.e. the boot would 'like' to cast a shadow, but either it's too close to the floor to render it or it's shadow is offset and thus it's wants to render below the floor... FYI in this case the boot and the stick are the same object and share the same texture. I will try moving the entire object up (floating above the floor) and see if the boot renders.

 

QUESTION 5:

Same as Q's 2,3 and 4 but relating to issue 3. What's going on here?

 

and finally...

 

QUESTION 6:

I don't suppose this is at all possible but I'll ask any way! As a developer, is there any way to colour part of the shadow map to represent light coming through coloured plexi-glass? I know it's a long shot - Just thought I'd ask!

 

 

Thanks very much in advance, sorry the post's a bit long. Hope all the questions make sense. Anyone else please chip in with your findings/suggestions/issues.

 

Also, I don't mean to sound negative about things, I think Steve's done a really great job with all the DX10 fixes and I'm sure there are a lot of limitations and frustrations in trying to fix bits and pieces of other people's code (not to mention some of which is probably inaccessible in the first place!). I'm posting as I think he's made a good improvement to the default VC shadows, but for me, in their current state it's not enough. The effect still looks like a WIP IMO and for me personally, if it's not improved I won't be using it. I'd really, *really* love to though - That's my point! I also understand that the issues are more or less apparent from one aircraft to the next. There are times when I really go 'wow,' problem is they're often shortly followed by an 'uggghh' brought on by the bugs listed above.

 

(FYI - All the other fixed parts of the package seem to be working very well for me and make DX10 a realistic option finally - Good job!)

Share this post


Link to post
Share on other sites

EDIT: More findings RE: Issues 2 & 3 (in brief; it looks like ISSUE 3 is in fact ISSUE 2).

 

As I said I would I have now tested ISSUE 3 further. I moved the stick and boot up so that the object now floats in the cockpit as opposed to being attached to the floor. It appears that there was not a problem with the boot mesh casting a shadow - But that in fact it was ISSUE 2, i.e. either the shadows refuse to cast until a certain distance or there is some strange offset going on. It looks like it's a distance problem though and this is what causes all the odd shadows, shadows not appearing and artifacts where you have very jagged edges.

 

What I now see in the case of the stick and boot is the stick shadow is cast as before across the floor (which is fine), plus I can now see the top half of the boot shadow. As you follow the boot shadow down towards the base of the boot it just abruptly cuts off with a jagged edge, seemingly as though it can no longer render the shadow here as the boot is too close to the floor where it's trying to cast the shadow.

 

THIS CAUSES ALL SORTS OF PROBLEMS!

 

I'm almost certain that this issue is to blame for all the jagged lines and odd shadows which do not match up with the objects casting them. It's the reason why there is light at the bottom of all the doors, light coming through the tops of cabin walls and it's why the panel shroud doesn't act as a shroud - The panel is *too close* to the shroud to receive the shadow! It's also why you won't see any shadows cast from switches on the panels they are attached to, but you can see them casting shadows on distant parts of the a/c.

 

I *really* hope this can be fixed or at least improved. At times the shadows can look fantastic, but this bug just brings the whole thing right down IMO.

 

Please let me know your thoughts,

 

 

Robert

 

(For some reason I didn't see an option to EDIT my original post. Any ideas?)

Share this post


Link to post
Share on other sites

 

http://stevesfsxanalysis.wordpress.com/2012/09/30/vc-shadowing-continued/

 

That may explain a bit. Also google shadowmapping.

 

The problems I have are (other than not being an expert graphics programmer) is no access to the C++ code. The reason for disabling external HD shadows in the big jets is I cannot be sure whether a view is inside or outside and thus how much of the aircraft is drawn in the shadowmap and thus whether I can zoom or not. I also have no clue on size, or where the centre of the cockpit is.

 

The peter pan effect is related to the shrinking which replaced the original offset. Both seek to avoid self shadowing which looks particularly bad.

 

The other big problem area is surfaces that are parallel to the light source. I have tried to offset using the normal but have struggled so far to calculate the new shadowmap sample point. Its something I want to revisit because I am not happy either.

Share this post


Link to post
Share on other sites

Hi Steve,

 

Thanks a lot for responding.

 

I read your blog link, very helpful. Also I think this article does a good job of explaining the issues associated with shadow mapping and their potential solutions: http://msdn.microsoft.com/en-us/library/windows/desktop/ee416324%28v=vs.85%29.aspx

 

So, as I understand it we have a few issues:

 

 

Resolution (high perspective aliasing?) - By far the smallest problem right now. This already looks decent overall IMO and isn't really a big issue but I think it could probably look better still.

  • This can be increased by upping the dimensions of the shadow map, correct? Are you using 4096 maps for this and If not could it be an option?
  • Also ensuring that the cockpit is filling the entirety of the depth map's dimensions (unlike the jets which have a lot of wasted space).

 

now on to the awkward stuff...

 

 

Acne - Needs to be overcome by offsetting the geometry so that the code doesn't get confused and cause a texel to self shadow. OK, so I think I get this; it's an accuracy thing. Basically you need to bring the offset/bias down to as small as possible a number without seeing any artifacts. The offset is what's causing the 'peter panning' but it's a necessary evil to overcome the built in inaccuracy of the system, which would otherwise lead to texel self-shadowing if not set? I *really* hope you can improve this as it's killing the effect for me at the moment. I wish I could suggest something but not being a programmer I really have no idea what's possible within FSX (especially when you don't have access to the C++ code!).

  • Is there anyway the depth map or calculations can be made more accurate?
  • Would adjusting the near and far clip planes help?
  • Can the bias be reduced much further without causing 'acne?'
  • If any of the above need to be set specifically on a per aircraft basis for best results could the code look up this info via a text file placed in the same directory as the aircraft config?

This 'peter panning' is the biggest issue for me.

 

 

High-projective aliasing - This (I think!) is what you mean by the issue caused when you have polygons that are parallel to the light source. I understand why it's causing problems now and I hope that you can crack it along with the one above.

 

 

Anyway - Thanks a lot for explaining the issues. The shadows have taken a big step forward with your work, I really hope you're able to go one step further and find a way around these other obstacles.

 

As I say I'm not a programmer - but I am an artist. If there are any test scenes (VC replacement .MDL files) you'd like made which would be useful in testing various shadowing techniques please drop me a line and I'll put some together for you.

 

All the best and good luck!

 

 

Robert

 

(I take it my pipe dream of being able to set coloured glass 'tinted shadows' might be difficult without the support of a pre-export material flag, not to mention some existing code support. However would it be possible to add some code via a material naming convention such as say 'Glass_SDW_Green' where the code then tints this shaded area to a set RGBA value? Obviously this isn't at all important to the immediate success of your product [no... really :P], but as a developer it's something I'd be very interested in if you do manage to crack the problems mentioned above)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...