[shaders]Bloom + Better Light

User avatar
ThomasMonroe
Member
Posts: 279
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

burli wrote:
Warrior_4_Christ wrote:I saw this working in a YouTube video. I know it exists, just not where. I would love to see this in the main release.
https://www.youtube.com/user/BlockMenChannel/videos
anyone know where the code to do this is?
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
burli
Member
Posts: 1641
Joined: Fri Apr 10, 2015 13:18

Re: [shaders]Bloom + Better Light

by burli » Post

ThomasMonroe wrote: anyone know where the code to do this is?
Yes, on blockmen's hard drive. Will never be published.

User avatar
azekill_DIABLO
Member
Posts: 7494
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

burli wrote:
ThomasMonroe wrote: anyone know where the code to do this is?
Yes, on blockmen's hard drive. Will never be published.
Super.

User avatar
voxelproof
Member
Posts: 984
Joined: Sat Aug 05, 2017 08:13
Location: Europe

Re: [shaders]Bloom + Better Light

by voxelproof » Post

burli wrote:
ThomasMonroe wrote: anyone know where the code to do this is?
Yes, on blockmen's hard drive. Will never be published.
And it wouldn't be surprising. Is it really so difficult to conceal stolen open source code in closed commercial binary?
Game is the essence of life; therefore every good game makes life better.

User avatar
LMD
Member
Posts: 900
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

I have already implemented glsl shaders and shadows. Shadows are done using a depth map rendered out from the lightsources's view on the map. Real shadows may not be rendered for more than 1 lightsources, because that decreases rendering speed, and is not that important, as well as there's a shader input texture amount limit(think it's about 30), and that would mean much more fbos are needed. I have not implemented bloom before, but that has to be done using a FrameBufferObject, I assume. You just render any lit object as it can be seen. Whether a object can be seen is determined by using a depth map made from the players viewpoint. Also, I have a nice idea about implementing blur, also using the same depth map. Then I would determine the depth at the middle of the depth map/texture, and blur the fbo where the scene is rendered on everywhere where the depth map shows values that are much different. But I have no idea how to use my knowledge without having to rewrite Irrlicht. So, how can I help ?
My stuff: Projects - Mods - Website

User avatar
azekill_DIABLO
Member
Posts: 7494
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

mhh. Can you show us some result of your work?

User avatar
ThomasMonroe
Member
Posts: 279
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

you might want to start with re-working the shaders to accept the shadows, because even if the sun is the only source of light for shadows, the gameplay is improved much more.
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
azekill_DIABLO
Member
Posts: 7494
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

absolutly.

User avatar
LMD
Member
Posts: 900
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

Unfortunately, I did not program shaders with c++, but with Java. I made a quite experimental Java Game Engine, featuring experimental shadows, specular & diffuse lighting, attempts on metallic lighting, transformations using vertice-wise morphing, rainbow effects, a geometry shader, normal & bumpmaps, sound, a some GUI basics, collisions, pointing at etc. I also made an attempt for blurring objects the viewer is not focusing at.

Screenshot rendered to FBO

Sorry that bumpmaps/normalmaps are not visible in there. But that mustn't be added, Minetest engine features that already.

Also, the shadowing is not spectacular, due to simple geometry, and the fact that my Game engine cannot easily run different shaders(the shadow rendering shader & scene rendering shader) "at the same time".

Maybe we should add some reflections for the water ? Or some distortion ? That would be done by creating a stencil buffer object, representing the whole seen water surface. Then render the scene onto this stencil, but flipped upside-down. Distortion may be done by rendering the scene to a FBO, what I'm able to, and then do some past-processing, as it also would be needed for blur. That past-processing would be applying a sinus wave on the FBO and then stretching and scaling the some parts of the rendered FBO.
Attachments
screenshot.png
(95.89 KiB) Not downloaded yet
My stuff: Projects - Mods - Website

User avatar
LMD
Member
Posts: 900
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

Attachments
blur.png
(200.82 KiB) Not downloaded yet
My stuff: Projects - Mods - Website

User avatar
LMD
Member
Posts: 900
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

Light features I could may implement :
  1. Specular lighting
  2. Maybe metallic lighting
  3. Shadows of the sun
  4. I could try Bloon, it's very similar to blurring
Other features :
  1. Blurring objects the viewer doesn't focus at
But I'll have to get to know Irrlicht far better than I do yet.
Manipulating the shaders is not everything, I'll also have to create FBO's etc., what can't be done within the shaders.
My stuff: Projects - Mods - Website

User avatar
ThomasMonroe
Member
Posts: 279
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

LMD wrote:Unfortunately, I did not program shaders with c++, but with Java. I made a quite experimental Java Game Engine, featuring experimental shadows, specular & diffuse lighting, attempts on metallic lighting, transformations using vertice-wise morphing, rainbow effects, a geometry shader, normal & bumpmaps, sound, a some GUI basics, collisions, pointing at etc. I also made an attempt for blurring objects the viewer is not focusing at.

Maybe we should add some reflections for the water ? Or some distortion ? That would be done by creating a stencil buffer object, representing the whole seen water surface. Then render the scene onto this stencil, but flipped upside-down. Distortion may be done by rendering the scene to a FBO, what I'm able to, and then do some past-processing, as it also would be needed for blur. That past-processing would be applying a sinus wave on the FBO and then stretching and scaling the some parts of the rendered FBO.
If I remember correctly many of the same principles apply to the c++ as java, the glsl should be almost the same.

Also that would be awesome, however it would increase render time even more, but again that should not be a concern due to the fact that GPU's these days are getting cheaper and more powerful.
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: 900
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

Yes, the glsl is the same, but what about the FBOs, and the drawing loop, calling the shaders ? I would have to do many modifications there, for creating new FBO's, the depth map, switching shader programs, etc. Also, I'm not sure what glsl version(s) Irrlicht supports, as well as were to make those modifications...
My stuff: Projects - Mods - Website

User avatar
azekill_DIABLO
Member
Posts: 7494
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

Thanks for working on it LMD, it's nice work!

User avatar
burli
Member
Posts: 1641
Joined: Fri Apr 10, 2015 13:18

Re: [shaders]Bloom + Better Light

by burli » Post

Episode IV - A New Hope

User avatar
azekill_DIABLO
Member
Posts: 7494
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

:)

