GLSL blender questions? more than 1 uniform float?

Hi this is an GLSL blender question…

Well I would like to know if I can set more than one uniform floats/ints that are controlled from inside of blender…which aren’t specifically timers…? Here are 2 code snippets

the first one from the beginning of the vertex shader:

VertexShader = """
<b> uniform float time;</b>
<b> uniform float scale;</b>

the part of the blender script that should hook the two togethor…

shader = mat.getShader()
                if shader != None:
                    if not shader.isValid():
                        shader.setSource(VertexShader, FragmentShader,1)
                    <b>shader.setUniform1f('time', obj.time)</b>
                    <b>shader.setUniform1f('scale', obj.scale)</b>
                    shader.setSampler('color', 0)
                    print time() 

okay the (‘time’, obj.time) gets the timer property from the object the script is attached to… so I’m assuming that shader.setUniform1f(‘scale’, obj.scale) should get the property called “scale”… which is also attached to the object… note the timer one works.

when I do this, I get a syntax error? Which makes no sense to me… I can’t see any problems with the syntax… maybe I’m missing something…? Can anyone help with this please…:eyebrowlift2: Can you only use time properties with the GE and GLSL?

SyntaxError: invalid syntax
    File "GLSL_Swave_Plight",148

I want to be able to pass information from blender to the GLSL shader to control it… say you press a key and the shader changes…?:evilgrin: This would be so cool if I could get it working…

Hello Kirado,
the example in :
should help you

Hi keleido thanks for the link… apparantly I was mixing tabs with spaces… it hard to see this in blender script window…so I should have the problem solved shortly!

Hello Kirado,
did you sort your syntax error?
if not please provide a .blend with your shader code to have a look.

yeah I did… I’ll post a blender later today for people to play with… I’ve got to install pywin and use that… instead of the blender text editor… Now I’m wondering if it possible to get info out of the shader and into blender… I’m trying to figure out how to make an object bob in the waves…