Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Shaders and Light in a 2D Environment

Author
Message
Gil8ert
7
Years of Service
User Offline
Joined: 10th Jul 2016
Location:
Posted: 22nd Jul 2016 16:35
Hi Chaps!

I am a little confused about shaders - it is my first time ever looking at them. I have managed to grab some snippets of code off the web and apply them successfully to my app, but they were very basic setups. I needed two setup files - a Vector Shader (.vs) file, and a Pixel Shader(.ps) file.

Question 1: Simply put: What is the function of these files? What is their individual purpose?
Question 2: I know these are written in GLSL, are there any good tutorials you know of to get me started?
Question 3: So far, a lot of the shaders I'v seen react to objects on the screen. Do you have to generate Shaders on the fly from your AppGameKit code to incorporate objects into your calculations?
Question 4: If question3 = Yes then how do you pass object references from AppGameKit to GLSL. If question 4 = No, then how does a shader accomodate objects into it's calculations?
Question 5: https://www.youtube.com/watch?v=iwQ_M1g01-8 - any ideas how this was achieved?
Question 6: https://www.youtube.com/watch?v=zz1YiznuCFk - In the comments, it says this code is posted on the forum. Has anyone seen it?!
Question 7: Are there and good editors out there to help with coding shaders?

Any help you could offer me would be great, it seems the subject of shaders is shrouded in mystery!?
I'm very confused over the 3D shaders being so easy to access, but 2D shaders aren't? Surely 1 less dimension is a massive bonus for your GPU??

Peace!
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 22nd Jul 2016 20:33
I suggest looking through this sticky thread. I've never dealt with shaders so I won't even pretend to know the answers to your questions. But this thread has a ton of info and examples.

https://forum.thegamecreators.com/thread/214598


Question 5 can be answered by this: https://forum.thegamecreators.com/thread/212525

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
Gil8ert
7
Years of Service
User Offline
Joined: 10th Jul 2016
Location:
Posted: 23rd Jul 2016 12:58
Hey thanks! That is very useful!
lilpissywilly
AGK Developer
13
Years of Service
User Offline
Joined: 10th Sep 2010
Location: Office Chair
Posted: 26th Jul 2016 15:14 Edited at: 26th Jul 2016 15:29
Question 6: Yay, that's my old shader It would need to be redone for newer versions of AppGameKit but I'm gonna get right on that


https://forum.thegamecreators.com/thread/211491#msg2525524
My hovercraft is full of eels

Login to post a reply

Server time is: 2024-04-25 17:35:58
Your offset time is: 2024-04-25 17:35:58