[shaders]Bloom + Better Light

User avatar
azekill_DIABLO
Member
 
Posts: 7472
Joined: Wed Oct 29, 2014 20:05
Location: OMICRON
GitHub: azekillDIABLO
In-game: azekill_DIABLO
 

User avatar
ThomasMonroe
Member
 
Posts: 278
Joined: Tue Apr 04, 2017 16:21
Location: Wherever I am at
GitHub: ThomasMonroe314
IRC: ThomasMonroe TMcSquared
In-game: ThomasMonroe TMcSquared

Re: [shaders]Bloom + Better Light

by ThomasMonroe » Sat Dec 09, 2017 13:36

lol I have looked at the code a bit and most of what you need to work with are these files and folders.
src/client/render
src/game.cpp
src/clientmap.cpp
Projects|:*sigh* school: :Qub³d: :Legends Of Survival: :making people think:
I don't make things messy, I just *cough* disturb the local entropy.
 

Skulls
Member
 
Posts: 108
Joined: Thu Dec 21, 2017 17:41
In-game: Skulls

Re: [shaders]Bloom + Better Light

by Skulls » Thu Dec 21, 2017 18:08

Need any help? I'm crap at graphics of all kind but I can refactor and do code cleanup + test.
 

User avatar
azekill_DIABLO
Member
 
Posts: 7472
Joined: Wed Oct 29, 2014 20:05
Location: OMICRON
GitHub: azekillDIABLO
In-game: azekill_DIABLO
 

Skulls
Member
 
Posts: 108
Joined: Thu Dec 21, 2017 17:41
In-game: Skulls

Re: [shaders]Bloom + Better Light

by Skulls » Thu Dec 21, 2017 19:48

Complete ignorance here but looks like there is some *.glsl stuff in the master/client/shaders code already. Why would there need to be modifications to the core engine?
 

User avatar
azekill_DIABLO
Member
 
Posts: 7472
Joined: Wed Oct 29, 2014 20:05
Location: OMICRON
GitHub: azekillDIABLO
In-game: azekill_DIABLO
 

User avatar
TumeniNodes
Member
 
Posts: 2631
Joined: Fri Feb 26, 2016 19:49
Location: in the dark recesses of the mind
GitHub: TumeniNodes
IRC: tumeninodes
In-game: TumeniNodes

Re: [shaders]Bloom + Better Light

by TumeniNodes » Thu Dec 21, 2017 20:00

Skulls wrote:Complete ignorance here but looks like there is some *.glsl stuff in the master/client/shaders code already. Why would there need to be modifications to the core engine?


someone with experience, and who knows the dark side of the maths is needed. : )

basically, the community is awaiting the coming of Lord Dropmyfps
I couldn't fix your brakes, so I made your horn louder.
 

Skulls
Member
 
Posts: 108
Joined: Thu Dec 21, 2017 17:41
In-game: Skulls

Re: [shaders]Bloom + Better Light

by Skulls » Thu Dec 21, 2017 21:09

I've burned an EULA and set out some caffeine, chanted "turn it off and on again" 8 times. Hopefully the ritual works.
 

User avatar
ThomasMonroe
Member
 
Posts: 278
Joined: Tue Apr 04, 2017 16:21
Location: Wherever I am at
GitHub: ThomasMonroe314
IRC: ThomasMonroe TMcSquared
In-game: ThomasMonroe TMcSquared

Re: [shaders]Bloom + Better Light

by ThomasMonroe » Fri Dec 22, 2017 00:14

Skulls, we nee the core change to provide us with the information necessary to create shadows, etc.
Projects|:*sigh* school: :Qub³d: :Legends Of Survival: :making people think:
I don't make things messy, I just *cough* disturb the local entropy.
 

User avatar
LMD
Member
 
Posts: 732
Joined: Sat Apr 08, 2017 08:16
Location: Somewhere over the Rainbow : Bonn, Germany
GitHub: appgurueu
In-game: LMD + PRO_LMD + Limo

Re: [shaders]Bloom + Better Light