User avatar
ThomasMonroe
Member
Posts: 279
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

LMD wrote:Yes, the glsl is the same, but what about the FBOs, and the drawing loop, calling the shaders ? I would have to do many modifications there, for creating new FBO's, the depth map, switching shader programs, etc. Also, I'm not sure what glsl version(s) Irrlicht supports, as well as were to make those modifications...
It should be similar to Java, I'm not exactly sure how to do it, as I am not fluent in c++ myself, however I am learning.
Irrlicht should support up to 4.0, but I'm not sure
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: 900
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

Some result using extreme blur factors :
Image
Extremely blurred scene in my Java Game Engine

Blur is kinda the small brother of Bloon.download/file.php?mode=view&id=13114
Attachments
extreme_blur.png
Extreme Blur
(154.16 KiB) Not downloaded yet
My stuff: Projects - Mods - Website

User avatar
azekill_DIABLO
Member
Posts: 7494
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

Could you do same for MT?

User avatar
LMD
Member
Posts: 900
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

I am familiar with shaders and OpenGL, but may others MT (and Irrlicht) Experience can help implementing such things. Also, wouldn't reflective water be nice ?
My stuff: Projects - Mods - Website

User avatar
LMD
Member
Posts: 900
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

Just a recent screenshot of blurring, notice objects the viewer does focus at are way less blurred
Image
Attachments
notice.png
(235.62 KiB) Not downloaded yet
My stuff: Projects - Mods - Website

User avatar
azekill_DIABLO
Member
Posts: 7494
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

and in minetest? :D

User avatar
LMD
Member
Posts: 900
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

I need to know the following things, to bring it to minetest :
- Where's the rendering loop ? (Hopefully not inside Irrlicht)
I already know where the shaders are.
Also, blurring things the viewer doesn't focus at is only a small, and a not that important point. To do :
- reflections using stencil
- bloon(I already have a plan, will figure out in two days or so, I expect)
My stuff: Projects - Mods - Website

User avatar
kaadmy
Member
Posts: 706
Joined: Thu Aug 27, 2015 23:07
GitHub: kaadmy
IRC: KaadmY
In-game: KaadmY kaadmy NeD

Re: [shaders]Bloom + Better Light

by kaadmy » Post

AFAIK the rendering calls at least are inside Irrlicht. I think the loop itself is outside and just calls Irrlicht's render function. I think the function in question are in https://github.com/minetest/minetest/bl ... r/core.cpp, but I'm not absolutely sure.
Never paint white stripes on roads near Zebra crossings.

Pixture

User avatar
burli
Member
Posts: 1641
Joined: Fri Apr 10, 2015 13:18

Re: [shaders]Bloom + Better Light

by burli » Post

I don't think, blur makes much sense except for screenshots. Most important shaders for me would be shadows, reflections, goodray and bloom

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests