[shaders]Bloom + Better Light

User avatar
azekill_DIABLO
Member
 
Posts: 7192
Joined: Wed Oct 29, 2014 20:05
Location: Under my desk (but I can't see my monitor now X'[ )
GitHub: azekillDIABLO
In-game: azekill_DIABLO

Re: [shaders]Bloom + Better Light

by azekill_DIABLO » Wed Dec 27, 2017 15:05

very interesting!
【Voxellar 2.0】 ; 【MILA】 ; 【Rec_a_MT】 ; 【BB,HD】 ; 【▶ Youtube】 "Pizza is many people's lifeblood. The sauce is like nectar, dough is like ambrosia." -Chem871
 

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

Re: [shaders]Bloom + Better Light

by Skulls » Wed Dec 27, 2017 15:53

I'm currently working on a texture pack that includes materials and normals. The tutorials online mention a diffuse map and a reflection map as well as a normal map. From my understanding Minetest currently does do normals but I'm not sure about diffuse and probably not reflection. Materials I don't think are considered at this point but I'm adding in some defaults in anyway.

Diffuse + reflection map needed?

Source:
https://www.blenderguru.com/tutorials/basics-realistic-texturing
 

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

Re: [shaders]Bloom + Better Light

by Skulls » Wed Dec 27, 2017 16:03

Byakuren wrote: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


How would this work with shadows and moving meshes? Would you do lighting on entities separately?
 

User avatar
ThomasMonroe
Member
 
Posts: 276
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 » Thu Dec 28, 2017 02:08

Skulls wrote:
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.


lol, understood
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: 151
Joined: Sat Apr 08, 2017 08:16
Location: Bonn, Germany
GitHub: appgurueu
In-game: Limo

Re: [shaders]Bloom + Better Light

by LMD » Thu Dec 28, 2017 12:21

Skulls wrote:
Byakuren wrote: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


How would this work with shadows and moving meshes? Would you do lighting on entities separately?


No. What reason for ? The problem with minetest is : It calculates light using an abstract light level construct. It's results can be used for in-game calculation(node light-level), but mustn't be used for rendering. We have to implement
lighting in the 2nd rendering pass for reasonable efficiency. The problem that I am facing right now is :
- on most graphic cards, a texture cannot exceed a size of 1024x1024, what is required for high-quality shadows.
- a cubemap contains 6 times such textures, representing the face of a cube
- GL allows at maximum 27 textures(correct me if I'm wrong)
- for non-directional light, the world has to be rendered out of all 6 cube perspectives
- and now the player places 99 torches...
- there are to many of them to calculate shadows for each one !
(also, efficiency is lost in the sea then)
 

User avatar
LMD
Member
 
Posts: 151
Joined: Sat Apr 08, 2017 08:16
Location: Bonn, Germany
GitHub: appgurueu
In-game: Limo

Re: [shaders]Bloom + Better Light

by LMD » Thu Dec 28, 2017 12:22

SO:

- we can implement shadows and better lighting for at least the sun
 

User avatar
LMD
Member
 
Posts: 151
Joined: Sat Apr 08, 2017 08:16
Location: Bonn, Germany
GitHub: appgurueu
In-game: Limo

Re: [shaders]Bloom + Better Light

by LMD » Thu Dec 28, 2017 12:25

1st aim :

Implementing 2nd pass shaders for lighting. They will use :
- normalmap
- rendered scene without lighting
- optional, a depthmap

Pros :
- renders fast
Cons :
- any ideas ?

Here's what I've got so far : (NO WARRANTY !, UNTESTED ! )

Vertex Shader, pass-thru :

Code: Select all
#version 330

in vec3 attribute_Position;
in vec2 texcoords;
in vec3 normal;
in vec3 transform;

out vec2 texcoords_pass;

void main(void)
{
  texcoords_pass=texcoords;
  gl_Position=vec4(attribute_Position,1.0f);
}


Fragment Shader :

Code: Select all
#version 330

layout(location=0) out vec4 litColor;

uniform sampler2D direction_to_light;
uniform sampler2D rendered_scene;
uniform sampler2D normalmap;
uniform sampler2D depthmap;

in vec2 texcoords_pass;

void main (void)
{
  //Calculating the direction to viewer, necessary for specular lighting, depthmap used for this
  float depth=1.0f-(texture(depthmap,texcoords_pass).x);
  vec3 dir_to_viewer = vec3((texcoords_pass-0.5f)*depth,(texcoords_pass-0.5f)*depth,depth);
  vec4 color=texture(rendered_scene, texcoords_pass);
  vec3 normal=texture(normalmap, texcoords_pass);
  vec3 to_light=texture(direction_to_light, texcoords_pass);
  normal.x=(normal.x-0.5f)*2.0f;
  normal.y=(normal.y-0.5f)*2.0f;
  normal.z=(normal.z-0.5f)*2.0f;
  float diffuse=dot(normal,to_light);
  litColor=vec4(color.x * diffuse, color.y * diffuse, color.z * diffuse, color.w);
}
 

User avatar
LMD
Member
 
Posts: 151
Joined: Sat Apr 08, 2017 08:16
Location: Bonn, Germany
GitHub: appgurueu
In-game: Limo

Re: [shaders]Bloom + Better Light

by LMD » Thu Dec 28, 2017 12:50

IM VERY PLEASED TO ANNOUNCE :
(tatatatatata *trumpets blowing*)

THE NEW GITHUB REPO !

https://github.com/appgurueu/new-shaders/upload/master



















(unluckily, I've got NO clue how to embedd them in Minetest/Irrlicht)
 

User avatar
azekill_DIABLO
Member
 
Posts: 7192
Joined: Wed Oct 29, 2014 20:05
Location: Under my desk (but I can't see my monitor now X'[ )
GitHub: azekillDIABLO
In-game: azekill_DIABLO

Re: [shaders]Bloom + Better Light

by azekill_DIABLO » Thu Dec 28, 2017 14:13

me either but it looks cool xD
【Voxellar 2.0】 ; 【MILA】 ; 【Rec_a_MT】 ; 【BB,HD】 ; 【▶ Youtube】 "Pizza is many people's lifeblood. The sauce is like nectar, dough is like ambrosia." -Chem871
 

User avatar
LMD
Member
 
Posts: 151
Joined: Sat Apr 08, 2017 08:16
Location: Bonn, Germany
GitHub: appgurueu
In-game: Limo
 

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

User avatar
azekill_DIABLO
Member
 
Posts: 7192
Joined: Wed Oct 29, 2014 20:05
Location: Under my desk (but I can't see my monitor now X'[ )
GitHub: azekillDIABLO
In-game: azekill_DIABLO

Re: [shaders]Bloom + Better Light

by azekill_DIABLO » Thu Dec 28, 2017 16:07

sure you should!
【Voxellar 2.0】 ; 【MILA】 ; 【Rec_a_MT】 ; 【BB,HD】 ; 【▶ Youtube】 "Pizza is many people's lifeblood. The sauce is like nectar, dough is like ambrosia." -Chem871
 

User avatar
LMD
Member
 
Posts: 151
Joined: Sat Apr 08, 2017 08:16
Location: Bonn, Germany
GitHub: appgurueu
In-game: Limo
 

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

Re: [shaders]Bloom + Better Light

by Skulls » Thu Dec 28, 2017 16:32

Pull request for MIT license and CC done, mostly to test things out. I can't figure out how to request access to the repo to start tossing in the boring stuff.
 

User avatar
ThomasMonroe
Member
 
Posts: 276
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 » Thu Dec 28, 2017 16:35

just fork the git repo Skulls
make another branch and tinker around
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: 66
Joined: Thu Dec 21, 2017 17:41
In-game: Skulls

Re: [shaders]Bloom + Better Light

by Skulls » Thu Dec 28, 2017 16:40

ThomasMonroe wrote:just fork the git repo Skulls
make another branch and tinker around


I did that for the files and I can open up issue request but I wanted to start working on the to-dos in the "Projects" section. I can make them in my fork but then we are already getting fragmented :)
 

User avatar
ThomasMonroe
Member
 
Posts: 276
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 » Thu Dec 28, 2017 16:58

then what did you mean by requesting access to the repo?
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: 66
Joined: Thu Dec 21, 2017 17:41
In-game: Skulls

Re: [shaders]Bloom + Better Light

by Skulls » Thu Dec 28, 2017 17:09

ThomasMonroe wrote:then what did you mean by requesting access to the repo?


From https://github.com/appgurueu/new-shaders/projects:

This Repository doesn't have any projects yet

You don't have permission to create new projects in this repository


That bit. Will appgurueu/new-shaders be the central focus? Is the goal to have all our code, docs, effort be pushed to that?
 

User avatar
rubenwardy
Moderator
 
Posts: 5181
Joined: Tue Jun 12, 2012 18:11
Location: United Kingdom
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: [shaders]Bloom + Better Light

by rubenwardy » Thu Dec 28, 2017 17:11

The difficult bit is putting this into Minetest, not writing the shaders. There are plenty of bloom and lighting implementations available online.

Also, related:

https://github.com/minetest/minetest/pull/6839
https://github.com/minetest/minetest/pull/5913
 

User avatar
ThomasMonroe
Member
 
Posts: 276
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 » Thu Dec 28, 2017 17:15

All that needs to be done now is implement a PR just for post-processing and for kilbith to figure out how to update that matrix every frame. then the fun with shaders can begin. :D
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: 66
Joined: Thu Dec 21, 2017 17:41
In-game: Skulls

Re: [shaders]Bloom + Better Light

by Skulls » Thu Dec 28, 2017 17:17

rubenwardy wrote:The difficult bit is putting this into Minetest, not writing the shaders. There are plenty of bloom and lighting implementations available online.

Also, related:

https://github.com/minetest/minetest/pull/6839
https://github.com/minetest/minetest/pull/5913


Absolutly. The shiney bits are the easy bits. I was kind of alluding to that with my long list of pain and suffering (https://forum.minetest.net/viewtopic.php?p=305375#p305375) which is really only the start. If it is ever going to get beyond the proof of concept and "works great on my machine!" stage there is a lot of extra work that has to be done. Hence setting some goals and scope in a project.
 

User avatar
LMD
Member
 
Posts: 151
Joined: Sat Apr 08, 2017 08:16
Location: Bonn, Germany
GitHub: appgurueu
In-game: Limo

Re: [shaders]Bloom + Better Light

by LMD » Thu Dec 28, 2017 17:28

Skulls wrote:
ThomasMonroe wrote:then what did you mean by requesting access to the repo?


From https://github.com/appgurueu/new-shaders/projects:

This Repository doesn't have any projects yet

You don't have permission to create new projects in this repository


That bit. Will appgurueu/new-shaders be the central focus? Is the goal to have all our code, docs, effort be pushed to that?


Sorry, but I am not very confortable with GitHub. I merged your request.
 

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

Re: [shaders]Bloom + Better Light

by Skulls » Thu Dec 28, 2017 17:29

Translation and languages, GUI changes, recovery instructions for when things go wrong...
 

User avatar
LMD
Member
 
Posts: 151
Joined: Sat Apr 08, 2017 08:16
Location: Bonn, Germany
GitHub: appgurueu
In-game: Limo

Re: [shaders]Bloom + Better Light

by LMD » Thu Dec 28, 2017 17:31

Please help me. How can I allow anybody to contribute ?
 

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

Re: [shaders]Bloom + Better Light

by Skulls » Thu Dec 28, 2017 17:38

LMD wrote:Please help me. How can I allow anybody to contribute ?


Anybody can contribute to the files / code now. Fork and then a pull request. You act as the gatekeeper for your repo and decide what goes in and what doesn't.

The projects are a seperate organizational feature of GitHub, similar to the issue tracker. It is related to code but not code, pure overhead. If you wanted to add someone as a collaborator:

Repo tab: Projects
Create new project
Board name: Shaders to MT Core!
Template: Basic Kanban

Repo tab: Settings
Collaborators
add misterskullz as collaborator

Or we can do it on my git account.
 

PreviousNext

Return to Feature Discussion



Who is online

Users browsing this forum: No registered users and 1 guest