September 23, 2019, 03:13:19 PM

Author Topic: shaders and textures  (Read 148 times)

Offline Pfaber11

  • Sr. Member
  • ****
  • Posts: 280
    • FABERS GAMES
shaders and textures
« on: September 04, 2019, 08:20:40 PM »
Hi today I had the idea of loading a texture onto a height map and it worked . Is this what you would call a shader or a primitive shader. Anyway my maze game is way better it's now got brickwork on the paths and is definitely an improvement . To do the necessary work and loading them up onto itch.io took me about 5 hours as I had the pc version and Android to do and test them out . Anyway I've probably gone about shaders the wrong way but I'm learning . Any advice on this subject would be welcome . Thanks for reading .   

Offline Xaron

  • Sr. Member
  • ****
  • Posts: 260
Re: shaders and textures
« Reply #1 on: September 06, 2019, 08:44:21 PM »
How I understood this is you did put a texture onto a mesh (height map)?

That was possible with fixed function pipeline gfx cards ages ago as well.

A shader is basically a little (or large) piece of code which runs on the graphics card. Basically you have two different ones in the pipeline.
First comes the vertex shader which works on geometry data. You can do fancy stuff like mesh deformation here or changing vertex colors..
After that the fragment shader (previously called pixel shader) kicks in. He basically gets the output from the vertex shader as input but this time in pixel (fragment) coordinates. So here you can change the outcome of a single pixel but have to access to any geometry anymore.

Offline Pfaber11

  • Sr. Member
  • ****
  • Posts: 280
    • FABERS GAMES
Re: shaders and textures
« Reply #2 on: September 06, 2019, 08:53:15 PM »
Hmm I see some study is required. What I think I'm gonna do is purchase the shader pack from TGC and see how it all works .
Shaders may be beyond me but I won't know until I give it a go .

Offline Xaron

  • Sr. Member
  • ****
  • Posts: 260
Re: shaders and textures
« Reply #3 on: September 06, 2019, 08:54:23 PM »
If you're familiar with the language C it's pretty similar to it.

Offline GaborD

  • Sr. Member
  • ****
  • Posts: 296
Re: shaders and textures
« Reply #4 on: September 06, 2019, 09:43:41 PM »
They have a really good explanation of how to write shaders for AGK here:

https://www.appgamekit.com/documentation/guides/13_shaders.htm

You'll find all the standard shaders AGK uses there too. (stock rendering is shader based in AGK)
The stock shaders are very simple and a good starting point for learning.

Offline Pfaber11

  • Sr. Member
  • ****
  • Posts: 280
    • FABERS GAMES
Re: shaders and textures
« Reply #5 on: September 07, 2019, 09:01:34 AM »
Thanks for that info will go and take a look.