Page 1 of 1

Scroll Texture on 3D Model?

Posted: Sun Mar 12, 2023 8:59 pm
by Moebius
Possible?

Re: Scroll Texture on 3D Model?

Posted: Sun Mar 12, 2023 11:43 pm
by Cherno
Yes, by assigning a shader to the texture which changes the uv values via timer.

Re: Scroll Texture on 3D Model?

Posted: Mon Mar 13, 2023 9:48 pm
by Moebius
I'm 5'-10". Every bit of that went over my head.

Re: Scroll Texture on 3D Model?

Posted: Tue Mar 14, 2023 12:14 am
by ramon.dexter
Moebius wrote: Mon Mar 13, 2023 9:48 pm I'm 5'-10". Every bit of that went over my head.
You are on gzdoom forum. Gzdoom has lots of features completely oblivious to other ports. Like programmable shaders. Honestly, writing a shader is hard task.

Re: Scroll Texture on 3D Model?

Posted: Mon Mar 27, 2023 12:34 am
by Moebius
I pieced together a shader from many sources.

SHADER = 3dscroll.fp

Code: Select all

//3D Model UV animation shader
uniform float timer;

vec4 Process(vec4 color)
{	
	vec2 uv = vec2(gl_TexCoord[0].s, gl_TexCoord[0].t + (timer*0.0625));
	
	return getTexel(uv);
}

In GLDEFS I call out the SHADER:

HardwareShader "textures/bactria6.png"
{
	Shader "shaders/3dscroll.fp"
	Speed 1.0
}
It works if the texture is just a single texture file. But I originally had my 3D Model with material texture textures/BACTRIA6.png: (also in GLDEFS) It doesn't work with

Code: Select all

material texture textures/BACTRIA6.png
{
	normal normal/BACTRIA6n.png
	specular specular/BACTRIA6s.png
	specularlevel 1
	glossiness 4
}
Anyone know why it won't work with the diffuse/normal/specular texture but will with just a diffuse text? What needs to change? Single texture comes out darker and no shine. DNS texture has a nice "wet look" to it that I want.

I tried putting quotations on the texture in case the long path name was needed, didn't help.

Code: Select all

material texture "textures/BACTRIA6.png"