Welcome Guest [Log In] [Register]
We hope you enjoy your visit.


You're currently viewing the Ultimate 3D Community as a guest. This means that you can only read posts, but can not create posts or topics by yourself. To be able to post you need to register. Then you can participate in the community active and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.

Join our community!

If you are already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
Scrolling texture shader; Bugs up the texture
Topic Started: Apr 10 2009, 01:55 PM (279 Views)
hepolite
Advanced Member
[ *  *  * ]

I wanted a waterfall in my game, so I looked up the scrolling texture shader. I copied the two files I downloaded from the shader list and assigned a material to this shader. It did work and I got my scrolling texture. But I noticed that something wasn't quite right: The shader bugged up the texture and some nasty lines appeared all over the texture.
Posted Image
(The one-colored areas aren't UV-mapped yet)

I don't know what I've done wrong. I have pixel shader model 1.4 and I loaded the shader through LoadMaterialEffect.

Can it be just my computer (Vista) or does it happen to many other?
Offline Profile Quote Post Goto Top
 
skarik
Member Avatar
kitten eating scum
[ *  *  *  *  *  * ]
Need to see your UV's and the Effect files if you have made any changes.
Blog|EHS
Offline Profile Quote Post Goto Top
 
hepolite
Advanced Member
[ *  *  * ]
I don't think I'll be able to find the UV's, but I can add the model, if that's any help. It's an Anim8or file.

UFX:
Code:
 
Ultimate3DEffectFile 1.1

VertexShaderFile effect/WaterFall.vsh

VSConstant 0 VS_CONST_WORLD_VIEW_PROJ_TRANS_1
VSConstant 1 VS_CONST_WORLD_VIEW_PROJ_TRANS_2
VSConstant 2 VS_CONST_WORLD_VIEW_PROJ_TRANS_3
VSConstant 3 VS_CONST_WORLD_VIEW_PROJ_TRANS_4

VSConstant 4 VS_CONST_MAT_DIFFUSE

VSConstant 5 VS_CONST_CURRENT_TIME

// This constant defines the texture scrolling speed and the direction
VSConstant 6 VS_CONST_MANUAL_SETTABLE 1 -1 0 0


VSH:
Code:
 
vs.1.1

//Yeah, that one function everybody still on GmD3d is scrambling for
m4x4 oPos, v0, c0

//We know
mov oD0, c4

//Yada yada
mov r0, c4

//Put our time-base offset into r1
mov r1, c5
//And multiply it by our defined maxes
mul r1, r1, c6

//And we mad it into our tex coord
mad oT0, r1, r0.x, v7
Attached to this post:
Attachments: terrain.zip (89.15 KB)
Offline Profile Quote Post Goto Top
 
skarik
Member Avatar
kitten eating scum
[ *  *  *  *  *  * ]
Well, it has to be your model, but on the shader, you may want to change it to this:
Code:
 
vs.1.1

//Yeah, that one function everybody still on GmD3d is scrambling for
m4x4 oPos, v0, c0

//We know
mov oD0, c4

//Put our time-base offset into r1
mov r1, c5
//And multiply it by our defined maxes
mul r1, r1, c6

//And we add it into our tex coord
add oT0, r1, v7
Blog|EHS
Offline Profile Quote Post Goto Top
 
hepolite
Advanced Member
[ *  *  * ]
I checked the model, there's nothing wrong with the UV-mapping. I tried the code, but it didn't look like it did much. The texture is scrolling, but the UV's are screwed up.

It could be my computer, though...
Offline Profile Quote Post Goto Top
 
skarik
Member Avatar
kitten eating scum
[ *  *  *  *  *  * ]
Maybe. You never know these days.
Blog|EHS
Offline Profile Quote Post Goto Top
 
« Previous Topic · Questions about Ultimate 3D · Next Topic »
Add Reply