Asset - Project Glare Engine: Shader based illumination

Tizzio

Member

> Mesh Generator
http://tizzio.github.io/meshgen/

> Link to Marketplace
https://marketplace.yoyogames.com/assets/225/glare-engine-2d-illumination

> FAQ
http://tizsoft.altervista.org/glare/faq/


Discord: https://discord.gg/GBDT2V5

> Demo
Windows (.exe) and Android (.apk)
http://goo.gl/hUFYm6

> Getting started

> Features (HTML5 IS NOT SUPPORTED)
  • GPU computed shadow casting
  • Depth sorted shadows
  • Mesh based shadows
  • Sprite based shadows
  • Directional Shadows
  • Soft shadows
  • 2D Ambient Occlusion
  • Day-Night cycle
  • Area shadows
  • Automatic light deactivation
  • Light based on sprite mask
  • Scalable quality
  • Light intensity
  • Post screen Anti Aliasing
  • Background Self-Illumination
  • Fully customizable
  • Written in GLSL





 
Last edited:

jazzzar

Member
got this yesterday and after running along problems i created a room with the controller in it,after that all the other rooms become messy as hell,resolution changes, a black box covering like 80% of the area,with a white square at the bottom right..it just screwed the whole thing..i think it's a great tool as i tried the demo and it looks awesome, but it just doesn't work for me, i'm dissapointed :(
 

Tizzio

Member
This is my favourite asset on the marketplace, it's amazing.
I was wondering if you had any plans to support bump mapping?
It's a cool suggestion, but not for now.

got this yesterday and after running along problems i created a room with the controller in it,after that all the other rooms become messy as hell,resolution changes, a black box covering like 80% of the area,with a white square at the bottom right..it just screwed the whole thing..i think it's a great tool as i tried the demo and it looks awesome, but it just doesn't work for me, i'm dissapointed :(
Hi, you have 2 solutions:
- set the initialization room size the same of the others
- or initialize the engine with the correct size ( glr_init(quality, width, height, view) in the create event of obj_glare_controller)

 

jazzzar

Member
It's a cool suggestion, but not for now.


Hi, you have 2 solutions:
- set the initialization room size the same of the others
- or initialize the engine with the correct size ( glr_init(quality, width, height, view) in the create event of obj_glare_controller)

nvm u helped me yesterday :)
 

Tizzio

Member
No, this engine uses shaders and it's faster

you can read the features in the first post
  • GPU computed shadow casting (not available in CBNA)
  • Depth sorted shadow rendering (not available in CBNA)
  • Mesh based shadows (not available in CBNA)
  • Sprite based shadows
  • Directional Shadows
  • Soft shadows
  • 2D Ambient Occlusion
  • Day-Night cycle
  • Area shadows (not available in CBNA)
  • Automatic light deactivation
  • Light based on sprite mask
  • Scalable quality
  • Additive Light intensity (not available in CBNA)
  • Post screen Anti Aliasing
  • Background Self-Illumination (not available in CBNA)
  • Written in GML+GLSL (CBNA is gml only)
 
Last edited:
D

Drumble

Guest
Hey Tizzio,

Just wanted to say thanks for the amazing asset. Bought it last year and have been tinkering with it on and off. Brilliant work! Absolutely recommended to anyone thinking about buying it.
 
W

wzspdw

Guest
Hi, I've just got Glare Engine, it seems really fantastic, but where can I get some documents in order learning to use? I'd like to add day_night_circle only during my first step:)
 
Last edited by a moderator:

Tizzio

Member
Hi, I've just got Glare Engine, it seems really fantastic, but where can I get some documents in order learning to use? I'd like to add day_night_circle only during my first step:)
Hello, what do you mean by "during my first step" ?

You can use:
- beginner tutorials
- read the objects code in the included demo (scripts are documented inside the files)
- read the faq
 
Last edited:
W

wzspdw

Guest
Hello, what do you mean by "during my first step" ?

You can use:
- beginner tutorials
- read the objects code in the included demo (scripts are documented inside the files)
- read the faq
thx, another question is how to deal with irregular sprites? I've tried to reset the meshes but it still seems to be box-like ones..
 
W

wzspdw

Guest
Solved--------------------------------------------------------------------------------------
 
Last edited by a moderator:
R

Rosealine

Guest
Sorry to bother, Ive just gotten the Glare lighting engine into my game and the player appears to be unaffected by shadows and with how dark the default is, just seems to glow in game.

Ex: Capture.PNG
 
W

wzspdw

