[shaders]Bloom + Better Light

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

Re: [shaders]Bloom + Better Light

by azekill_DIABLO » Post

very interesting!
Gone, but not dead. Contact me on discord: azekill_DIABLO#6565
DMs are always open if you want to get in touch!

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

Re: [shaders]Bloom + Better Light

by Skulls » Post

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/b ... -texturing

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

Re: [shaders]Bloom + Better Light

by Skulls » Post

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: 286
Joined: Tue Apr 04, 2017 16:21
GitHub: ThomasMonroe314
IRC: ThomasMonroe TMcSquared
In-game: ThomasMonroe TMcSquared
Location: Wherever I am at

Re: [shaders]Bloom + Better Light

by ThomasMonroe » Post

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
I don't make messes, I just, er...disturb the local entropy!

User avatar
LMD
Member
Posts: 1386
Joined: Sat Apr 08, 2017 08:16
GitHub: appgurueu
IRC: appguru[eu]
In-game: LMD
Location: Germany
Contact:

Re: [shaders]Bloom + Better Light

by LMD » Post

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)
My stuff: Projects - Mods - Website

User avatar
LMD
Member
Posts: 1386
Joined: Sat Apr 08, 2017 08:16
GitHub: appgurueu
IRC: appguru[eu]
In-game: LMD
Location: Germany
Contact:

Re: [shaders]Bloom + Better Light

by LMD » Post

SO:

- we can implement shadows and better lighting for at least the sun
My stuff: Projects - Mods - Website

User avatar
LMD
Member
Posts: 1386
Joined: Sat Apr 08, 2017 08:16
GitHub: appgurueu
IRC: appguru[eu]
In-game: LMD
Location: Germany
Contact:

Re: [shaders]Bloom + Better Light

by LMD » Post

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);
}
My stuff: Projects - Mods - Website

User avatar
LMD
Member
Posts: 1386
Joined: Sat Apr 08, 2017 08:16
GitHub: appgurueu
IRC: appguru[eu]
In-game: LMD
Location: Germany
Contact:

Re: [shaders]Bloom + Better Light

by LMD » Post

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)
My stuff: Projects - Mods - Website

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

Re: [shaders]Bloom + Better Light

by azekill_DIABLO » Post

me either but it looks cool xD
Gone, but not dead. Contact me on discord: azekill_DIABLO#6565
DMs are always open if you want to get in touch!

User avatar
LMD
Member
Posts: 1386
Joined: Sat Apr 08, 2017 08:16
GitHub: appgurueu
IRC: appguru[eu]
In-game: LMD
Location: Germany
Contact:

Re: [shaders]Bloom + Better Light

by LMD » Post

Thanks :)
My stuff: Projects - Mods - Website

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

Re: [shaders]Bloom + Better Light

by Skulls » Post

Want me to start tossing in the to-dos?

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

Re: [shaders]Bloom + Better Light

by azekill_DIABLO » Post

sure you should!
Gone, but not dead. Contact me on discord: azekill_DIABLO#6565
DMs are always open if you want to get in touch!

User avatar
LMD
Member
Posts: 1386
Joined: Sat Apr 08, 2017 08:16
GitHub: appgurueu
IRC: appguru[eu]
In-game: LMD
Location: Germany
Contact:

Re: [shaders]Bloom + Better Light

by LMD » Post

Let's go !
My stuff: Projects - Mods - Website

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

Re: [shaders]Bloom + Better Light

by Skulls » Post

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: 286
Joined: Tue Apr 04, 2017 16:21
GitHub: ThomasMonroe314
IRC: ThomasMonroe TMcSquared
In-game: ThomasMonroe TMcSquared
Location: Wherever I am at

Re: [shaders]Bloom + Better Light

by ThomasMonroe » Post

just fork the git repo Skulls
make another branch and tinker around
I don't make messes, I just, er...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 » Post

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: 286
Joined: Tue Apr 04, 2017 16:21
GitHub: ThomasMonroe314
IRC: ThomasMonroe TMcSquared
In-game: ThomasMonroe TMcSquared
Location: Wherever I am at

Re: [shaders]Bloom + Better Light

by ThomasMonroe » Post

then what did you mean by requesting access to the repo?
I don't make messes, I just, er...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 » Post

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: 6972
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: Bristol, United Kingdom
Contact:

Re: [shaders]Bloom + Better Light

by rubenwardy » Post

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
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

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

Re: [shaders]Bloom + Better Light

by ThomasMonroe » Post

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
I don't make messes, I just, er...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 » Post

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 (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: 1386
Joined: Sat Apr 08, 2017 08:16
GitHub: appgurueu
IRC: appguru[eu]
In-game: LMD
Location: Germany
Contact:

Re: [shaders]Bloom + Better Light

by LMD » Post

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.
My stuff: Projects - Mods - Website

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

Re: [shaders]Bloom + Better Light

by Skulls » Post

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

User avatar
LMD
Member
Posts: 1386
Joined: Sat Apr 08, 2017 08:16
GitHub: appgurueu
IRC: appguru[eu]
In-game: LMD
Location: Germany
Contact:

Re: [shaders]Bloom + Better Light

by LMD » Post

Please help me. How can I allow anybody to contribute ?
My stuff: Projects - Mods - Website

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

Re: [shaders]Bloom + Better Light

by Skulls » Post

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests