Asset - Shaders 2D Block Lighting (free)

Dragon47

Member
Last edited:
T

ThunkGames

Guest
Wasn't a pure copy/paste job, but the stuff I learned looking over this code is worth more to me than anything I've ever actually paid for on the marketplace.
 
S

seanm

Guest
Hey, I love this asset, but I've got a question.
I've only used the old version and now I can't seem to make things work the way they used to.

I feel like I used to be able to pretty easily adjust the alpha of the fog, and the size of the blur. Both of those things don't seem to be so easy to change any more.

Is there something obvious that I missed, or will this take some larger changes to accomplish?
 

Dragon47

Member
Hey, I love this asset, but I've got a question.
I've only used the old version and now I can't seem to make things work the way they used to.

I feel like I used to be able to pretty easily adjust the alpha of the fog, and the size of the blur. Both of those things don't seem to be so easy to change any more.

Is there something obvious that I missed, or will this take some larger changes to accomplish?
It has been a long time since I've looked into this asset, but it might be possible to change the alpha by changing the "1" to a desired alpha in the bl_rectangle_draw script at the end of all lines starting with "shader_set_uniform_f(global.__bl_uniform_sh_bl_draw_color, ". As for the size of the blur, there are two lines starting with "shader_set_uniform_f(global.__bl_uniform_sh_bl_blur_x_size, " and "shader_set_uniform_f(global.__bl_uniform_sh_bl_blur_y_size, ", if you lower the values these functions set you can change the amount of blurring. E.g. change "shader_set_uniform_f(global.__bl_uniform_sh_bl_blur_x_size, 1 / sf_width);" into "shader_set_uniform_f(global.__bl_uniform_sh_bl_blur_x_size, 1 / sf_width * 0.5);"
 
J

Jeason1997

Guest
Hi, I use your Block Lighting 2D for GMS2, but there some compile error:

Code:
___________________________________________
############################################################################################
FATAL ERROR in Vertex Shader compilation
ShaderName: sh_bl_blur_x

Invalid shader
 at gml_Script_bl_rectangle_draw (line 60) -                     shader_set(sh_bl_blur_x);
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Script_bl_rectangle_draw (line 60)
called from - gml_Object_obj_example_Draw_0 (line 23) -         bl_rectangle_draw(bl_rectangle, block_grid, 0, 0, blocks_horizontally, blocks_vertically, 0, 0, c_black);
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
Right click on the shader in the resource tree and make sure it is the correct type (probably GLSL ES is what you need).
 
Z

zendraw

Guest
clamp the mouse pos actions in the grid size, else it goes crazy in the compiler or ide or w/e its called.
 

Dragon47

Member
Thank you for helping out. As already pointed out, make sure all shaders are set to GLSL ES, and you might also want to clamp the grid actions although it's not directly related to the error you posted.
 
M

MasterGrey

Guest
This is not bad you sir require a cookie but i am curious do they have to use the example script or can they just create their own lighting system using your code.
 
M

MasterGrey

Guest
Thank you. You don't have to use the example code.
So then mate how would i use this in my lighting script because i have some simple codes i just need to know the functions of your lighting engine.
So if you have some sort of documentation.
 

Dragon47

Member
So then mate how would i use this in my lighting script because i have some simple codes i just need to know the functions of your lighting engine.
So if you have some sort of documentation.
The scripts and example are commented. I recommend reading through these comments and the example code and try to understand how the asset works.
 

Limekys

Member
Please, make it for GMS 2. I was make it, but have some problem with draw block, it's still drawing when i delete blocks. (sorry for my english)
 

oldbomb

Member
The scripts and example are commented. I recommend reading through these comments and the example code and try to understand how the asset works.
This is really very well commented, thank you for that, one can really read through the whole thing to understand everything.
 
Top