1. Hey! Guest! The 34th GMC Jam will take place between August 22nd, 12:00 UTC (Thursday noon) and August 26th, 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. DukeSoft

    DukeSoft Member

    Joined:
    Jun 20, 2016
    Posts:
    769
    You sell it for 10$ each, and given the fact you have 49 reviews you'll have at least 200 sales... Okay :(
     
  2. Tizzio

    Tizzio Member

    Joined:
    Jun 20, 2016
    Posts:
    17
    I understand your point. I worked on it for about 2 years, and i will continue to upgrade it when yoyogames will release a free version or "marketplace content creator license" (where you can use the engine without export modules). This marketplace for me is more like a collaboration with them, because i switched to another engine.
    Anyway, GMS2 is currently in beta, so we can't say anything about the final price
     
  3. DukeSoft

    DukeSoft Member

    Joined:
    Jun 20, 2016
    Posts:
    769
    True, true, very true.

    I'm still a fond user of GM:S1.4 and I'm using your engine too.

    While we're at it, i have a question;

    I have multiple wall objects that each use a JSON vertex list. They are aligned next to each other, but it seems like they sometimes cast shadows on top of another (and sometimes not).

    I also see that a light kind of layers over the wall, where I would actually like the light to just stop at the wall, and not light it at all. Is this the light / mesh height?

    Do you understand what I mean?
     
  4. Tizzio

    Tizzio Member

    Joined:
    Jun 20, 2016
    Posts:
    17
    Do your meshes have a depth?
    Each light does a check before rendering a visible mesh: if its layer is lower than the mesh's layer, no shadow will be cast
     
  5. Spacedog

    Spacedog Member

    Joined:
    Jun 21, 2016
    Posts:
    5
    I have a tester who gets an error that I can't reproduce on a different machine, and I'm not sure where to start fixing it:

    FATAL ERROR in Vertex Shader compilation
    ShaderName: glr_shader_mesh_color

    D3DXCompile failed - result

    at gml_Script_glr_render

    His machine is an AMD FX 8350 with an Nvidia GTX 1060 on Windows 10 64bit.

    My machine is the same except I have a GTX 970, and I don't get this error.

    Any ideas what the problem might be?

    EDIT: Found the problem, lack of DirectX runtimes. This package fixes it https://www.microsoft.com/en-us/download/details.aspx?id=8109
     
    Last edited: Feb 5, 2017
  6. rIKmAN

    rIKmAN Member

    Joined:
    Sep 6, 2016
    Posts:
    4,335
    Would the lights in this asset work with sprites created with something like SpriteIlluminator that uses normal maps?

    I saw an earlier comment on page 1 that said it didn't support bump maps, so thought I would ask about normal maps.
     
  7. Ian

    Ian Member

    Joined:
    Jun 20, 2016
    Posts:
    143
    Was wondering if you have any plans to make it compatible with GMS2.

    I just got it, i imported my project and ran it. As for your lighting engine everything worked except shadows. Looked back in the compatibility log that was made when i imported my project i got errors on "layer" variable which i find out is used quite frequently in your enumerators and the reason for the error is because GMS2 now has "layer" as a built in function :/

    Its used alotttttt and im not going to waste my time doing tedious fixes just to port a lighting engine (the reason i have it, to avoid the hassle. why reinvent the wheel) to GMS2 when i can keep working on GMS 1.4

    So might get a refund on the engine and just keep working on 1.4

    EDIT:

    Heres a screen cap
    [​IMG]
     
    Last edited: Mar 28, 2017
  8. Lycanphoenix

    Lycanphoenix Guest

    The scripts are stored in GMX, if I recall correctly, which is based on XML. Using Notepad++ should let you do a mass edit by searching for all instances of something and automatically replacing it with something else.
     
  9. Ian

    Ian Member

    Joined:
    Jun 20, 2016
    Posts:
    143
    Its not just that:
    [​IMG]

    Where it clears all lights/shadows at room end. What would have changed from how it ran on 1.4 to 2?
     
  10. Lycanphoenix

    Lycanphoenix Guest

    I'm afraid I don't know enough about GM:S 2.0, or about programming.
     
  11. rIKmAN

    rIKmAN Member

    Joined:
    Sep 6, 2016
    Posts:
    4,335
     
  12. Lycanphoenix

    Lycanphoenix Guest

    Did you need to quote your own post?
     
  13. Ian

    Ian Member

    Joined:
    Jun 20, 2016
    Posts:
    143
    Well if u wanna debug, use the glare demo because it utilizes most to all features so if you can run all rooms smoothly with no errors u got it. Everything in the demo worked in GM:S 2 until u get to the second top down room. Then it gives u that error i posted.
     
  14. MilkyBrain

    MilkyBrain Member

    Joined:
    Jun 21, 2016
    Posts:
    9
    Hello.

    I've got a problem with static light and JSON mesh.

    [​IMG]
    http://imgur.com/sAIKk29

    When I use static JSON mesh and static light, there are unknown shadow rays right above the mesh. However, there is no problem with dynamic lights.
    How can I prevent it?

    P.S. JSON mesh has about 100 points.

    [​IMG]
    http://imgur.com/7WY1tXq

    Thank you.
     
  15. DukeSoft

    DukeSoft Member

    Joined:
    Jun 20, 2016
    Posts:
    769
    This is the same issue I'm having - also static lights and JSON meshes;

    [​IMG]
     
  16. joakimFF

    joakimFF Member

    Joined:
    Jun 20, 2016
    Posts:
    119
    Has anyone got the new rendering mode working under anything else then windows? I tried on ios,android,macos and linux and the result is the same. The entire view is just white and you can see the light sources as bloomed splotches.
     
  17. DukeSoft

    DukeSoft Member

    Joined:
    Jun 20, 2016
    Posts:
    769
    Its not working on other platforms? ... I've only developed on WIndows and was assuming this asset was of decent quality :p
     
  18. DukeSoft

    DukeSoft Member

    Joined:
    Jun 20, 2016
    Posts:
    769
    I managed to fix it! Looks like my points were inversed. You'll need to go clockwise with the points (I think). Try loading in the mesh in the editor; https://tizzio.github.io/meshgen/ and reversing the order. This fixed my issues!
     
  19. MilkyBrain

    MilkyBrain Member

    Joined:
    Jun 21, 2016
    Posts:
    9
    Thanks, I'll try:)
     
  20. sheffrator

    sheffrator Guest

    Hi.
    How can I keep my background light and not affected by darkness? Like you have in demo scene room_glr_platform_outside with night sky and stars.
    Thank you.
     
  21. kburkhart84

    kburkhart84 Firehammer Games

    Joined:
    Jun 26, 2016
    Posts:
    463
    I came here wanting to ask when the engine would be updated to GMS2....good thing I haven't bought it. The last post from the author here was Jan 29th. I read thru the topic as well and saw that the author had moved to another engine, meaning he/she didn't want to invest in GMS2 in order to make this happen. I also happened on the author's website, and the link for the support forum was never updated(still points to the old GMC). So, I'm feeling like it isn't a good idea to invest in this asset currently, as I don't think it will be getting updated or supported anymore....sucks to see that happen to good assets.
     
    DukeSoft likes this.
  22. DukeSoft

    DukeSoft Member

    Joined:
    Jun 20, 2016
    Posts:
    769
    As far as I can tell most of it was from the CNBA engine anyway, but yeah this is more performant as it uses the GPU. Maybe try moving that project to GM:S2?
     
  23. kburkhart84

    kburkhart84 Firehammer Games

    Joined:
    Jun 26, 2016
    Posts:
    463
    I'm understanding it had features of the CNBA engine, but I doubt Tizzio actually used any of the code from that. That project is pretty old to be much use in newer GMS from how I see it, and this engine was using shaders, not surfaces.
     
  24. DukeSoft

    DukeSoft Member

    Joined:
    Jun 20, 2016
    Posts:
    769
    This uses both shaders and surfaces, and it does look a lot alike.. So hence my assumption
     
  25. kburkhart84

    kburkhart84 Firehammer Games

    Joined:
    Jun 26, 2016
    Posts:
    463
    Yeah, I get the look-alike part...they look close enough and have close enough of a feature list...it happens. But seeing the internals of the two you can tell that Glare did not directly copy CNBA. Also, as far as lighting engines go, you generally have one big list of features, many of which are going to be in all lighting engines, and then others that are only going to be in the 'powerhouse' engines. CNBA and Glare I would consider to be 'powerhouse' engines and therefore would contain many of the same features.
     
  26. Rednavi

    Rednavi Member

    Joined:
    Apr 23, 2017
    Posts:
    12
    Man, it's a shame that this doesn't work in GMS2 correctly. I would've bought it in a heartbeat otherwise.
     
  27. AllCrimes

    AllCrimes Member

    Joined:
    Jun 23, 2016
    Posts:
    36
    It's very strange.

    I am running GMS2. I have two projects with version 2.4.1 of glare installed. The older project from around the time of release works, but the newest project with files added from the current marketplace within GMS2 does not work.

    Not sure why they would be different since they both share the same version, but I'm going to try importing the files from my old project instead of from the marketplace sometime this weekend to see if that fixes things...
     
  28. Bruno A.

    Bruno A. Guest

    Hello, need help with a problem about the rendering modes.

    Currently, I'm using the common render "glr_draw" mode, which works just fine.
    normal render.jpg

    But I really wanted to switch to the new rendering system "glr_draw_gamma". The problem is that when I do this, everything gets's stretched.
    new render.jpg

    I presume this happens because the right menu bar which has its separate view, is also rendered onto the application_surface and because the new rendering system handles surfaces instead of views, the lightings get stretched as if the entire thing is the world.

    Any help? Thank you.
     
    Last edited by a moderator: Jul 29, 2017
  29. DukeSoft

    DukeSoft Member

    Joined:
    Jun 20, 2016
    Posts:
    769
    I have it working in GMS2. It takes some fiddling with the view settings but thats about it.

    @Bruno - try changing some resolution settings within Glare. Its using a funky setup with views and surfaces.
     
    Bruno A. likes this.
  30. Bruno A.

    Bruno A. Guest

    Thanks!

    After 2 minutes of examining the "glr_draw_gamma" script, I found the solution. How didn't I think of that before?

    For anyone with a similar problem, keep "argument0" as "application_surface" but in the script, change lines 41 and 42 to the desired width and height.
     
  31. 7bones

    7bones Member

    Joined:
    Jun 22, 2016
    Posts:
    44
    Hello! I bought Glare engine and I think is really great tool! But I have one big problem with it i cant solve.
    Im making top-down game where camera is rotating with view of obj_Player,also using often zooming of screen.When i rotate screen i see end of surface,like player is always in corner of surface where glare is working- no matter how big surface i make (even much bigger then room)-player will be always in corner-and when rotate or zoom out it is visible.Here is question: how make surface ALWAYS draw center to the player position?

    Here is example in movie



    Edit.Solved if enyone have same problem
    I added in glare_controller in draw
    var v_x0 = view_xview[0]-600,
    v_y0 = view_yview[0]-720,

    Now i have antoher one: how make torchlight?? I mean how dynamic change color in lights?
     
    Last edited: Aug 23, 2017
  32. Bruno A.

    Bruno A. Guest

    If I understand correctly, you want a torch that alternates between different shades of orange and yellow.

    I can show you a torch object from my project, it's not perfect but it works decently and it's easy to improve from there.

    Obj_torch
    Create Event:

    Code:
    lum = 0.1;
    alarm[0] = 2;
    
    sprite = spr_glr_light_mask_point_768; // Use any gradient of your choice here
    color = make_colour_hsv(13, 180, 180); // i used just one color but you can add more
    light = glr_light_create(sprite, 0, x, y, color, lum);
    glr_light_set_layer(light, 10);
    glr_light_set_depth(light, 5);
    glr_light_set_shadow_strength(light, 0.4);
    Alarm[0]:
    Code:
    var ri = random_range(lum/2, lum*1.25);
    glr_light_set_intensity(light,ri);
    
    alarm[0] = room_speed/5;
    This creates a light and will randomly change its intensity pretty rapidly, simulating a real torch effect.
    If you want to add color variation, you can just create more colors in the create event and use a choose function in the alarm[0] to randomly alternate between all the colors. For example:

    Alarm[0]:
    Code:
    glr_light_set_color(light, choose(color, color2, color3));
    Honestly, I didn't think color variation was necessary but if you take your time finding the right colors, it may look better.

    Hope this helps.
     
    Last edited by a moderator: Aug 26, 2017
  33. Bruno A.

    Bruno A. Guest

    One question:

    Is it possible to change the direction of "directional lighting" shadows? I want them to point north at noon and move from right to left.

    I tried searching the core files and I found something promising but unfortunately, nothing happens when I change it. Maybe some other variable is overriding this one?

    glr_init:
    120: global.GLR_DIRECTIONAL_STRENGTH = 0.5;
    121: global.GLR_DIRECTIONAL_ANGLE = 320;
    122: global.GLR_DIRECTIONAL_LENGTH = 0.2;
     
    Last edited by a moderator: Aug 26, 2017
  34. Bruno A.

    Bruno A. Guest

    Ok, I found it...
    It's in the script "glr_set_ambient_daytime" at line 69.

    Changed the default math to the one below and now the shadow faces north and moves from west to east, like in the northern hemisphere.
    Code:
    global.GLR_DIRECTIONAL_ANGLE = 180 - (a * 150);


    EDIT:

    Code:
    global.GLR_DIRECTIONAL_ANGLE = -100 - (275 * a);
    Or this one to keep the rotation flow exactly the same as the original but following the above specifications.
     
    Last edited by a moderator: Aug 27, 2017
  35. 7bones

    7bones Member

    Joined:
    Jun 22, 2016
    Posts:
    44
    thx
    But i have new one now
    My light shows on view to late,im already in distance to see it but it still off-then it rapidly turns on like switch- but that is fire flame so looks very bad.How make light turn from farer distance??
     
  36. Spacedog

    Spacedog Member

    Joined:
    Jun 21, 2016
    Posts:
    5
    Has anyone managed to figure out why the new rendering system doesn't work in GMS2 yet?

    It looks like something that could be quite simple, like the lights are simply overwriting the application surface instead of blending but I don't have the skills to figure it out.
     
  37. Ian

    Ian Member

    Joined:
    Jun 20, 2016
    Posts:
    143
    I have a weird glitch, when theres no light source inside the view the glr surface gets dis-positioned (when theres light everything goes to where it should):
    [​IMG]

    anybody else experience this before?


    EDIT:
    Not really a fix but just went ahead and enabled directional lighting and any shadow mesh in the game i just added
    Code:
    glr_mesh_set_directional_shadow_length(mesh, 0);
     
    Last edited: Sep 24, 2017
  38. Ian

    Ian Member

    Joined:
    Jun 20, 2016
    Posts:
    143
    Would anyone know how to get lights/shadows to only show for foreground elements (excluding the BGs) on a 2D Platformer?
     
  39. Ednei

    Ednei Member

    Joined:
    Jun 22, 2016
    Posts:
    178
    I converted my project from GM1.4 to the GM2 and the Glare Engine worked very well.

    However I tried to create a Minimap using view_camera [1] and realized that Glare Engine is interfering with the correct functioning of this camera:
    Pic1 (glare off)
    glareoff.png

    Pic 2 (glare on)
    glareon.png

    I'm trying to create a Minimap that shows a complete aerial photo of the Room as in Pic1 (glare off), however with the Glare on the Minimap does not work correctly Pic 2 (glare on).

    To create this Minimap I used this code:

    Code:
    view_visible[1] = true;     
    view_xport[1] = 0;
    view_yport[1] = 0;
    view_wport[1] = 256
    view_hport[1] = 176
    
    view_camera[1] = camera_create_view(0, 0, room_width, room_height, 0, noone, 5, 5, -1, -1);
    
    I know this topic does not support GM2, but someone had this experience and can you tell me what's going on?

    Thank you

    Ednei
     
  40. Ian

    Ian Member

    Joined:
    Jun 20, 2016
    Posts:
    143
    nvm, you cant give the light a depth feel with the glare engine like this:
    [​IMG]
     
  41. Ian

    Ian Member

    Joined:
    Jun 20, 2016
    Posts:
    143
    Has anyone found out how to fix the 'glr_shadowarea_destroy_all' script in GM:S 2?
    [​IMG]
    Is it the new d3d_model_clear compatibility script causing the problem?
     
  42. DukeSoft

    DukeSoft Member

    Joined:
    Jun 20, 2016
    Posts:
    769
    if (is_array(__m)) {}

    ??
     
  43. Andysaur

    Andysaur Member

    Joined:
    Feb 4, 2018
    Posts:
    1
    Hello guys, this is my first post ever!

    I recently purchased the glare engine, such a great tool, and I've been trying to apply it, a little unorthodoxly, for a top down pixel art game similar to The Legend of Zelda: A Link to the Past. I am using Game Maker Studio 1.4. I have a couple of questions:

    1) I want my hero and enemy objects etc. to NOT be shadowed by the global.GLR_MAIN_SURFACE because their sprite should change color ( lit / shadowed) according to their x,y origin position on the room, otherwise the shadows don't fall quite right on top of them and don't match the perspective. BUT I still want all the background tiles, ground and walls to be lit by the global.GLR_MAIN_SURFACE.

    My solution was to change the depth of the obj_glare_controller to -1 so that the objects in the room are not affected and only the background tiles are. And then use this code in the draw event of the hero object for example:​

    hero object's Draw Event:

    draw_self()
    if (surface_exists(global.GLR_MAIN_SURFACE))
    {
    draw_set_blend-mode(bm_add);
    col = surface_getpixel(global.GLR_MAIN_SURFACE, x, y);
    draw_self();
    image_blend = col;
    draw_set_blend_mode(bm_normal);​
    }

    The result is the hero becomes completely black in shadowed areas disregarding the gradient of the shadow and around light areas his color is not consistent to the gradient of the light but flashes in a seemingly random manner. Sorry, that's the best discription I could write.

    Is there a way to achieve this? ALSO I read it's not the best practise to use the surface_getpixel command because it is costly in memory. Is there a better way to do this?​

    2) Can I group a few shadow objects together so that their shadows don't add on top of eachother? I don't want their shadows to darken as they fall on top of eachother. I want them to stay the same shade of grey :p and I also want them to have the same shadow strength.

    Please help me, I am getting a real headache over all this depth and tile layer situation! Sorry for my english, I'm Greek. XD :p
     

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