Hi!
I’ve been working on a game project with Cocos2d-x 3.0. From time to time as I’m searching for documentation I can’t find any clear examples of how thing x works. So for now I decided to write simple samples/tutorials for such topics. The first one will be creating light shader for a dark scene.
Instead of going through the code line by line here, I will publish all the examples to Github with comments. Example of light shader can be found here:
https://github.com/joni-mikkola/cocos2d-x-tutorials
Hey! Thanks for the Code, but I think it is much more helpful to have a full tutorial on that. I wanted to create a spotlight in my game, which always is centred on the player. I can’t get it to work. For once the position is off and the shader doesn’t darken the screen – it makes it yellow. I think I don’t fully understand the code. It would be really could if you consider creating a full tutorial.
phrk
Hi! thanks for the feedback. At first I thought about writing a full tutorial on this, but then I was lazy and just tried to comment the code enough. I will consider writing more lengthy tutorial in future.
Hard to say what’s wrong with your code from the description. If you could share it somehow I could take a look.
Hey!
I spoke too soon! Got it working. Thank you so much for the code!
That’s nice to hear 🙂 Have fun!
Thank’s a lot!
Thanks a lot. i just begin to learn cocos2d….
it works Perfect!!!!!!!
thank you so much.
This was my 8th project i created just for spotlight
My pleasure to help you!
test2
asdsda