Guest
Hi @Tizzio, I've met problems dealing with gui buttons. When I enabled dayNnight_cycling ,the buttons seems to change color too, how can I leave those buttons without dayNnight_cycle effect?
 

Leon Hurley

Member
Hey @Tizzio

Is there any more detailed documentation on how set and change all the options shown in the debug menu? I've got the engine running in my own game but I'd like be able to alter things I can't see in the beginner tutorials and FAQ.

For example, I'd like to make things darker but the FAQ refers to a glr_set_ambient_color script that doesn't seem to be called anywhere.

Thanks
Leon
 

Leon Hurley

Member
NVM, sorry, realised the details were in the comments almost as soon as I asked.

Hey @Tizzio

Is there any more detailed documentation on how set and change all the options shown in the debug menu? I've got the engine running in my own game but I'd like be able to alter things I can't see in the beginner tutorials and FAQ.

For example, I'd like to make things darker but the FAQ refers to a glr_set_ambient_color script that doesn't seem to be called anywhere.

Thanks
Leon
 

Sirosky

Member
Hey @Tizzio,

Quick question. What exactly is the difference between the old render method and the new one? I was testing the new render system in my project and it actually rendered the submeshes in the wrong location. The submeshes worked fine in the old render method. Do you know what might be the cause of the issue? I'm trying to decide right now if I should use the new render method or just stick with the old one.
 
D

DennisGMC

Guest
I also have this same problem as Sirosky with the new engine. The object x and y coordinates are set to my mouse coordinates. And then a light needs to be drawn at the coordinates of my object (which is at my mouse pointer) but for some reason the light gets placed somewhere else in the map. The object is placed at my mouse fine. So the mouse_x and y coordinates are working normal.
 

Sirosky

Member
Dennis are you using the new render engine? If so, I found that when I adjusted the rendered area size, the out-of-place meshes would relocate to the right location. Not sure if this is the problem you had though.
 
D

DennisGMC

Guest
I am stil having some trouble. So with my scroll wheel i can zoom in or out on the map by modifying the views.
And afterward using this line: glr_set_size(view_wview, view_hview); to fix the lighting positions for lamps in the new engine.
Now my problem is when i zoom out the shadow from the "sun" becomes much longer. And when i zoom in it get shorter.
The left picture is zoomed in and the right is zoomed out. (The images are cropped)
 

Sirosky

Member
@DennisGM I have no idea, sorry. I've only recently started using the lighting engine myself. I guess you could keep your view_width/ height at the same value the entire game, then the shadows wouldn't move around.

On another topic, does anyone know how to exclude certain objects from lighting/ shadows/ atmosphere lighting in the new render engine? It's messing up my user interface elements that aren't done in the Draw GUI event. Here's an example of the problem



Notice how the light shines over the menu and how the shadows are on top of the menu. Any idea how to deal with this?
 
D

DennisGMC

