Scroll Texture on 3D Model?

Ask about editing graphics, sounds, models, music, etc here!
Shaders (GLSL) and SNDINFO questions also go here!

Moderators: GZDoom Developers, Raze Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Moebius
Posts: 56
Joined: Thu Jan 28, 2021 1:45 am

Scroll Texture on 3D Model?

Post by Moebius »

Possible?
User avatar
Cherno
Posts: 1318
Joined: Tue Dec 06, 2016 11:25 am

Re: Scroll Texture on 3D Model?

Post by Cherno »

Yes, by assigning a shader to the texture which changes the uv values via timer.
Moebius
Posts: 56
Joined: Thu Jan 28, 2021 1:45 am

Re: Scroll Texture on 3D Model?

Post by Moebius »

I'm 5'-10". Every bit of that went over my head.
User avatar
ramon.dexter
Posts: 1556
Joined: Tue Oct 20, 2015 12:50 pm
Graphics Processor: nVidia with Vulkan support
Location: Kozolupy, Bohemia

Re: Scroll Texture on 3D Model?

Post 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.
Moebius
Posts: 56
Joined: Thu Jan 28, 2021 1:45 am

Re: Scroll Texture on 3D Model?

Post 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"

Return to “Assets (and other stuff)”