Jump to content

Flickering shadows!


gameboy
 Share

Recommended Posts

2 minutes ago, Stan` said:

Since 2.5 I think you could bake with both internal and cycles.

If that's the case, I never noticed.

But like I said, the Cycles people are crazy about noisifying everything.

I was in that camp, at one time;  I thought random noise was God's lubricant.  I eventually found out what a terrible mistake that is.  Even using ray jitter randomizations in an Blender AO introduces noise;  and noise is NOT so easy to filter out.  Filters can drop the high end of the noise spectrum, but leave the "pink noise" (lower frequencies) still remaining, and it becomes a visual repellent. 

Link to comment
Share on other sites

Interesting.  Well, frankly it still irks me that Cycles introduced all this horrendous amounts of noise that no other renderer ever did, and instead of being fed to the sharks they get crowned kings of renderland, and everybody goes dilligently to work on super-intelligent denoisers.  Why don't they remove all the useless random stuff from their code and call it a day, instead?

Also, ao's are tricky things to filter.  Some places they can be smooth;  some places need sharpness...

What about running Xnormal on Wine?

Edited by DanW58
Link to comment
Share on other sites

 

23 minutes ago, DanW58 said:

What about running Xnormal on Wine?

I'm on Windows, but I prefer to limit the number of tools I use :)

9 minutes ago, DanW58 said:

@Stan`Could you give me the file(s) I need to be able to see ambient occlusion in-game?  I'm aching to work with it, even if it doesn't make it to A24.

Well according to what I said earlier you should already see it, so I'm not sure what you mean? you can add that to your config file in  ~/.config/0ad/config/user.cfg

gpuskinning = true

 But it shouldn't change anything

Link to comment
Share on other sites

4 hours ago, Stan` said:

The one above is player_trans_parallax_spec



<uniform name="effectSettings" value="1.0 50.0 0.0075 0.85"/>

should be



<uniform name="effectSettings" value="1.0 50.0 0.0075 0"/>

Since there is no AO. But that doesn't seem to work. Buildings still have self shadows.

This one is used by the left cc player_trans_ao_parallax_spec



<?xml version="1.0" encoding="utf-8"?>
<material>
  <alternative material="player_trans_ao_spec.xml" quality="8"/>
  <define name="USE_PLAYERCOLOR" value="1"/>
  <define name="USE_PARALLAX" value="1"/>
  <required_texture name="baseTex"/>
  <required_texture name="normTex" define="USE_NORMAL_MAP"/>
  <required_texture name="specTex" define="USE_SPECULAR_MAP"/>
  <required_texture name="aoTex" define="USE_AO"/>
  <shader effect="model"/>
  <uniform name="effectSettings" value="1.0 50.0 0.0075 0.6"/>
</material>

EDIT For the record



<uniform name="effectSettings" value="Normal Specular Parallax AO"/>

 

Stan, nowhere you told me what files are these, where they are;   or well, you mentioned a folder that doesn't exist in my svn;  though apparently it exists in the website.  I don't know what these xml files do, or where they are.  Is it really so difficult to get ao working?

I will try that skinning thing, but you tell me it won't make a difference;  then why mention it?

Edited by DanW58
Link to comment
Share on other sites

4 minutes ago, DanW58 said:

Stan, nowhere you told me what files are these, where they are;   or well, you mentioned a folder that doesn't exist in my svn;  though apparently it exists in the website.  I don't know what these xml files do, or where they are.

Well they should be in that exact folder, else something is wrong with your repository...

They're called player_trans_parallax_spec.xml and player_trans_ao_parallax_spec.xml (forgot the extension in my message) They are these kinds of files https://trac.wildfiregames.com/wiki/MaterialFormat and they are referenced in the <material> tags of files in art/actors/*

Quote

  Is it really so difficult to get ao working?

Well as you saw it works on my machine, and I don't have done anything special with those files...

Link to comment
Share on other sites

Alright, I changed both files, making the last term in settings 1.0.  In player_trans_parallax_spec.xml I even added the ao file as required for good measure;  and I have the gpu skinning line in config.  Still no sign of an ao anywhere.

Could it be I need an ao line in the config file?  I see nothing of the sort there...

Link to comment
Share on other sites

3 minutes ago, DanW58 said:

Alright, I changed both files, making the last term in settings 1.0.  In player_trans_parallax_spec.xml I even added the ao file as required for good measure;  and I have the gpu skinning line in config.  Still no sign of an ao anywhere.

Could it be I need an ao line in the config file?  I see nothing of the sort there...

Maybe you broke it with your changes in shaders (just spitballing here)

Else could be something more pernicious, e.g the game Hwdetect.js detecting your machine is not fast enough to run them, and disabling it, but that would be strange, since it would disable GLSL in the option as well.

Link to comment
Share on other sites

8 minutes ago, Stan` said:

Maybe you broke it with your changes in shaders (just spitballing here)

