Shader engine

Hey, i’ve never really been satisfied with GLSL, so i’ve decided to set out to make my own shaders and incorporate them into the BGE.
Now i know this will be a tedious task and will take a very long time, and no matter what language i use i will need to learn openGL, but what language would probably be the best way to make shaders?
(would it be possible to use PYTHON since i know it better than any other language?)

I have never code GLSL, but to my understanding GLSL stands for openGL shading language. So I’m guessing when you code a shader you code it in GLSL. I have had a look at some example shaders and it seems you can incorporate GLSL in python.

Like I said before, I’ve never coded a shader before so I may be way off here.

All the shaders I’ve ever used in the BGE have been written in python. Theres a few custom ones out there, all in python. Id start by downloading a bunch and checking out how they work.
Perhaps ask Martinish how to go about learning it? Hes very recently learnt how to make shaders and is amazingly good at it. Have you seen his shaders? I think he uses python.

If he could post here about some tips to start writing shaders that would be great, I’m looking to try it out sometime as well.

edit Hmmm, i may have misinterpreted what your saying, are you talking about 2D shaders in the BGE or something completely different? More details?

yup… all the shaders are written in GLSL… not python, the GLSL code is run/called by python… so the code snippets for the vertex shaders and fragment shaders are called by python… as in, they are all in one text file… so it’s a mix of python and GLSL. You can only code shaders in GLSL in the blender game engine… unless someone writes in support for other shading languages… but other languages are even lower level and more complex to figure out than GLSL.

So you need to learn the GLSL syntax… but coding a shader from scratch can be annoying… because you have to code in the fragment/pixel shader to use your textures, and to use pixel shading and to manually control the blending of textures and to use your normal map as a normal map and to use highlights, etc, etc, etc. Think of it like the blender material editor except you have to code all the effects from scratch.

Blender basically does all of that for you and compiles the shader and shows it in the viewport and in the game engine… which is why someone was asking a while back… but most people misunderstood what he was asking for… but he wanted to get the shaders out of blender in say, a text file… which would be an awesome way to learn GLSL… being able to output the shaders… you could then use them in other game engines as well.

If you want to get into it… there are free shader developer apps (gah, can’t remember the name of the one) where you can write your GLSL and test it out… and then later bring it into blender. It’s a bit easier this way because it has proper code syntax highlighting for GLSL… while the blender text editor can only highlight python code.

You also run into problems with different GLSL functions that work only on a Nvidia card and not on an ATI card etc. Go for it tho even tho it’s kinda technical!

All the shaders I’ve ever used in the BGE have been written in python.

Unfortunely not… as say kirado “All shaders are written in GLSL”. GLSL is a languange based in C with own sintax and struct. Not only a feature. To learn GLSL see:

lipsonfire: Why are you never satisfied with GLSL? are you using material editor? try Node editor for more complex effects.

The name of the free app I was talking about is called Shader Designer, you can get it from the link.

Ati also has a free app… but not sure if it uses GLSL… might be HLSL

@AD-Edge, i was talking about something completely different, i was talking about making an alternative to glsl and then incorporating it into blender, but i should probably start out with 2d filters.
@kirado, thank you very much :slight_smile: that program seems to have a very nice documentation.
@vitorbalbio, i was informed texture nodes did not work in the BGE. was i informed incorrectly?

As long as you’re in GLSL mode, material nodes work in the BGE (I don’t think texture nodes do though, at least they didn’t when I tried them)

i was informed texture nodes did not work in the BGE. was i informed incorrectly?

Material nodes work, but texture node no… Texture Nodes make procedurals textures, and this have not compatibily with BGE yet… ( I don´t think that will be soo )

Ahhh I see, I’m no expert on all this GLSL stuff (as youve probubly noticed now ;)) but what is lacking/missing with the BGE GLSL thats making you feel unsatisfied?

Wouldnt it be a better idea to just add to or optimize or improve what we already have rather than starting over completely?