Jump to content

Flickering shadows!


gameboy
 Share

Recommended Posts

gameboy, try the mesh attached.

Backup binaries/data/mods/public/art/meshes/structural/ptol_civic_centre.dae

then put my modified mesh in the same folder, see if that fixes the problem.

I found no duplicate polygon;  all I did was increase the depth of the terrace floors.

EDIT:  Nevermind;  the building became invisible, except for statues floating in the air...

Probably some export setting in Blender that I don't know about.

EDIT2:  There are overlapping polygons in the mesh, elsewhere, there's a bunch of square windows that are co-planar with the walls without there being square holes on the walls for them;  just overlapping.  The UV unwrap is all overlapping islands;  there'd be no way to bake an AO on this thing, not sure if you guys ever plan to have ao textures...  They can do magic for the lighting, but you'd need non-overlapping UV unwraps to bake them.

ptol_civic_centre.dae

Edited by DanW58
  • Like 1
Link to comment
Share on other sites

6 hours ago, DanW58 said:

EDIT2:  There are overlapping polygons in the mesh, elsewhere, there's a bunch of square windows that are co-planar with the walls without there being square holes on the walls for them;  just overlapping.  The UV unwrap is all overlapping islands;  there'd be no way to bake an AO on this thing, not sure if you guys ever plan to have ao textures...  They can do magic for the lighting, but you'd need non-overlapping UV unwraps to bake them.

AO Maps are baked using a second UVMap. We use texture Atlases to reduce the number of textures loaded for a single civilisation.

6 hours ago, DanW58 said:

Probably some export setting in Blender that I don't know about.

Maybe you forgot to tick "Import Units"

7 hours ago, DanW58 said:

there's a bunch of square windows that are co-planar with the walls without there being square holes on the walls for them;  just overlapping.  T

That's to save polygons.

Link to comment
Share on other sites

  

I didn't touch the Noba granary.  Where is this "load units" thing?  NM, found it!

Alright, here it is, attached.

The flickering is still on, but less;  at least the shadows don't disappear altogether.

 I think this proves it's a precision problem;  perhaps a depth rounding error;  might be solved with a bit of bias tweaking;  but I could be wrong.

