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]

Sebastian

Nice, this will come in handy  =D

Schranz0r

I <3 DGArray's :D

PC:
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

WPShadow

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

Hemlos

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.

Bing ChatGpt is pretty smart :O

Kitty Hello

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

Hemlos

gernot, recompile this project, and try again....it changes.
The original exe works fine, but when it is compiled....blah
Bing ChatGpt is pretty smart :O

Kitty Hello

??? Are you sure? I mean - when you reboot. Does the new exe still not run?

Hemlos

Ahh...i had to move MT.frag into the .app folder, duuh.  :S
Bing ChatGpt is pretty smart :O

Hemlos

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.
Bing ChatGpt is pretty smart :O

Hemlos

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
Bing ChatGpt is pretty smart :O