GLSL - The OpenGL Shader Language: for 2d and 3d SFX

Previous topic - Next topic


Quote from: Kitty Hello on 2009-Oct-12
They must render the model twice with different shaders then. There's no GLSL extension function hidden that you can't use with GLBasic.

Rendered to backbuffer, then more shaders are reapplied, thats how shaders work.

The first pass.....has 3 shaders
The second has 6 shaders.
Volume_of_Earth(km^3) = 4/3*3.14*POW(6371.392896,3)

Kitty Hello

OK, then you must do that manually. But you can.


Do Like this?

Volume_of_Earth(km^3) = 4/3*3.14*POW(6371.392896,3)

Kitty Hello

no. That will exchange the shaders. You only can set one shader per rendering.

(maybe) I have no idea what RenderMonkey really does.


Ahh, ya that wont work correctly, youll get the surfaces z-fighting.

I have been reading the opengl glsl specifications.

The language links multiple programs (verts and frags).

Get the rendermonkey from, its awesome!
Youll certainly be amazed at what opengl is capable of now.
Try the fur project, and the ooze project.....tons of eye candy.
Volume_of_Earth(km^3) = 4/3*3.14*POW(6371.392896,3)

Kitty Hello

I can't find _any_ command that enables multiple. Or is it just linking a bunch of "object" files, that produce one shader then?
You only can have _one_ main() for a shader and only one shader per pixel.


hmmm i checked it out ....

youre right, it is only passing 1 vert and 1 frag.

i was confused by the way the program works, sorry for troubling you.
Volume_of_Earth(km^3) = 4/3*3.14*POW(6371.392896,3)


Here is my current project, as i wait patiently for point sprites :whistle:

First off, I have successfully created a 2d animated background using a shader.
Therefore i am moving on to animation in 3d.

The effect im attempting to achieve is going to have a "flowing fur" effect.

Here is a screenshot showing this in action:

[attachment deleted by admin]
Volume_of_Earth(km^3) = 4/3*3.14*POW(6371.392896,3)


Im trying to load a  "3d texture", it is named
This format .dds is not glbasic, and it isnt .3dstudio.
I have no clue, i cant find this extension on the search engines.

a 3d texture:
8bit L8
and from what i understand,
it is 128x128x128 dimensions, and it has 8 mip map layers.

This file is needs to be loaded using uniform sampler3D filename

The shader needs to read this file in the frag program.
I dont need to render it to the screen, i dont even think it is a regular 3d object, it seems to be "special"

How do i load the sampler3d? x_putshader "sampler3D", filename$   ? ?

Do you think this why the shader fails? Am i not loading it correctly?
Volume_of_Earth(km^3) = 4/3*3.14*POW(6371.392896,3)

Kitty Hello

I have no idea about 3D textures. Really.


LOL  :'(

x_putshader "sampler3D", filename$   ? ?

Integer ID ? String$ ID ?

What is the input type?

I need to know what to pass through to load it.
Volume_of_Earth(km^3) = 4/3*3.14*POW(6371.392896,3)

Kitty Hello

I only support "uniform float".
You can't load a shader file within a shader, can you?


No it must be a numeric value, i assume an integer, but somehow GLBasic needs to tell the shader what to load.
Its like loading a texture with sampler2d i think.
TextureID1 and TextureID2 i assume are integers, and they are pointing to some file.
I think we need Texture3d1 or something..

These all get loaded the same way i think:


I think we need a naming convention of constants and pointers to files loaded with opengl here:


Quote4.1.7 Samplers
Sampler types (e.g. sampler2D) are effectively opaque handles to textures. They are used with the builtin
texture functions (described in Section 8.7 “Texture Lookup Functions” ) to specify which texture to
access. They can only be declared as function parameters or uniform variables (see Section 4.3.5
“Uniform” ). Except for array indexing, structure field selection, and parentheses, samplers are not
allowed to be operands in expressions. Samplers cannot be treated as l-values; hence cannot be used as
out or inout function parameters, nor can they be assigned into. As uniforms, they are initialized only
with the OpenGL API; they cannot be declared with an initializer in a shader. As function parameters,
only samplers may be passed to samplers of matching type. This enables consistency checking between
shader texture accesses and OpenGL texture state before a shader is run.
Volume_of_Earth(km^3) = 4/3*3.14*POW(6371.392896,3)


Sorry it took so long guys...but i finally got the bright shader working proper.
It is the download in the first message of this thread.
Volume_of_Earth(km^3) = 4/3*3.14*POW(6371.392896,3)