Git Product home page Git Product logo

lighting-system-2d's People

Contributors

borup3 avatar harperj0 avatar perdog avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

lighting-system-2d's Issues

macOS issue. light not appearing.

Hi,

This does not seem to work on macOS?

I'm getting a "lights turned off" look. Someone on youtube also commented on that.

image

image

Thanks

Random "trying to index a variable which is not an array" errors

Hi, I followed the tutorial step by step and I'm getting

_________________________________________
############################################################################################
ERROR in
action number 1
of Draw Event
for object obj_light_renderer:

trying to index a variable which is not an array
 at gml_Script_lighting_pre_composite (line 21) -                      outside_active_camera = !rectangle_in_rectangle(cached_polygon_area[0], cached_polygon_area[1], cached_polygon_area[2], cached_polygon_area[3],
############################################################################################
gml_Script_lighting_pre_composite (line 21)
gml_Script_composite_shadow_map (line 10) -        lighting_pre_composite();
gml_Object_obj_light_renderer_Draw_0 (line 8) -        exists = composite_shadow_map(global.worldLights);

If I create blank project and create the demo project I get

___________________________________________
############################################################################################
ERROR in
action number 1
of Draw Event
for object obj_light_renderer:

trying to index a variable which is not an array
 at gml_Script_light_trace_polygon (line 44) -        var vertex_count = polygon[ePolygon.Length];
############################################################################################
gml_Script_light_trace_polygon (line 44)
gml_Script_light_update (line 208) -                                    shadow = light_trace_polygon(id, light);
gml_Script_light_draw_shadow_map (line 40) -        var vertexbuffer = update ? light_update(light) : light[| eLight.VertexBuffer];
gml_Script_composite_shadow_map (line 122) -               light_draw_shadow_map(light, shadowMap, true);
gml_Object_obj_light_renderer_Draw_0 (line 8) -        exists = composite_shadow_map(global.worldLights);

Please help me make this work, I don't understand what am I doing wrong.

polygon_from_instance - Doesn't get bounding box for angles different than 0 degrees

As it can be seen on the screenshoot, in a case the instance we want to create polygons from has an angle different than 0 degrees, the polygons will be created taking into account the sprite width, instead the bounding box, which is a different behavious from the case of 0 degrees.

This should be fixed and also there could be an additional boolean argument in the function to alternate the polygon generation: either using the bounding box or the sprite dimensions (by deault true which means generate from bounding box).

image

var buffer = light[| eLight.VertexBuffer]; "argument 1 incorrect type (array) expecting a Number"

I have several lights in a scene. Whenever I change rooms, the following error is thrown.

ds_list_find_value argument 1 incorrect type (array) expecting a Number (YYGI32)
at gml_Script_light_destroy (line 8) - var buffer = light[| eLight.VertexBuffer];
############################################################################################
gml_Script_light_destroy (line 8)
gml_Object_i_Light_CleanUp_0 (line 4) - light_destroy(light);

When I inspect eLight.VertexBuffer in the debugger, the value shows as 14, not an array as the exception states.

Shadows to not render properly on MacOS

The shadows don't render correctly on MacOS resulting in either a flickering between no shadows or 100% shadows across the whole viewport. The issue has been occuring on a 2022 M1 Pro Macbook Pro with MacOS Ventura. Please let me know if someone else manages to re-produce the issue on their machine!

Multiple Cameras / Viewports Support

Hey, I downloaded and tried this lighting system yesterday, it's really fantastic work! Thank you so much for open-sourcing it!

I did have a quick question though as I've only started using GMS2 a few days ago so I'm not mega-familiar with it yet... (although I have written an entire game engine myself (see https://github.com/irrelon/ige) so I'm not a noob either).

Does the lighting system support multiple viewports? I tested with a multi-viewport game but I am seeing a weird effect where the second viewport's shadows follow the position of the first viewport's camera.

I had a look in the lighting system source code and it looks like it should work because it's getting the active camera at time of render but I'm obviously missing something!

On the left viewport (the first vp and camera) the shadows look fine. On the second on the right, they are offset by the position of the left viewport's camera.

Here's a pic of what I mean:

Screenshot (1)

Issue with HTML5

Hello, first off thanks a lot for sharing this great engine. It works great on windows but in HTML5 the lights don't seem to work, the shadowmap is present but lights don't appear. Since there is no error i have no idea how to fix this. (using runtime 2.2.1.291)

Thanks in advance

Backwards blending

Backwards blending on the directional lights sometimes leaves what appears to be less bright versions of the main light. This undesirable effect is most noticeable on low resolution games with moving and rotating lights.

The bottom picture shows the temporary fix of setting the BLEND_TEXELS distance to 8.0 instead of 64.0. However this has diminishing effects on the blending quality.

lights2
lights4

Can't create a surface with either a width or height of 0

FATAL ERROR in
action number 1
of Draw Event
for object obj_light_renderer:

Can't create a surface with either a width or height of 0
at gml_Script_shadow_map_ensure_exists (line 24) - shadowMap = surface_create(vw, vh);
############################################################################################

stack frame is
gml_Script_shadow_map_ensure_exists (line 24)
called from - gml_Script_composite_shadow_map (line 24) - var has_shadow_map = shadow_map_ensure_exists(eShadowMap.Global);
called from - gml_Object_obj_light_renderer_Draw_0 (line 8) - exists = composite_shadow_map(global.worldLights);

Support for HTML5

Would be cool to see this working in HTML5 (assuming its not already). I have tried with no luck, however it works fine in Windows.

How to change light color

I've tried changing the Light_color variable before (doesn't light at all) and after (doesn't change color) the event_inherit() function, but I can't figure it out.

performance issues

Im using this but the game is lagging, if there is too much lights I'm modyfying the global_lightning function but its not enought, I guess the shader is very recursfull

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.