Multitexture Shader

Previous topic - Next topic

Kitty Hello

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


I <3 DGArray's :D

AMD Ryzen 7 3800X 16@4.5GHz, 16GB Corsair Vengeance LPX DDR4-3200 RAM, ASUS Dual GeForce RTX™ 3060 OC Edition 12GB GDDR6, Windows 11 Pro 64Bit, MSi Tomahawk B350 Mainboard


AMD X2 4600, 2 GB Ram, ATI X1950 XTX, XP PRO SP2: GLB Premium 10.beta_dingsi, <(´.´<) Kirby Dance (>`.`)>
alea iacta est


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.

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

Kitty Hello

oh no!!! I didn't do anything (intentionally).
Hm. My shaders work.


gernot, recompile this project, and try changes.
The original exe works fine, but when it is compiled....blah
Volume_of_Earth(km^3) = 4/3*3.14*POW(6371.392896,3)

Kitty Hello

??? 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
Volume_of_Earth(km^3) = 4/3*3.14*POW(6371.392896,3)


Ahhh, my stupidity has let me stumble on a bug...

IF X_LOADSHADER(12, "", "MT.frag") = FALSE

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.
Volume_of_Earth(km^3) = 4/3*3.14*POW(6371.392896,3)


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:
Code (glbasic) Select
X_OBJADDVERTEX x,y,z,  thetaFracTex*TextureWrapVert, wrapFracTex*TextureWrapHoriz, col

Here is the fix:
Code (glbasic) Select
X_OBJADDVERTEX x,y,z,  thetaFracTex*TextureWrapVert, -wrapFracTex*TextureWrapHoriz, col
Volume_of_Earth(km^3) = 4/3*3.14*POW(6371.392896,3)