shaders and textures

Started by Pfaber11, September 04, 2019, 20:20:40

Previous topic - Next topic

Pfaber11

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 .   
HP 15s i3 1.2 upto 3.4 ghz 128 gb ssd 16 gb ram 15.6 inch screen. Windows 11 home edition .  2Tb external hard drive dedicated to Linux Mint .
  PureBasic 6 and AppGameKit studio
ASUS Vivo book 15 16gb ram 256gb storage  cpu upto 4.1 ghz

Xaron

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.

Pfaber11

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 .
HP 15s i3 1.2 upto 3.4 ghz 128 gb ssd 16 gb ram 15.6 inch screen. Windows 11 home edition .  2Tb external hard drive dedicated to Linux Mint .
  PureBasic 6 and AppGameKit studio
ASUS Vivo book 15 16gb ram 256gb storage  cpu upto 4.1 ghz

Xaron

If you're familiar with the language C it's pretty similar to it.

GaborD

#4
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.

Pfaber11

Thanks for that info will go and take a look.
HP 15s i3 1.2 upto 3.4 ghz 128 gb ssd 16 gb ram 15.6 inch screen. Windows 11 home edition .  2Tb external hard drive dedicated to Linux Mint .
  PureBasic 6 and AppGameKit studio
ASUS Vivo book 15 16gb ram 256gb storage  cpu upto 4.1 ghz