Löve "Light vs. Shadow" Engine [0.4.3]
- Ranguna259
- Party member
- Posts: 911
- Joined: Tue Jun 18, 2013 10:58 pm
- Location: I'm right next to you
Re: Löve "Light vs. Shadow" Engine [Project Page]
Maybe AMD is a no go, PriorBlue is there any way you can modifie the code so that it won't load this specific shader or part of the shader, maybe with a flag or something alike ?
- slime
- Solid Snayke
- Posts: 3166
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: Löve "Light vs. Shadow" Engine [Project Page]
'smooth' is a keyword in later GLSL versions. It sounds like the AMD compiler has a bug where it can't handle a variable named 'smooth' even in GLSL versions where it's not a keyword (and it's not a reserved keyword either.)
An easy fix would be to rename the variable.
An easy fix would be to rename the variable.
Re: Löve "Light vs. Shadow" Engine [Project Page]
this works, thanks slime.slime wrote:'smooth' is a keyword in later GLSL versions. It sounds like the AMD compiler has a bug where it can't handle a variable named 'smooth' even in GLSL versions where it's not a keyword (and it's not a reserved keyword either.)
An easy fix would be to rename the variable.
Re: Löve "Light vs. Shadow" Engine [0.2.0]
Ok, at first a few answers:
Yes, directional light will be included, soon.
So, here are the new things, i worked on:
My first normal shader calculation wasn't that good, so i watched a few other examples and rewrote him (I hope you can see the differences ).
I have finally integrated some options to generate normal maps. So you don't need to pixel them (this options will be extended in the future). It's for now possible to generate flat/gradient normal maps, convert height maps to normal maps and use(convert) the image itself as normal map (usually gives poor results).
Normal map gradient generation:
Height map to normal map generation:
Here some code examples:
Shadow color and alpha (glass):
Code example:
More informations can be found on the Wiki.
Yes, its on my TODO list.Ranguna259 wrote:...could you add rotation...
The light engine is completely separated from the physics and "drawing stuff" part, so you just have to synchronize the shadow bodys and lights with your game. When you update the light engine, all light/shadow information's will be generated in different canvases, which you can draw over or under your scene.WetDesertRock wrote:Is it possible to have a segment be a game object? ... Also, are you going to do directional light sometime?
Yes, directional light will be included, soon.
Yes, smooth is a keyword for ATI shaders. I have changed it to "lightSmooth".Error
Cannot compile pixel shader code:
Line 2: error: Syntax error: "smooth" parse error
So, here are the new things, i worked on:
My first normal shader calculation wasn't that good, so i watched a few other examples and rewrote him (I hope you can see the differences ).
I have finally integrated some options to generate normal maps. So you don't need to pixel them (this options will be extended in the future). It's for now possible to generate flat/gradient normal maps, convert height maps to normal maps and use(convert) the image itself as normal map (usually gives poor results).
Normal map gradient generation:
Height map to normal map generation:
Here some code examples:
Code: Select all
-- generate a simple normal map, which can be only lighted from the front
lightWorldImage.generateNormalMapFlat("front")
-- generate a cone like normal map
lightWorldImage.generateNormalMapGradient("gradient", "none")
-- generate a circle like normal map
lightWorldImage.generateNormalMapGradient("gradient", "gradient")
-- Set the height map of the object. The normal map will be automatically generated with the given strength.
lightWorldImage.setHeightMap(imgHeight, 2.0)
-- The normal map will be automatically generated from the image.
lightWorldImage.generateNormalMap(2.0)
Code example:
Code: Select all
-- set the object half transparent
shadowObject.setAlpha(0.5)
-- give the shadow body a color
shadowObject.setColor(255, 0, 0)
Re: Löve "Light vs. Shadow" Engine [0.2.1]
This is just so goood. Thank you so much for making this
PM me on here or elsewhere if you'd like to discuss porting your game to Nintendo Switch via mazette!
personal page and a raycaster
personal page and a raycaster
-
- Citizen
- Posts: 67
- Joined: Fri Mar 07, 2014 8:16 pm
Re: Löve "Light vs. Shadow" Engine [0.2.1]
What I found is that the shapes don't go into total darkness when cast into shadow. If you move the mouse away, things will get darker, but not when they are in shadow.
https://love2d.org/imgmirrur/yXBlRk5.png
https://love2d.org/imgmirrur/yXBlRk5.png
Re: Löve "Light vs. Shadow" Engine [0.2.1]
In order to make the "shadows" darker, you need to lower your values in the "yourVariableName.setAmbientColor(90,90,90)". If you want the shadow to make your boxes darker, you need to draw the boxes FIRST and then draw the shadow.WetDesertRock wrote:What I found is that the shapes don't go into total darkness when cast into shadow. If you move the mouse away, things will get darker, but not when they are in shadow.
https://love2d.org/imgmirrur/yXBlRk5.png
Re: Löve "Light vs. Shadow" Engine [0.2.1]
I know, the shadows are working with a stencil system at the moment, so i can't separate which object is over or under the shadow of another object. I hope i can change this in the future.WetDesertRock wrote:What I found is that the shapes don't go into total darkness when cast into shadow. If you move the mouse away, things will get darker, but not when they are in shadow.
So and i polished the glow system, its now a little bit sharper:
And i added a glow functionality to standard circle/poly objects (Press "8" and "9" in the demo):
Here the code for the glow effects:
Code: Select all
-- set the global blur of the glow effect (default: 1)
lightWorld.setGlowStrength(4)
-- add glow to the shadow body
shadowBody.setGlowStrength(1.0)
-- set glow color of the shadow body
shadowBody.setGlowColor(255, 0, 0)
Last edited by PriorBlue on Sun Mar 16, 2014 1:22 am, edited 2 times in total.
Re: Löve "Light vs. Shadow" Engine [0.2.2]
It's fantastic! Really wery awesome! Please, give me some advice about better way, to learn shaders?)
My library for easy saving Slib! Try this! Now you can encrypt your save!
- Drop of light LD#30
- OUTRANGE LD#31
(Sorry for my english. I learn it myself, and I don't have enough experience)
- Drop of light LD#30
- OUTRANGE LD#31
(Sorry for my english. I learn it myself, and I don't have enough experience)
Who is online
Users browsing this forum: Bing [Bot] and 4 guests