When using X_SETTEXTURE a,b _after_ X_SETSHADER, the 2 "uniform smapler2D" vaiables "TextureID1" and "TextureID2" will be set.
Here's an example how to do multitexturing. Move the mouse left-right for the mixing factor.
You need a new update to GLBasic (online tomorrow)
[attachment deleted by admin]
Nice, this will come in handy =D
cool... :nw:
Great! :booze:
Old post, yes.
However, GLSL hasnt changed on my computer, yet this code no longer works the way it was originally working.
Did you change something with the shaders internally since this post, gernot?
I did notice a change a while back....all my shaders seem to be broken now.
oh no!!! I didn't do anything (intentionally).
Hm. My shaders work.
gernot, recompile this project, and try again....it changes.
The original exe works fine, but when it is compiled....blah
??? Are you sure? I mean - when you reboot. Does the new exe still not run?
Ahh...i had to move MT.frag into the .app folder, duuh. :S
Ahhh, my stupidity has let me stumble on a bug...
IF X_LOADSHADER(12, "", "MT.frag") = FALSE
END
ENDIF
This didnt end the program as intended, it allowed me to continue to run, even though the shader wasnt loaded...i didnt have it in the app dir, and yet it still was running, without the shader.
And a minor bug in the sample...
The torus is texturing the Y dimension upside down, making the words upside down.
This is the original code:
X_OBJADDVERTEX x,y,z, thetaFracTex*TextureWrapVert, wrapFracTex*TextureWrapHoriz, col
Here is the fix:
X_OBJADDVERTEX x,y,z, thetaFracTex*TextureWrapVert, -wrapFracTex*TextureWrapHoriz, col