Why Won't This GLSL .blend Game Work?


uniform float brightness; // = 1.0; This is not correctly initialize
uniform float brightness = 1.0; // initialize to default value

I’m using 2.78a and uniform value are not initialize at declaration it can only be done by assigning a default value inside the shader, provides a safety fall back in case the user fail to provide them

https://www.khronos.org/opengl/wiki/Uniform_(GLSL)

See that line that says: Platform Issue (Unknown): Some drivers do not implement uniform initializers correctly.

This happens to me when using linux, the shaders don’t work at all. Since this filter was designed to work with my addon, and the addon already forces you (the shader developer) to make a python wrapper that initializes the uniforms, there was no need to explicitly initialize them in the shader.

This is the wrapper by the way:


from filter2D import Filter2D

class  ToonLine(Filter2D):
    brightness = 1.0
    border_color = [0.0, 0.0, 0.0, 0.0]
    mode = 1
    threshold = 0.3

Simple, isn’t it?

I see, thanks for pointing that out

Thanks everybody for the support!

But I decided I should focus on
actually learning python code,
and then getting the game to work,
before focusing on toon-lines.

so one final question:

codeacademy.com is teaching me basics I kinda already know e.g. 2**3 = 2^3 = 8.
What topics focus on making a bird's-eye-view game
 that makes a character turn west when pressing left-key 
 and turns them east when pressing right-key 
 and etc.?

And also feel free to post on my other thread!

(P.S. thanks to whoever recommended codeacademy!)

Hi again,

I haven’t learned Python yet.
But I did learn how to use BsDev’s toon line shader.
And realized I can just use Multitexture
(GLSL just isn’t working on my cheap old Windows laptop).

Thing is, the toon shader lags,
(on my cheap old Windows laptop)
especially when the game has a bigger screen.

So I might just go with multitexture
without the toon lines.

Thanks for your considerations and responses, people!

Are you not at least running windows XP?

I’m running Windows 7.

Though, anti-aliasing in BGE simulations doesn’t work on my laptop,
while it works on my family’s computers.

That, and a game I bought (Hyper Light Drifter), won’t even start up on this laptop.

Conclusion: my ol’ laptop’s graphics is outdated.

(Then again, GLSL didn’t work on the other two computers. Maybe they’re a bit outdated, too.)