Page 1 of 1

[Opinions Needed] Darker ambient occlusion values?

PostPosted: Sun Jan 11, 2015 14:58
by TriBlade9
Hey guys, it's me again. I've been quite busy recently and still don't really have time for Minetest.
I fired it up for the first time in ages a bit ago, and was shocked at how (I don't know, plastic?) the world felt.

From my experience, ambient occlusion greatly affects the level of realism of a 3D scene, so I played around with the values in mapblock_mesh.cpp until I found something that seemed to look nice.

In my opinion, this really enhances the vibrancy of the scene. Thoughts?
Do you guys think this looks better or worse?

Screenshot with default values:
Image
Screenshot with modified values:
Image
To play with it yourself, replace line 294 in mapblock_mesh.cpp with this and recompile:
Note, this value is a ballpark estimate, and is quite subject to change.
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
   static const float light_amount[4] = { 0.6, 0.5, 0.3, 0.0 };


(Sorry, had to use a different image hosting site. China now blocks mediacru.sh. :/)

Re: [Opinions Needed] Darker ambient occlusion values?

PostPosted: Sun Jan 11, 2015 15:00
by rubenwardy
You need to link directly to the image, you're linking to an page with the image on it.

Re: [Opinions Needed] Darker ambient occlusion values?

PostPosted: Sun Jan 11, 2015 15:09
by TriBlade9
rubenwardy wrote:You need to link directly to the image, you're linking to an page with the image on it.

From here, those are direct links and are working fine. What do you see?

Re: [Opinions Needed] Darker ambient occlusion values?

PostPosted: Sun Jan 11, 2015 15:11
by rubenwardy

Re: [Opinions Needed] Darker ambient occlusion values?

PostPosted: Sun Jan 11, 2015 15:22
by TriBlade9
rubenwardy wrote:You linked to http://postimg.org/image/vyqmkzdrn/ instead of http://s13.postimg.org/s2daozss7/screen ... 476750.png
I just see crosses.

That's strange, there seems to be some sort of URL filtering then. The actual link I posted is http://s13.postimg.org/3ymj0pab9/screen ... 476750.png

I'll try a different site.

Re: [Opinions Needed] Darker ambient occlusion values?

PostPosted: Sun Jan 11, 2015 15:27
by rubenwardy
Just uploading as attachments. That redirects, too.

Re: [Opinions Needed] Darker ambient occlusion values?

PostPosted: Sun Jan 11, 2015 15:33
by TriBlade9
rubenwardy wrote:Just uploading as attachments. That redirects, too.

Ah right, thanks.
</offtopic>

Also, please note that the code used was quite hacky and looks bad in pretty much every situation except daylight.

Re: [Opinions Needed] Darker ambient occlusion values?

PostPosted: Sun Jan 11, 2015 19:59
by Krock
Impressive. I like this change.

Re: [Opinions Needed] Darker ambient occlusion values?

PostPosted: Sun Jan 11, 2015 20:42
by rubenwardy
Darker shadows? It does look better. With dynamic shadows, it will look even cooler.

Re: [Opinions Needed] Darker ambient occlusion values?

PostPosted: Sun Jan 11, 2015 21:11
by Kenney
I like it! +1

Re: [Opinions Needed] Darker ambient occlusion values?

PostPosted: Sun Jan 11, 2015 21:35
by Calinou
Ideally, ambient occlusion strength should be configurable. The default value should probably be slightly higher than what we currently have.

Re: [Opinions Needed] Darker ambient occlusion values?

PostPosted: Sun Jan 11, 2015 22:36
by TriBlade9
Calinou wrote:Ideally, ambient occlusion strength should be configurable. The default value should probably be slightly higher than what we currently have.

That's a neat idea, perhaps subgames could modify it in their configuration files. That would probably help give each game a sort of feel.

However, first someone has to figure out/rewrite the current system. I still can't wrap my head around how it works exactly, or how to fix the issues with caves and water and such.

EDIT: So this line apparently affects darkness well, but it looks like someone tweaked it to be very exact. Any info?
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
      //table of precalculated gamma space multiply factors
      //light^2.2 * factor (0.75, 0.5, 0.25, 0.0), so table holds factor ^ (1 / 2.2)
      static const float light_amount[4] = { 0.877424315, 0.729740053, 0.532520545, 0.0 };

I've updated the main post with a modification to the light_amount array, which looks roughly the same, but works perfectly underwater and in caves.
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
      static const float light_amount[4] = { 0.6, 0.5, 0.3, 0.0 };

Now to make it configurable...

Re: [Opinions Needed] Darker ambient occlusion values?

PostPosted: Sat Jan 17, 2015 04:30
by TriBlade9
This has been added to the main game, with a lot of tweaks. See the setting "ambient_occlusion_gamma".

Re: [Opinions Needed] Darker ambient occlusion values?

PostPosted: Sun Jan 18, 2015 02:15
by Napiophelios
Well I am the goon who voted "No real difference",
but I am half blind and using a tiny computer and from the screen shots
I really didnt see much of a difference.

But man in game it looks awesome, good job TriBlade9.
Its the little things you know :)

Re: [Opinions Needed] Darker ambient occlusion values?

PostPosted: Sun Jan 18, 2015 02:33
by TriBlade9
Napiophelios wrote:Well I am the goon who voted "No real difference",
but I am half blind and using a tiny computer and from the screen shots
I really didnt see much of a difference.

But man in game it looks awesome, good job TriBlade9.
Its the little things you know :)

No problem, glad you like it!
Just out of curiosity, what values are you using?

Re: [Opinions Needed] Darker ambient occlusion values?

PostPosted: Sun Jan 18, 2015 02:37
by Napiophelios
Whatever Krock has as the default in his latest build;
(If I dont understand something,I try not to mess with it)

Its really noticeable effect when viewing things from high altitudes

Re: [Opinions Needed] Darker ambient occlusion values?

PostPosted: Sun Jan 18, 2015 02:43
by TriBlade9
Napiophelios wrote:Whatever Krock has as the default in his latest build;
(If I dont understand something,I try not to mess with it)

Its really noticeable effect when viewing things from high altitudes

Strange, in the latest builds the default is exactly the same as previously. (Should be anyways)

Re: [Opinions Needed] Darker ambient occlusion values?

PostPosted: Sun Jan 18, 2015 03:03
by Napiophelios
I dont know but when you fly around the landscape kinda shimmers, especially tree leaves
Its kinda weird lookin but neat.

Does #display_gamma = 1.8 have anything to do with it?
I might be remarking on something entirely different,
I thought this (darker ambient occlusion) was the change that was having the effect

edit:
okay,I found it; I am using
ambient_occlusion_gamma=1.2
display_gamma = 2.4

But I changed texture packs and it looks very different now,
going back to using SummerfieldsTP it looks better.

Re: [Opinions Needed] Darker ambient occlusion values?

PostPosted: Sun Jan 18, 2015 03:42
by TriBlade9
Napiophelios wrote:I dont know but when you fly around the landscape kinda shimmers, especially tree leaves
Its kinda weird lookin but neat.

Does #display_gamma = 1.8 have anything to do with it?
I might be remarking on something entirely different,
I thought this (darker ambient occlusion) was the change that was having the effect

edit:
okay,I found it; I am using
ambient_occlusion_gamma=1.2
display_gamma = 2.4

But I changed texture packs and it looks very different now,
going back to using SummerfieldsTP it looks better.

Ah okay, you are indeed using a darker ambient_occlusion_gamma value. (default is 2.2)

Re: [Opinions Needed] Darker ambient occlusion values?

PostPosted: Sun Jan 18, 2015 05:18
by Napiophelios
Well night time and dark places in general really seem dark now;
I dont know if these settings have anything to do with it,or maybe just the 0411 update,
but I dont get all the little white lines every where any more when I go into a cave.
Black looks black now.

Re: [Opinions Needed] Darker ambient occlusion values?

PostPosted: Sun Jan 18, 2015 05:49
by Zeno
Napiophelios wrote:Well night time and dark places in general really seem dark now;


You can change display_gamma to a lower value for brighter nights depending on your monitor. E.g. I use display_gamma = 1.5

The default is display_gamma = 1.8 and this gives the exact same brightness values as version 0.4.10 of minetest