Page 1 of 1

Material moving in the wind...

Posted: Wed Jul 25, 2007 10:21 pm
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

Posted: Thu Jul 26, 2007 7:31 am
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.

Posted: Thu Jul 26, 2007 11:08 am
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

Posted: Thu Jul 26, 2007 11:19 am
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.

Posted: Thu Jul 26, 2007 2:15 pm
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

Posted: Thu Jul 26, 2007 3:55 pm
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

Re: Material moving in the wind...

Posted: Thu Aug 09, 2007 6:59 pm
by obsidian
On a separate note, anyone notice the cloth simulations in Id Tech 5? (could be animated, but I think not)

Re: Material moving in the wind...

Posted: Thu Aug 09, 2007 7:13 pm
by Hipshot
How many movies are there on Tech 5, more than 1?

Re: Material moving in the wind...

Posted: Thu Aug 09, 2007 7:19 pm
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.