by LMD » Fri Dec 22, 2017 13:36

azekill_DIABLO wrote:you wouldn't need to actually. the core itself doesn't need any change. (AFAIK)


Sorry, but you're wrong here. I have already seen this shaders, and AFAIK, there's actually no post-processing stage.
Magic-CTF(soon)MTPCFractal-SuiteModel Creator Schematic CreatorColorfulXmas BallsWebsite • Never judge me by my age
 

Skulls
Member
 
Posts: 108
Joined: Thu Dec 21, 2017 17:41
In-game: Skulls

Re: [shaders]Bloom + Better Light

by Skulls » Fri Dec 22, 2017 15:47

ThomasMonroe wrote:Skulls, we nee the core change to provide us with the information necessary to create shadows, etc.


Okay, so bubble up / expose info on light sources? What else is part of the etc?
 

Skulls
Member
 
Posts: 108
Joined: Thu Dec 21, 2017 17:41
In-game: Skulls

Re: [shaders]Bloom + Better Light

by Skulls » Fri Dec 22, 2017 15:49

LMD wrote:there's actually no post-processing stage.


About where in the code would you expect the post-processing state to be, ideally? And what kind of things would happen in post-processing (pretty water, shadows, etc)?
 

User avatar
azekill_DIABLO
Member
 
Posts: 7472
Joined: Wed Oct 29, 2014 20:05
Location: OMICRON
GitHub: azekillDIABLO
In-game: azekill_DIABLO
 

User avatar
ThomasMonroe
Member
 
Posts: 278
Joined: Tue Apr 04, 2017 16:21
Location: Wherever I am at
GitHub: ThomasMonroe314
IRC: ThomasMonroe TMcSquared
In-game: ThomasMonroe TMcSquared

Re: [shaders]Bloom + Better Light

by ThomasMonroe » Fri Dec 22, 2017 16:42

Skulls wrote:
LMD wrote:there's actually no post-processing stage.


About where in the code would you expect the post-processing state to be, ideally? And what kind of things would happen in post-processing (pretty water, shadows, etc)?


the water is just shader magic XD, but you need more render passes in order to have reflections.
shadows need a render pass.
post processing would be for image effects, such as bloom, blur, etc.

it would take place on the rendered image, after the water , shadows and other things get drawn.
Projects|:*sigh* school: :Qub³d: :Legends Of Survival: :making people think:
I don't make things messy, I just *cough* disturb the local entropy.
 

Skulls
Member
 
Posts: 108
Joined: Thu Dec 21, 2017 17:41
In-game: Skulls

Re: [shaders]Bloom + Better Light

by Skulls » Fri Dec 22, 2017 17:29

Here are my sources:

Minetest shader.cpp https://github.com/minetest/minetest/blob/ae9b5e00989756bb676429530dfe81039009001c/src/shader.cpp
Irrlicht shader doc / tutorial http://irrlicht.sourceforge.net/docu/example010.html
Irrlicht forum post on shadows http://irrlicht.sourceforge.net/forum/viewtopic.php?f=6&t=51773&p=302549&hilit=shadows#p302549

In shader.cpp would you expect to see some changes to the load_shaders() method with a shadow_program section? The multiple passes required isn't obvious to me from the Irrlicht tutorial so I'm flailing around (obviously :) ).
 

User avatar
LMD
Member
 
Posts: 732
Joined: Sat Apr 08, 2017 08:16
Location: Somewhere over the Rainbow : Bonn, Germany
GitHub: appgurueu
In-game: LMD + PRO_LMD + Limo

Re: [shaders]Bloom + Better Light

by LMD » Sat Dec 23, 2017 17:24

Skulls wrote:Here are my sources:

Minetest shader.cpp https://github.com/minetest/minetest/blob/ae9b5e00989756bb676429530dfe81039009001c/src/shader.cpp
Irrlicht shader doc / tutorial http://irrlicht.sourceforge.net/docu/example010.html
Irrlicht forum post on shadows http://irrlicht.sourceforge.net/forum/viewtopic.php?f=6&t=51773&p=302549&hilit=shadows#p302549