Guest
@Sirosky I need to be able to zoom in my game. I also found some sort of fix. I haven't tested it with lights yet but with the day/night cycle i fixed it. In the script: glr_set_ambient_daytime you need to change a few lines.
Code:
This is for: }else if(a <= 0.6){

Original:
global.GLR_DIRECTIONAL_LENGTH = lerp(0.6,0.25, ratio) * 0.2;

Modified:
global.GLR_DIRECTIONAL_LENGTH = lerp(0.6,0.25, ratio) * 0.2 / (global.zoomlvl);
The shadow will stay the same length when you zoom in or out. global.zoomlvl is my own value which stores the zoom amount.

I have no idea how to exclude an object. I just use the draw GUI event like you mentioned.
 

Sirosky

Member
@DennisGMC Interesting work! I hadn't thought about directly modifying the global GLR variables. Nice find.

Ah well worst comes to worst I'll just stick with the old render engine.
 
D

DennisGMC

Guest
@Sirosky I've thought about it maybe if you change the depth of your object you want to exclude and set it higher or lower than your glare controller.
 

Sirosky

Member
@DennisGMC I believe that works with the old render engine, but not with the new one. I'll have to test it again but pretty sure that's the case, unfortunately.


EDIT: Yup, that seems like the case. The new render system doesn't care about depth.
 
Last edited:
W

wzspdw

Guest
Hey @Tizzio,
I found a problem that sometimes after I change focus to other windows then change back, some light disappeared, and it seems to be randomly happened, how can I fix it?
 

Sammi3

Member
Hello @Tizzio I wanted to ask whether or not this engine is reasonably adaptable to a game that doesn't use objects but a ds_grid for it's casters.
 
D

Drumble

Guest
Hello @Tizzio I wanted to ask whether or not this engine is reasonably adaptable to a game that doesn't use objects but a ds_grid for it's casters.
@Sammi3 I've done this, it's pretty easy. You could do it manually by adding specific meshes/submeshes (shadow casters) at locations based on your ds_grid. If your casters are tile based, there's even a function in Glare to do it automatically, based on the tile layer: glr_mesh_submesh_add_from_tiles.


@Tizzio or anyone else: Has anyone integrated a fog of war system into Glare? I feel like it should be possible to get the final shape of a light source and subtract it from a black surface to create a fog of war, but I haven't been able to get it working. For now, I'm just layering a separate grid-based fog of war on top of Glare, but it doesn't look as nice and piggybacking on the work Glare already does would be much more efficient.
 

JaimitoEs

Member
Hi @Tizzio. I take a look of the new GLR rendering mode :

- REEDITED : I solve my issue with the pixelation problem, i change this part of code in "glr_draw_gamma"...
Original :

Code:
var offsetX = 0, offsetY = 0, sizeX = 0, sizeY = 0;
    if(view_xview < 0){
        offsetX = floor(view_xview) - view_xview;
        sizeX = -offsetX;
    }
    else
        sizeX = view_xview - floor(view_xview);
  
  
    if(view_yview < 0){
        offsetY = floor(view_yview) - view_yview;
        sizeY = -offsetY;
    }
    else
        sizeY = view_yview - floor(view_yview);
 
 
    draw_surface_stretched(global.GLR_MAIN_SURFACE, offsetX, offsetY, sur_w + sizeX -0.01, sur_h + sizeY -0.01)
Edited:

Code:
 /// Application surface use screen coordinates....
    draw_surface(global.GLR_MAIN_SURFACE, 0, 0 );
Anyway, with this method you are limited to the screen buffer size, and all appears more blury if you set the stage interpolated or pixelated if not, zooming in/out the views, you loose all quality definition..so, this is my second question:

- In the scrpit "glr_draw_gamma", in the description, relative with the argument0, you are talking about you can pass this shaders in appication_surface or other surface, but i was not able to do in other surface. Can you explain the method to pass the script with another surface?
- Is posible due a workaround to render in Draw_event? Passing 2 surfaces instead of 1? to solve drawing lights in that event (knowing you are loosing in performace)?

- I use other triangulate script and i managed my work with it, and i want profit this triangles to do everything instead of make another triangle list, so is posible you can create a script to set the mesh from a triangles list?
"glr_mesh_add_from_triangle_list"?.
 
Last edited:

Tizzio

Member
- In the scrpit "glr_draw_gamma", in the description, relative with the argument0, you are talking about you can pass this shaders in appication_surface or other surface, but i was not able to do in other surface. Can you explain the method to pass the script with another surface?
- Is posible due a workaround to render in Draw_event? Passing 2 surfaces instead of 1? to solve drawing lights in that event (knowing you are loosing in performace)?
You have to pass the application_surface because it's where the whole game is rendered (this method is like the final step of deferred rendering pass), if you disable the application surface and you render in your own surface
TL;DR; this argument is for very rare cases, just use the application_surface

- I use other triangulate script and i managed my work with it, and i want profit this triangles to do everything instead of make another triangle list, so is posible you can create a script to set the mesh from a triangles list?
"glr_mesh_add_from_triangle_list"?.
Yes, you can use glr_mesh_submesh_add_list
 

Tizzio

Member
@DennisGMC I believe that works with the old render engine, but not with the new one. I'll have to test it again but pretty sure that's the case, unfortunately.


EDIT: Yup, that seems like the case. The new render system doesn't care about depth.
Sorry for the delay,
The "new rendering system" is not better than the other, it's just additive and gamma corrected
To make it additive, you have to use the application_surface, so anything you render in that surface (gui elements) will be affected by the lighting.
You have to use the DRAW GUI event to fix that or switch to the other rendering system

Hello @Tizzio I wanted to ask whether or not this engine is reasonably adaptable to a game that doesn't use objects but a ds_grid for it's casters.
Yes, this engine is not dependent on gameobjects instances.
The resources allocation/destruction is left to the game developer
 
Last edited:

JaimitoEs

Member
You have to pass the application_surface because it's where the whole game is rendered (this method is like the final step of deferred rendering pass), if you disable the application surface and you render in your own surface
TL;DR; this argument is for very rare cases, just use the application_surface


Yes, you can use glr_mesh_submesh_add_list
Ok! thanks for the help!
 
J

joakimFF

Guest
I played around with Glare on iOS but I cant get it to work, all I get is a black screen... anyone have any tips on how to get it up and running? or is iOS even supported? I should mention it works flawlessly on PC.
 

Tizzio

Member
I played around with Glare on iOS but I cant get it to work, all I get is a black screen... anyone have any tips on how to get it up and running? or is iOS even supported? I should mention it works flawlessly on PC.
Sorry, i don't have a device for each platform, and I use only supported functions from the GM documentation.
There is a different implementation of some rendering function and shader conversion between platform that I can't workaround without a testing device
I hope that's fixed in GMS2

I can't even import glare in the new IDE, due to the beta limitations.
 

Floode

Member
Hi,

I love your glare engine and I'm using it in my latest project. But I'm having trouble getting it to work in Game Maker Studio 2 (which is now available to buy). Only the lighting and shadows are displayed ; no other sprites or tiles.
After porting it up, the demos don't seem to work either.

Do you have any plans to make it compatible with Game Maker Studio 2?
 
I was wondering if you had any plans to support bump mapping?
It's a cool suggestion, but not for now.
It's been a few months since, So I raise the question again: still no plans for bump mapping/normal mapping?

I'm kinda torn here. I love Glare engine and TMCs LUX engine. But Glare engine lacks bump/normal mapping and LUX afaik cant cast shadows of other objects and I'd love to have both features in one engine :)
 

