[shaders]Bloom + Better Light

User avatar
ThomasMonroe
Member
 
Posts: 279
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 Nov 23, 2017 14:57

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 » Thu Nov 23, 2017 15:23

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: 7489
Joined: Wed Oct 29, 2014 20:05
Location: OMICRON
GitHub: azekillDIABLO
In-game: azekill_DIABLO

Re: [shaders]Bloom + Better Light

by azekill_DIABLO » Thu Nov 23, 2017 16:25

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: 933
Joined: Sat Aug 05, 2017 08:13
Location: Europe

Re: [shaders]Bloom + Better Light

by voxelproof » Thu Nov 23, 2017 16:59

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: 788
Joined: Sat Apr 08, 2017 08:16
Location: Germany
GitHub: appgurueu
In-game: LMD + PRO_LMD + Limo

Re: [shaders]Bloom + Better Light

by LMD » Thu Nov 23, 2017 19:15

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 ?
 

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

User avatar
ThomasMonroe
Member
 
Posts: 279
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 Nov 24, 2017 23:08

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: 7489
Joined: Wed Oct 29, 2014 20:05
Location: OMICRON
GitHub: azekillDIABLO
In-game: azekill_DIABLO
 

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

Re: [shaders]Bloom + Better Light

by LMD » Sat Nov 25, 2017 13:13

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
 

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

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

Re: [shaders]Bloom + Better Light

by LMD » Sat Nov 25, 2017 14:01

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.
 

User avatar
ThomasMonroe
Member
 
Posts: 279
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 Nov 25, 2017 14:27

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: 788
Joined: Sat Apr 08, 2017 08:16
Location: Germany
GitHub: appgurueu
In-game: LMD + PRO_LMD + Limo

Re: [shaders]Bloom + Better Light

by LMD » Sat Nov 25, 2017 15:32

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...
 

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

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

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

User avatar
ThomasMonroe
Member
 
Posts: 279
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 Nov 25, 2017 19:33

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: 788
Joined: Sat Apr 08, 2017 08:16
Location: Germany
GitHub: appgurueu
In-game: LMD + PRO_LMD + Limo

Re: [shaders]Bloom + Better Light

by LMD » Tue Nov 28, 2017 17:32

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
 

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

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

Re: [shaders]Bloom + Better Light

by LMD » Tue Nov 28, 2017 21:01

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 ?
 

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

Re: [shaders]Bloom + Better Light

by LMD » Wed Nov 29, 2017 15:40

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
 

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

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

Re: [shaders]Bloom + Better Light

by LMD » Wed Nov 29, 2017 18:57

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)
 

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 » Wed Nov 29, 2017 19:05

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 » Wed Nov 29, 2017 19:08

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

PreviousNext

Return to Feature Discussion



Who is online

Users browsing this forum: No registered users and 1 guest