The Dynamic Shader plugin can be used in your Corona project to create 3D shading for your 2D artwork. This shading occurs dynamically in real time, updating every frame, allowing for vivid expressions of mood and atmosphere. The best thing about the Dynamic Shader is its ease of use. It only takes 4 steps and a few lines of code to add dynamic lighting to your app!
I was developing the shader effect for one of my apps and could never get it to work 100%. Two things coalesced into the final version. First, Corona announce the plugin competition (great motivation), second I had a trigonometry epiphany around the same time and powered through the previous problems to finally complete the module - yay!
I was eyeing your plugin as well. Is there a mac version in the works? I’m currently a double mac developer and have been PC-less for 4 years now, however, I need to get a PC soon to develop for Windows.
I’ve tagged your plugin for purchase once I get time to work on an actual game in corona. It looks great and i don’t envy you the higher mathematics. I can barely manage math.atan() at the moment so need to brush up on those skills at some point.
At the moment Radiance does take all my spare time, and in fact I just released v1.2 this evening.
Never thought about mac but starting to get the impression that there are more mac developers than PC using Corona SDK so I will look into it. Since Radiance is coded 100% in Corona SDK I would presume all should be easy to make mac builds.
I will look into it, and see if I can find a mac somewhere.
Not yet, I have a working prototype of a multi-light shader but I decided to focus on one light for now. Currently I’m experimenting with light beams and flickering light.
I don’t have plans to make major updates to the Dynamic Shader in the near future. That could change if I end up with a large active user base but since the plugin is only one week old today, time will tell ; )
I purchased your Plugin and spriteilluminator. The demo projects works just fine. But the shader objects in my project are always black. I messed around half a day trying to get it to work in my project. Any ideas what could cause this?
I have limited experience with sprites since I usually use physics objects but in theory sprites should work just fine. In fact, I’ve seen examples of sprite sheets turned into normal maps with Sprite Illuminator on YouTube but I’m unsure, procedurally speaking, of how exactly to implement them into the dynamic shader on Corona. I’ll definitely investigate this and get back to you. Meanwhile, can you send me a sample of the code you are using to call and animate the sprites and how you are adding them to the Dynamic Shader?
Thanks! That is an error in my coding. I would prefer for users to not have to pass a table (easier for novice users) so I will fix that in the next update. The light is set to 1, 1, 1 by default so I never notices this error.
I was just checking my api’s and noticed that it was originally a table value for setLightColor( ) so I’m going to keep it a table value and fix the sample code on the site. Sorry for the confusion and thanks again!
I just tried it out using a SpriteIlluminator example. Works good, see below. I did this on a Macbook Pro, but during plugin install it had the “spinner” animating like it was still busy. I let it sit there a bit and then ‘quit’ Corona simulator and re-started and all is working fine.
I used the suggestion above from burnsj002 and it worked great!
Great! Thanks Paul. I’m also still investigating sprite sheets but the composite effects fill for Corona asks specifically for image files. There might be a way around this. . . I’ll keep you posted.
Short answer: Unfortunately, I don’t plan on supporting image sheets for the Dynamic Shader in the near future.
Long answer: The graphics 2.0 composite.fill.effect parameters require a “type” (like “image”) and a location of the image files. Since image sheets are one big file, I have to break up the sprites and normal maps on those sheets and re-save them as graphics files in the Document Directory before loading them into the shader which defeats the whole purpose of image sheets. I’m experimenting with canvases but it looks like they will also bloat the Document Directory if I have to save then and then create a path.
I’ll keep experimenting but I’m moving this challenge to the back burner.
No problem. I got the Dynamic Shader to work in my project just fine.
I noticed that on 1st Gen Apple products or older devices like the iPhone 5S that the Dynamic Shader dramatically slows down the game. Almost making it unplayable with a moving light source. But I did some experimenting… I made the light source not move .I stop the Shader right after the match 3 board is visible.
The Shader still SHADES the gem pieces even while the Dynamic Shader is stopped!
Some levels I have the light source turn off and on to make the game harder. So I noticed you have to turn the Shader ON when you move the light source then I instantly turn it OFF. This is part of the code:
But the stop has to happen a millisecond later. So now the game works super fast on the 1st gen apple devices and older iPhone 5S devices.
Does this sound right to you Jonathan? Does the Shader still Shade the objects when it is stopped as long as the light source doesn’t move or the radius of the light doesn’t change? Do you only have to turn the shader ON when you move the light or change the light radius?