2 hours ago, Stan` said:

AO Maps are baked using a second UVMap. We use texture Atlases to reduce the number of textures loaded for a single civilisation.

.....

That's to save polygons.

That's actually a pretty good idea, to separate texture from AO.  Not a bad idea at all!

R.e. polygons, they are grossly overrated.  We're not in the days of software rendering anymore.  What is REALLY the killer of GPU's, old and new, is overdraw.  Painting or trying to paint the same pixel multiple times, letting the z-buffer to decide whether or not.  That's the big killer.  I could double the polygons on this civ center and have it render faster simply by getting rid of all the invisible surfaces inside the building.  Fun hedge trimming work.

ptol_civic_centre.dae

Edited by DanW58
Link to comment
Share on other sites

There's probably not going to be a patch, gameboy.  We'd need to know what the problem is before we try to fix it.  That's what I'm trying to find out;  just working on a theory for now.  And there's little incentive to patch a problem with a piece of code that's going away anyways;  there's a new shadows implementation coming soon.

Just try this civic center I just attached to my previous post.  It works ingame for me now.  Consider it THE patch.

 

Edited by DanW58
Link to comment
Share on other sites

10 minutes ago, DanW58 said:

What is REALLY the killer of GPU's, old and new, is overdraw.  Painting or trying to paint the same pixel multiple times, letting the z-buffer to decide whether or not.

Overdraw is important. Though modern cards have things like early-z which reduces cost of opaque objects. Anyway our current problem is that we're CPU bound on most platforms (beside some potato GPU).

2 minutes ago, gameboy said:

We need to wait for his @vladislavbelovpatch, we need his fix patch.

Planned for A25.

  • Like 1
Link to comment
Share on other sites

Quote

We already have a some kind of solution for that. It's not the production ready, but it works. I plan it for A25.

There's a new solution in the works;  I would not expect a patch if I were you.

  Ok, he just told you.

 

2 minutes ago, vladislavbelov said:

Overdraw is important. Though modern cards have things like early-z which reduces cost of opaque objects. Anyway our current problem is that we're CPU bound on most platforms (beside some potato GPU).

Ahhh, gottcha.  Is that due to using fixed point?

 

Edited by DanW58
Link to comment
Share on other sites

That's strange!  I never saw anything like it.  Light is leaking under...  Hmmm...  Let me look into this.

 

Gameboy, I've looked at it, and nothing indicates to me this should be happening.  And in my computer it does not happen.  The floor in those roofs is not attached to the walls;  i mean not welded;  but the edge of the wall and the edge of the floor coincide seamlessly.  Now, I do remember, many years ago,  decades ago,  there were graphics cards that exhibited such a light leakage problem say under walls that sat on a floor plane but did not connect to the floor, with certain shadowing algorithms.  I'm tempted to just weld the terrace floors to the walls, but I fear this would break the existing UV-mapping of the model.

I'm going to have to let someone with a better idea what may be going on weight in.

EDIT:  Another thing I notice is that Blender somehow triangulated all the quads on this model for me without even asking.

I imported and exported a lot of .obj and .stl with Blender, but this is my first time touching Collada things;  it may be some setting...

 

I have good news.  I was able to reproduce the problem in my computer.  This is only a matter of time now...

  • Thanks 1
Link to comment
Share on other sites

Yes, that may be true at run-time;  but if I load the model I just saved and it's all triangulated it is impossible to work with;  and Blender does a terrible job of converting triangles to quads;  whoever coded that should get life in prison.  Anyways, I found the culprit:  A stupid flag for triangulate on export, hidden in a second tab in the Collada exports options, absurdly defaults to checked ON.  Another candidate for life in prison...

Yeah, about the problem, I remember dealing with something similar, a very long time ago.  I tried adding a thin outer trim to the terrace floor, but it made no difference.

Now I'm trying a brute force approach, adding a hidden light-blocking frame.  Of course, doing so is not ideal, as it causes the very problem I was talking about regarding graphics performance:  overdraw...  Which is a misnomer;  should be called "over-visit", as the problem is revisiting the same fragment, whether it results in something drawn or not, z-buffer notwithstanding.

Edited by DanW58
  • Confused 1
Link to comment
Share on other sites

44 minutes ago, DanW58 said:

Yes, that may be true at run-time;  but if I load the model I just saved and it's all triangulated it is impossible to work with;  and Blender does a terrible job of converting triangles to quads;  whoever coded that should get life in prison.  Anyways, I found the culprit:  A stupid flag for triangulate on export, hidden in a second tab in the Collada exports options, absurdly defaults to checked ON.  Another candidate for life in prison...

I find ALT+J to work pretty good. Sure it sometimes need adjustments but it work well enough.

 

Link to comment
Share on other sites

The problem is that the moment it makes ONE bad choice of triangles to merge, from then on it propagates the badness.

I frankly don't understand how the coder could be so dumb.  If you had a cloud of triangles on a shapeless surface I would understand;  but in a model that is aligned with the axes, it should be obvious which triangles to merge.  Life in prison is not enough.

Regarding the problem;  brute force doesn't work.  I placed a chunky sun shield inside the wall of the building around the top terrace, see pic, and it makes no difference whatsoever;  light gets through anyways.  Looks like we'll have to wait for release 25 and hope it fixes it.

brute_force.jpg

Link to comment
Share on other sites

FIXED!!!!

Well, it's a dishonorable fix;  I just slanted the walls inwards to hide the part of the floor that gets leaked light.

But I also fixed other problems with the model.  There were many spurious edges tagged "sharp" around the columns, for example.  I did a general clean-up of missing or unwarranted sharp edges.

fixed.jpg

ptol_civic_centre.dae

Link to comment
Share on other sites

Interesting fix. Thanks for looking into it. I don't particularly like it  because it doesn't fit the style of other buildings with such roofs but it might help us understand the problem and avoid it in the future.

Can you elaborate on what edges you changed ?

I suppose I should look into improving this model to a more greek style in a future lifetime as suggested in some other thread.

Link to comment
Share on other sites

I don't like it either.

It would be preferable to just pile on 50 kilo coffee bean bags along the walls...  Did Greeks drink coffee?  Close to Rome...

Anyways, the edges that were spuriously sharp were mostly around the columns.  I highlighted some edges yellow to give you a general idea;  I don't remember which edges were sharp and which weren't.

In Blender you have to be careful with selection by angle.  It only works 95% of the time...

 

edges.jpg

Link to comment
Share on other sites

Okay, I don't see the flicker from the images, but I believe you.

EDIT:  Ah, I see it now;  the shadow behind the column.  Frankly, if there was a proper ao in this building, the wall behind the column should be dark enough from the ao you probably would not notice the direct light shadow missing...

  However, the problem is not the building itself;  it is something about the shadow algorithm and/or the precision of the hardware;  and there's a new algorithm coming soon, so there's not much to gain fixing the current one;  --much less from changing the buildings.

Have you played with the settings of the shadow quality?  The more bits of depth the better, as long as your hardware can handle it.  I see that your images are high rez, which suggests you have better hardware than mine.  In the Menu, Settings, there's shadow quality options going from Very Low to Very High, and whether to have filtering or not.  Try playing with those and see if the problem goes away.

Edited by DanW58
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.

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.

 Share

×
×
  • Create New...