In shader.cpp would you expect to see some changes to the load_shaders() method with a shadow_program section? The multiple passes required isn't obvious to me from the Irrlicht tutorial so I'm flailing around (obviously :) ).


Nice work, Skulls ! Really helpful !
To answer your questions : (1) As ThomasMonroe mentioned, for shadows & reflections, a 2nd rendering pass is required. Also, most rendering techniques can only be used efficiently with post-processing. Let's take specular lighting for example. Implementing it in one pass - easy. But let's say there's a huge structure, with many triangles - and for each fragment of each triangle you have to calculate lighting - a huge amount of gpu power is required to make this run at 25 fps ! But, if you render face normals on a FBO, as well as the scene, you can "light up" the rendered scene, what means calculating specular lighting for the fragments of 2 triangles. You see - post-processing is required for :
(a) Efficiency -> high FPS, keep in mind this is a game, and not a movie-making software
(b) Nice effects that are done using post-processing -> night-vision, cartoon/toon-filter, edgefinders, shadows, ambient occlusion, etc...
Magic-CTF(soon)MTPCFractal-SuiteModel Creator Schematic CreatorColorfulXmas BallsWebsite • Never judge me by my age
 

Skulls
Member
 
Posts: 108
Joined: Thu Dec 21, 2017 17:41
In-game: Skulls

Re: [shaders]Bloom + Better Light

by Skulls » Sun Dec 24, 2017 03:39

Thanks for the info! Is this http://irrlicht.sourceforge.net/forum/viewtopic.php?f=4&t=51607&p=299914&hilit=multi+pass#p299914 something along the lines of a reasonable starting point for multi pass rendering?

One thing I really enjoy about Minetest is that it is available to folks who don't have the latest and greatest gaming rigs so any multi pass black magic would have to be an optional type of thing, and hopefully enabled by an in game menu option but probably starting out as a build param. I've got a fairly decent rig and want to help see the blocks all sparkly but still want to ensure a good play experience for anyone who can run the base specs.
 

User avatar
LMD
Member
 
Posts: 732
Joined: Sat Apr 08, 2017 08:16
Location: Somewhere over the Rainbow : Bonn, Germany
GitHub: appgurueu
In-game: LMD + PRO_LMD + Limo

Re: [shaders]Bloom + Better Light

by LMD » Sun Dec 24, 2017 11:16

No clue where you always find these articles, but yes, it is. The left side of the image in the bottom right corner is a normalmap. On the other side, there's the depthmap, relevant for almost every effect. In the bottom left corner, there's the rendered image without any lighting. Using this values, in the top left corner, the lit scene can be seen. The top right corner shows the "darkness" values. Notice it's not only lighting, but also ambient occlusion : Corners of the model are darker.
Magic-CTF(soon)MTPCFractal-SuiteModel Creator Schematic CreatorColorfulXmas BallsWebsite • Never judge me by my age
 

Skulls
Member
 
Posts: 108
Joined: Thu Dec 21, 2017 17:41
In-game: Skulls

Re: [shaders]Bloom + Better Light

by Skulls » Sun Dec 24, 2017 15:18

Okidoki then, this is what I've got. Things needed for fancy smancy graphics in Minetest:
  • Code branch
  • Types of shaders and levels defined (shadows, super fancy shadows, bloom + level, fancy water, etc)
  • Enable / disable option without recompiling per shader type
  • Defaults for render object materials for when shader info is not present
  • Shaders written per type + level
  • Game render loop extended to include multi pass rendering
  • No shader game tested and performance tuned
  • Low end shader game tested and performance tuned
  • 'Ultra' shader game tested and performance tuned
  • Wiki written
  • Shader binaries distributed to community for testing and evaluation
  • Enthusiasm and joy for shaders
  • Tears and despair at all the bugs
  • Moar fixes and testing
  • Pull request to main Minetest code initiated

What am I missing?
 

User avatar
LMD
Member
 
