WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Shaders... (https://forum.worldviz.com/showthread.php?t=1003)

djdesmangles 02-18-2007 02:07 PM

Shaders...
 
Hello Wizards, I'm back !!:cool:

I got two GLSL codes:
1) one vertex program
2) one fragment program

I would like to use these shaders in my application but I don't understand how to pass parameters like textures or values to them...

shader = viz.addShader(viz.SHADER_TANGENT, vert="v1.vp", frag="f1.fp"):
How can I pass params ? :confused:

Thanks a lot!!
Didier

farshizzo 02-20-2007 09:27 AM

Vizard comes with 2 sample scripts showing how to use GLSL. The scripts are tutorial_alphaMap.py and tutorial_multiTexture.py and are located in the [Vizard30]/examples/shader directory.

For example, if you wanted to create a floating point parameter, you would do the following:
Code:

MyParam = viz.addUniformFloat( 'paramName', 0.5 )
node.apply(MyParam)



All times are GMT -7. The time now is 08:37 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC