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 / Any info on writing agk shaders?

Author
Message
29 games
18
Years of Service
User Offline
Joined: 23rd Nov 2005
Location: not entirely sure
Posted: 16th Jan 2014 21:55
Quote: "I realized that by default Blender didn't export Normals. So I ticked the box when exporting and all is good"


I learned the exact same thing today, it was driving me insane.

CodeMonkey
11
Years of Service
User Offline
Joined: 6th Mar 2013
Location: Ireland
Posted: 22nd Jan 2014 12:59 Edited at: 22nd Jan 2014 17:52
Has anyone successfully used uniform arrays in a shader? I can't seem to get them working. If I set the value in the shader itself it works fine, but I can't seem to set it in AGK.

Pixel Shader


SetShaderConstantByName(Shader, "PColor[0]", 0, 1, 0, 0)

I'm also wondering how I should handle multiple cameras with shaders. I'm using a uniform CameraPosition variable that I pass to through AppGameKit, but I'm not sure how I would set up the draw code so that it sets the position for the first camera, draws that, then does the same for the second. Is there any way to get the camera position in the shader without explicitly sending it through code?
The Zoq2
14
Years of Service
User Offline
Joined: 4th Nov 2009
Location: Linköping, Sweden
Posted: 23rd Jan 2014 16:59
I think paul mentioned that passing arrays to shaders is impossible for now. It's a feature that would be really usefull for making light systems though...

Say ONE stupid thing and it ends up as a forum signature forever. - Neuro Fuzzy
CodeMonkey
11
Years of Service
User Offline
Joined: 6th Mar 2013
Location: Ireland
Posted: 25th Jan 2014 20:11
Thanks for the info, hopefully it'll be implemented in version 2.

Do you know if there's any way of getting the camera position in the shader without passing it through from AppGameKit?

I'd also like to create a shader with shadow mapping, but I'm assuming this isn't possible without the use of the RenderToImage command exclusive to V2?

Login to post a reply

Server time is: 2024-05-08 23:02:45
Your offset time is: 2024-05-08 23:02:45