Else could be something more pernicious, e.g the game Hwdetect.js detecting your machine is not fast enough to run them, and disabling it, but that would be strange, since it would disable GLSL in the option as well.

Nope;  can't be;  my changes to the shader were additive;  I did not change much at all, just added 3 lines of code to modulate ambient light.

Hwdetect can't be the culprit either, as I can confirm I have glsl running, as every time I make a mistake in the shader I get game assets disappearing or big error messages from the glsl jit compiler.

But besides, Gameboy is not getting ao either, and he seems to have a better machine than mine.

I think this is something serious.  It may be the case that nobody is getting ao;  and you never had a bug report because people don't know what ao looks like, or that it even exists.  I think this is a big bug.

Can you show me a screen shot from the game, no white building, no special test mode;  from the game itself, a screenshot with ao?  I'm starting to believe it just doesn't work at all.

Edited by DanW58
Link to comment
Share on other sites

56 minutes ago, DanW58 said:

I think this is something serious.  It may be the case that nobody is getting ao;  and you never had a bug report because people don't know what ao looks like, or that it even exists.  I think this is a big bug.

You can always check your frame by capturing it with RenderDoc or something similiar. 

Link to comment
Share on other sites

1 minute ago, vladislavbelov said:

You can always check your frame by capturing it with RenderDoc or something similiar.

My problem was stupid;  I changed those xml files, but I did not reboot the game;  I merely started a new one, which is ok for testing a shader.  Once I rebooted the game, the ao kicked in.

So, that's it, the picture above is with 1.0 in the shader, 1.0 in the xml's.  Whaddya think?

Link to comment
Share on other sites

The only other thing I changed in the shader is I made the default ao vec3(0.5), otherwise things with no ao would look too bright by comparison.

  #if /*(USE_INSTANCING || USE_GPU_SKINNING) &&*/ USE_AO
    vec3 ao = texture2D(aoTex, v_tex2).rrr;
    ao = mix(vec3(0.5), ao, effectSettings.w);
    ambColor *= ao;
  #endif

ALL of the xml files in binaries/data/mods/public/materials that possessed a,

<uniform name="effectSettings" value="1.0 50.0 0.0075 0.85"/> (or whatever number)

I changed to read

<uniform name="effectSettings" value="1.0 50.0 0.0075 1.0"/>

 

Here's a couple other pics.   NOTE, I'm not entirely happy with the ao as is;  it should be a bit more noticeable, and I think it is due to the kind of ao it is.  The type in which the rays are modulated by cos of incident angle is a lot more realistic looking;  but this is a lot better than nothing at all, or than the way it was (either invisible or not there at all).  The question for you is, is this too dark?  Because that was Stan's worry.

I think it IS darker, but that it is as it should be.  It looks more realistic, less arcadish, in my eyes.  I see no glaring problems;  I think it can easily go into A24.

Of course, it needs to also have ambient shadowing onto the ground, --VERY subtle, but it needs to be there--, and I have a solution to propose for that, for A25.

Here's a few other pics, and the shaders, and I'm going to bed, finally.

 

BINGO2.jpg

BINGO3.jpg

BINGO4.jpg

model_common.fs model_common.vs terrain_common.fs

BINGO5.jpg

BINGO6.jpg

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

1 hour ago, DanW58 said:

BINGO2.jpg

How the ancients used white in architecture it's unreasonable that the ground is "whiter" than the CC. While the ao might have improved I guess it also highlights the need to fix base colour.

To really give an answer whether I share @Stan` fear you claim please provide all your changes as a single patch against trunk or a mod to play with.

Link to comment
Share on other sites

Shader mod to compensate for bad art.

As the color of the ground progresses towards too bright AND unsaturated, this shader dims as well as increases contrast.  It also removes any specularity, and ignores specular texture if such an atrocity is specified.

This should move us towards better light level agreement between grounds and buildings, which is probably what causes the perception of correct ao level as being "too dark".  So it is intended to go together with the other mods.

EDIT:

I suggest that the method of baking ao's be revisited with the understanding that an ao texture MUST span from full black to full white.  If there is no will to redo ao's for all existing assets, a software solution could be to check for min and max values on load, and inform the shader of what factors to multiply ao by.  Reading the whole texture to find min and max may be costly, however.  A random sampling might be a good compromise.

 

alpine_valleys.jpg

 

acropolis.jpg

terrain_common.fs

Edited by DanW58
Link to comment
Share on other sites

UPDATE:

I was accidentally applying this to the color after lighting and shadows, instead of to the color from the texture.  That is fixed now.

I also improved the algorithm to give it much less influence whenever or wherever the saturation is not close to zero.

As such, the most affected ground is the Acropolis map.  Alpine Valley and Belgian Bog are unchanged except for the gray stone paths.  Bactria is not affected at all.

 

acropolis.jpg

alpine_valley.jpg

bactria.jpg

belgian_bog.jpg

terrain_common.fs

oceanside.jpg

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