Material moving in the wind...

Discussion for Level editing, modeling, programming, or any of the other technical aspects of Quake
Post Reply
dancecrave
Posts: 12
Joined: Thu Jun 21, 2007 10:47 pm

Material moving in the wind...

Post by dancecrave »

Hi all,

I have spent some time experimenting with some of the shader commands I have seen here and other places and nearly have what I want. Not quite though.

I want to be able to model a branch of leaves as one brush that appears to move in the wind, so I make a brush, texture it with leaves with an alpha channel to give holes. Then my material stage modulates it. (so I thought)

Actually what I get is a solid brush with the texture on it and then the tranparency (holes or alpha) is animated! If the whole texture moved it would look right!

This is basically what I have:
textures/alan/amtree

{
qer_EditorImage textures/alan/amtree
materialType trees
bumpmap textures/alan/amtree_l.tga
diffusemap textures/alan/amtree
specularmap textures/alan/amtree_s
nonsolid

noselfshadow
{
blend diffusemap
map textures/alan/amtree.tga
alphaTest 0.5
}
deform turbulent sinTable 0.05 (time * 0.1) 10

}

What am I doing wrong? :cry:

Please help,

this is doing my head in!!

:)

Al
o'dium
Posts: 11712
Joined: Sun Mar 25, 2001 8:00 am

Post by o'dium »

I take it looking from your material this is for Doom 3/Quake 4?

Ok.

First of all, I'm gonna have to disapoint you. Lit surfaces in a per pixel enviroment can not "move", at least not without a special hack. The reason being that once they move, the normals are no longer correct, so it wont be lit correctly.

I seem to remember both Doom 3 and Quake 4 not supporting deforms at all. Its possible they do, but if they do, it will JUST be a single diffuse stage with no specular and no lighting.

I see you want it for some kind of tree? Well, the best I can suggest is that you model your tree, and then animate it to simulate blowing in the wind. I know, a hard task, and it may be to much effort, but thats really the best way to get that effect working in D3/Q4.

Also keep in mind that alphaTesting MUST at all times on alpha surfaces be used as well, otherwise your texture will be full bright.
dancecrave
Posts: 12
Joined: Thu Jun 21, 2007 10:47 pm

Post by dancecrave »

Thanks for the reply.

Yes sorry, it's Quake4.

Oh thats a shame :tear: I saw something similar in Quake 3 which worked a treat using deformvertexes but I know that's an entirely different engine.

The note about alpha, can I clarify? I put in the alphatest statement, is that what you mean? I noticed the texture being really bright without it so do put in an alphatest for every tga with an aplha channel that I make (not many). Is that sufficient or do I need to put in something else?

thanks

Al
o'dium
Posts: 11712
Joined: Sun Mar 25, 2001 8:00 am

Post by o'dium »

Alpha testing is pretty much ON or OFF with regards to alpha, you either have white, or black. In other words, alpha tested surfaces always appear ingame with harsh edges. However, both sorting in relation to the camera, and lighting is fastest on these types, so, thats why we only use alpha tested surface when we want something lit. Its a little ugly without alpha to coverage (A method that works with AA to blend the edges better) but its fast.

Alpha blending is probably what you used in Quake 3. The edges of the alpha texture are faded out, and its a lot easier on the eyes. However, the drawing order of these surfaces can be messed up without a lot of care, and they also cannot be lit in D3/Q4. In other words, they will appear fullbright at all times.

ATM, you are using an alpha tested surface. It can be lit, and it looks ok, but it wont move unless you animate it.
dancecrave
Posts: 12
Joined: Thu Jun 21, 2007 10:47 pm

Post by dancecrave »

Ok, that's clear.

I dont suppose you can point me in the direction of some simple animation examples so I can see what's involved and if I can can do it? :)

thanks

Alan
rgoer
Posts: 798
Joined: Sun Aug 17, 2003 7:00 am

Post by rgoer »

the deformvertexes keyword is very limited in the d3/q4 engine

the only deformvertexes mode that works is offset if I recall correctly... and that won't do what you want very easily
obsidian
Posts: 10970
Joined: Mon Feb 04, 2002 8:00 am

Re: Material moving in the wind...

Post by obsidian »

On a separate note, anyone notice the cloth simulations in Id Tech 5? (could be animated, but I think not)
User avatar
Hipshot
Posts: 1548
Joined: Sun Jan 20, 2002 8:00 am

Re: Material moving in the wind...

Post by Hipshot »

How many movies are there on Tech 5, more than 1?
Q3Map2 2516 -> http://www.zfight.com/misc/files/q3/q3map_2.5.16_win32_x86.zip
Q3Map2 FS_20g -> http://www.zfight.com/misc/files/q3/q3map2_fs_20g.rar
GtkRadiant 140 -> http://www.zfight.com/misc/files/q3/GtkRadiantSetup-1.4.0-Q3RTCWET.exe
obsidian
Posts: 10970
Joined: Mon Feb 04, 2002 8:00 am

Re: Material moving in the wind...

Post by obsidian »

There's the original shown at Apple's WWDC, and the trailer shown at QuakeCon 2007. If you look on the air-balloon things, there's a bunch of waving pieces of cloth and flags on the buggies. At QuakeCon, there were also a bunch of other developer tool demonstrations, including one done by John Carmack.
Post Reply