kyle788

Member
Hi Tizzio,

I bought GMS2 (it became available to purchase yesterday) and it appears there are some issues with your Glare engine that I hope can be fixed.

As far as I can tell these are the issues:
- On regular rendering (glr_draw) there is an issue with scrolling/viewports as it shudders when moving left or right (vertically seems fine).
- With the new rendering (glr_draw_gamma) I don't see the shuddering problem but only the shadows and lights are rendered, not any regular sprites/tiles etc.
- Also with either rendering type it seems like meshes do not properly cast shadows and are glitchy.

Hopefully these are minor fixes and don't cause too much time or hassle to fix.

Thanks once again for your great lighting engine!
 
Last edited:

Tizzio

Member
Hi Tizzio,

I bought GMS2 (it became available to purchase yesterday) and it appears there are some issues with your Glare engine that I hope can be fixed.

As far as I can tell these are the issues:
- On regular rendering (glr_draw) there is an issue with scrolling/viewports as it shudders when moving left or right (vertically seems fine).
- With the new rendering (glr_draw_gamma) I don't see the shuddering problem but only the shadows and lights are rendered, not any regular sprites/tiles etc.
- Also with either rendering type it seems like meshes do not properly cast shadows and are glitchy.

Hopefully these are minor fixes and don't cause too much time or hassle to fix.

Thanks once again for your great lighting engine!
Thanks for your reports,
But i don't have GMS2 so i can't fix. I don't know yoyogames plans about supporting or not the old extension on the new GM
I hope in a free GM version for asset creators (yoyogames already takes a cut of the revenues) without executables export because i don't make games with it. I can't spend 99$ only to maintain this extension.
 
G

Grim

Guest
Hi Tizzio,

there's a small issue with your engine: if you only place a single static light and switch it on and off the whole graphic will shift a few pixels on each on/off. Once a second light is placed this does no longer happen.

Thanks for the great engine!
 

Eugen_M

Member
Greetings, i know ive asked for this bugfix once but im asking again because perhaps you will have more time for things like these.

Theres a problem with the glare engine with the new lighting system for background, the lights created should not have any effect on the background as demo 2 shows, this works properly with new render system off but then everything looks bland and boring, the new render system however has a serious issue affecting the background, the more lights you add the more whitened the background becomes (even though its not supposed to be affected at all)

Please do you have any interested into fixing this bug now? as you know i like your engine alot and its a shame for such a trivial bug to ruin the entire lighting system for some specific games :\

Best Regards,
Eugen.
 
B

Bruno A.

Guest
Hello, i have been using your system for months now and i'm still happy and grateful for your work, keep up the good work!

I'm having some trouble with the new rendering system and i hope you can help me, i'm sure it's an easy fix.

If we're working on a game that has 2 or more views, how can we make the new rendering system render only 1 of them to the screen instead of the entire application surface?
I know i can use another surface on glr_draw_gamma, but is there an easier way than creating a surface of the view i want?
 
Last edited by a moderator:
Top