Posts: 732
Joined: Sat Apr 08, 2017 08:16
Location: Somewhere over the Rainbow : Bonn, Germany
GitHub: appgurueu
In-game: LMD + PRO_LMD + Limo

Re: [shaders]Bloom + Better Light

by LMD » Sun Dec 24, 2017 17:15

I see a manager/teamleader talent :)
1. We'll do in GitHub
3. We should compile them during initialization
Magic-CTF(soon)MTPCFractal-SuiteModel Creator Schematic CreatorColorfulXmas BallsWebsite • Never judge me by my age
 

User avatar
ThomasMonroe
Member
 
Posts: 278
Joined: Tue Apr 04, 2017 16:21
Location: Wherever I am at
GitHub: ThomasMonroe314
IRC: ThomasMonroe TMcSquared
In-game: ThomasMonroe TMcSquared

Re: [shaders]Bloom + Better Light

by ThomasMonroe » Sun Dec 24, 2017 23:19

Skulls wrote:Okidoki then, this is what I've got. Things needed for fancy smancy graphics in Minetest:
  • Code branch
  • Types of shaders and levels defined (shadows, super fancy shadows, bloom + level, fancy water, etc)
  • Enable / disable option without recompiling per shader type
  • Defaults for render object materials for when shader info is not present
  • Shaders written per type + level
  • Game render loop extended to include multi pass rendering
  • No shader game tested and performance tuned
  • Low end shader game tested and performance tuned
  • 'Ultra' shader game tested and performance tuned
  • Wiki written
  • Shader binaries distributed to community for testing and evaluation
  • Enthusiasm and joy for shaders
  • Tears and despair at all the bugs
  • Moar fixes and testing
  • Pull request to main Minetest code initiated

What am I missing?


Shaders are compiled at load time, so they do not need to be in their binary format, what would need to happen is the shaders would need to be distributed like mods.
Projects|:*sigh* school: :Qub³d: :Legends Of Survival: :making people think:
I don't make things messy, I just *cough* disturb the local entropy.
 

User avatar
AccidentallyRhine
Member
 
Posts: 229
Joined: Sun Aug 02, 2015 05:43
 

User avatar
ThomasMonroe
Member
 
Posts: 278
Joined: Tue Apr 04, 2017 16:21
Location: Wherever I am at
GitHub: ThomasMonroe314
IRC: ThomasMonroe TMcSquared
In-game: ThomasMonroe TMcSquared

Re: [shaders]Bloom + Better Light

by ThomasMonroe » Tue Dec 26, 2017 13:37

all that needs to be done with that is updating "mShadowmatrix"
Projects|:*sigh* school: :Qub³d: :Legends Of Survival: :making people think:
I don't make things messy, I just *cough* disturb the local entropy.
 

Skulls
Member
 
Posts: 108
Joined: Thu Dec 21, 2017 17:41
In-game: Skulls

Re: [shaders]Bloom + Better Light

by Skulls » Tue Dec 26, 2017 16:19

ThomasMonroe wrote:Shaders are compiled at load time, so they do not need to be in their binary format, what would need to happen is the shaders would need to be distributed like mods.


I thought if we want multi pass, enable / disable shader attributes or levels we will need a new client binary and I *think* thats what I was calling the 'shader binary': modified client binary + shaders. Or I hope thats what I was thinking.
 

Byakuren
Member
 
Posts: 816
Joined: Tue Apr 14, 2015 01:59
GitHub: raymoo
IRC: Hijiri
In-game: Raymoo + Clownpiece

Re: [shaders]Bloom + Better Light

by Byakuren » Wed Dec 27, 2017 04:30

Color lighting is doable, but it wouldn't work quite right due to the way ambient lighting is approximated in Minetest. It might look "good enough" for inclusion, though.

See these blog posts I found for more info:
https://www.seedofandromeda.com/blogs/2 ... -game-pt-1
https://www.seedofandromeda.com/blogs/3 ... -game-pt-2
Every time a mod API is left undocumented, a koala dies.
 

PreviousNext

Return to Feature Discussion



Who is online

Users browsing this forum: No registered users and 4 guests