1. Hey! Guest! The 33rd GMC Jam will take place between May 23rd, 12:00 UTC (Friday noon) and May 27th, 12:00 UTC (Monday noon). Why not join in! Click here to find out more!
    Dismiss Notice

Asset - Project Glare Engine: Shader based illumination

Discussion in 'Marketplace' started by Tizzio, Jun 20, 2016.

Tags:
  1. Tizzio

    Tizzio Member

    Joined:
    Jun 20, 2016
    Posts:
    17
    [​IMG]
    > 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/

    [​IMG]
    Discord: https://discord.gg/GBDT2V5

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

    > Getting started
    http://tizsoft.altervista.org/glare/doc2/Getting_Started.html

    > 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

    [​IMG]

    [​IMG]

    [​IMG]
     
    Last edited: Dec 17, 2016
  2. Spacedog

    Spacedog Member

    Joined:
    Jun 21, 2016
    Posts:
    5
    This is my favourite asset on the marketplace, it's amazing.

    I was wondering if you had any plans to support bump mapping?
     
    Tizzio likes this.
  3. jazzzar

    jazzzar Member

    Joined:
    Jun 29, 2016
    Posts:
    514
    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 :(
     
  4. Tizzio

    Tizzio Member

    Joined:
    Jun 20, 2016
    Posts:
    17
    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)

    [​IMG]
     
    jazzzar and Nocturne like this.
  5. jazzzar

    jazzzar Member

    Joined:
    Jun 29, 2016
    Posts:
    514
    nvm u helped me yesterday :)
     
    Tizzio likes this.
  6. Opticrow

    Opticrow Member

    Joined:
    Jun 21, 2016
    Posts:
    48
    I apologise if I'm horribly mistaken, but isn't this just the CNBA lighting engine? The sourcecode of which has been available for free, for ages?

     
    CyberTwister likes this.
  7. Tizzio

    Tizzio Member

    Joined:
    Jun 20, 2016
    Posts:
    17
    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: Jul 10, 2016
    Opticrow likes this.
  8. Opticrow

    Opticrow Member

    Joined:
    Jun 21, 2016
    Posts:
    48
    Well then I apologise for being horribly mistaken :)
     
  9. Drumble

    Drumble Member

    Joined:
    Jul 11, 2016
    Posts:
    3
    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.
     
  10. jazzzar

    jazzzar Member

    Joined:
    Jun 29, 2016
    Posts:
    514
    +1 recommend for everyone, but not for android games, it doesn't work properly :)
     
  11. wzspdw

    wzspdw Member

    Joined:
    Jul 22, 2016
    Posts:
    24
    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: Jul 22, 2016
  12. Tizzio

    Tizzio Member

    Joined:
    Jun 20, 2016
    Posts:
    17
    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: Jul 24, 2016
  13. wzspdw

    wzspdw Member

    Joined:
    Jul 22, 2016
    Posts:
    24
    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..
     
  14. Tizzio

    Tizzio Member

    Joined:
    Jun 20, 2016
    Posts:
    17
    wzspdw likes this.
  15. jazzzar

    jazzzar Member

    Joined:
    Jun 29, 2016
    Posts:
    514
    Hey @Tizzio did you get the engine to work properly on android?
     
  16. wzspdw

    wzspdw Member

    Joined:
    Jul 22, 2016
    Posts:
    24
    Solved--------------------------------------------------------------------------------------
     
    Last edited: Aug 1, 2016
  17. Rosealine

    Rosealine Member

    Joined:
    Jul 3, 2016
    Posts:
    10
    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
     
  18. wzspdw

    wzspdw Member

    Joined:
    Jul 22, 2016
    Posts:
    24
    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?
     
  19. Leon Hurley

    Leon Hurley Member

    Joined:
    Aug 7, 2016
    Posts:
    32
    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
     
  20. Leon Hurley

    Leon Hurley Member

    Joined:
    Aug 7, 2016
    Posts:
    32
    NVM, sorry, realised the details were in the comments almost as soon as I asked.

     
    Tizzio likes this.
  21. Sirosky

    Sirosky Member

    Joined:
    Jun 20, 2016
    Posts:
    11
    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.
     
  22. DennisGMC

    DennisGMC Member

    Joined:
    Jun 21, 2016
    Posts:
    42
    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.
     
  23. Sirosky

    Sirosky Member

    Joined:
    Jun 20, 2016
    Posts:
    11
    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.
     
    DennisGMC likes this.
  24. DennisGMC

    DennisGMC Member

    Joined:
    Jun 21, 2016
    Posts:
    42
    @Sirosky Yes is was using the new render engine. This fixed it thanks!
     
    Sirosky likes this.
  25. DennisGMC

    DennisGMC Member

    Joined:
    Jun 21, 2016
    Posts:
    42
    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)
    [​IMG]
     
  26. Sirosky

    Sirosky Member

    Joined:
    Jun 20, 2016
    Posts:
    11
    @DennisGMC That happens to me too. I figured it was a feature, not a bug lol.
     
  27. DennisGMC

    DennisGMC Member

    Joined:
    Jun 21, 2016
    Posts:
    42
    @Sirosky Any way to remove this feature?
     
  28. Sirosky

    Sirosky Member

    Joined:
    Jun 20, 2016
    Posts:
    11
    @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

    [​IMG]

    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?
     
  29. DennisGMC

    DennisGMC Member

    Joined:
    Jun 21, 2016
    Posts:
    42
    @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 likes this.
  30. Sirosky

    Sirosky Member

    Joined:
    Jun 20, 2016
    Posts:
    11
    @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.
     
    DennisGMC likes this.
  31. DennisGMC

    DennisGMC Member

    Joined:
    Jun 21, 2016
    Posts:
    42
    @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.
     
  32. Sirosky

    Sirosky Member

    Joined:
    Jun 20, 2016
    Posts:
    11
    @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: Aug 27, 2016
  33. wzspdw

    wzspdw Member

    Joined:
    Jul 22, 2016
    Posts:
    24
    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?
     
  34. Sammi3

    Sammi3 Member

    Joined:
    Jun 20, 2016
    Posts:
    159
    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.
     
  35. Drumble

    Drumble Member

    Joined:
    Jul 11, 2016
    Posts:
    3
    @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.
     
  36. JaimitoEs

    JaimitoEs Member

    Joined:
    Aug 9, 2016
    Posts:
    118
    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: Oct 20, 2016
  37. Tizzio

    Tizzio Member

    Joined:
    Jun 20, 2016
    Posts:
    17
    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
     
    JaimitoEs likes this.
  38. Tizzio

    Tizzio Member

    Joined:
    Jun 20, 2016
    Posts:
    17
    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

    Yes, this engine is not dependent on gameobjects instances.
    The resources allocation/destruction is left to the game developer
     
    Last edited: Nov 6, 2016
    Sammi3 and Sirosky like this.
  39. Sirosky

    Sirosky Member

    Joined:
    Jun 20, 2016
    Posts:
    11
    No problem! Thanks, that helps.
     
  40. JaimitoEs

    JaimitoEs Member

    Joined:
    Aug 9, 2016
    Posts:
    118
    Ok! thanks for the help!
     
  41. joakimFF

    joakimFF Member

    Joined:
    Jun 20, 2016
    Posts:
    119
    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.
     
  42. Tizzio

    Tizzio Member

    Joined:
    Jun 20, 2016
    Posts:
    17
    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.
     
  43. Floode

    Floode Member

    Joined:
    Nov 23, 2016
    Posts:
    1
    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?
     
  44. joakimFF

    joakimFF Member

    Joined:
    Jun 20, 2016
    Posts:
    119
    Anyone got gamma rendering mode working under Ubuntu?
     
  45. The Reverend

    The Reverend Member

    Joined:
    Sep 8, 2016
    Posts:
    540
    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 :)
     
  46. kyle788

    kyle788 Member

    Joined:
    Nov 23, 2016
    Posts:
    1
    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: Nov 23, 2016
  47. Tizzio

    Tizzio Member

    Joined:
    Jun 20, 2016
    Posts:
    17
    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.
     
  48. Grim

    Grim Member

    Joined:
    Aug 6, 2016
    Posts:
    1
    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!
     
  49. Eugen_M

    Eugen_M Member

    Joined:
    Jul 25, 2016
    Posts:
    12
    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.
     
  50. Bruno A.

    Bruno A. Member

    Joined:
    Nov 23, 2016
    Posts:
    18
    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: Jan 10, 2017

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice