DerelictStudios Forums: Animated Shaders - DerelictStudios Forums

Jump to content

  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

Animated Shaders

#1 User is offline   Ruderalis 

  • Private
  • Group: Volcano Soldier
  • Posts: 25
  • Joined: 06-July 09
  • Location:Germany

Posted 06 July 2009 - 08:37 PM

Hi!

Doesn't belong to my question but first of all: Congratulations for completing a complex mod like Blitzkrieg II! I hope i can get CnC Generals running the next days to play it.. (good old serious error wink.gif )
...
But my question doesn't concern Generals but RA3 - Modding: Which Shaders are used for uv-animated Textures in RA3? I tried at least every shader delivered with the Mod SDK but couldn't figure out how to make a simple animation like moving treads. I think i get some kind of animation with some shaders but i don't know what i did exactly and uhm it didn't seem to have any kind of sense wink.gif

P.S.: I was modding Generals for some time when the game was out and there was a huge Modding Community if i remember things right. It doesn't look like there are a lot of guys interested in modding CNC3/RA3 or am i just looking on the wrong pages?

English isn't my mother tongue and i have not spoken it for about half a year so i hope you excuse mistakes. smile.gif
0

#2 User is offline   killakanz 

  • Man with a heart, a soul. And a gun.
  • Group: Volcano Lord
  • Posts: 4,639
  • Joined: 12-November 03
  • Location:Hampshire, UK
  • Mod Registrations:

Posted 07 July 2009 - 11:14 AM

haven't tried it yet but I'm assuming the same method for C&C3 works in RA3.

http://www.derelictstudios.net/site/killasmods/tut8.php

Would you mind trying it and let me know what happens?
0

#3 User is offline   Ruderalis 

  • Private
  • Group: Volcano Soldier
  • Posts: 25
  • Joined: 06-July 09
  • Location:Germany

Posted 07 July 2009 - 01:18 PM

Thanks for your help. I used your tutorial some time ago to get some basics but i didn't remember your tutorial explained how to make treads going.
The shader options for defaultw3d look a bit different to those you show in your tutorials. The UVo scl settings are made with color channels. You can also change alpha, hue, saturation and value. Don't know if that matters.
If i see things right i have to assign a W3D material with my treads to the treads and then a shader which uses the w3d-material? Or can i just use the defaultw3d.fx, select my texture and work with the UVo settings. W3D-material doesn't seem to work for unknown reason. If i try to tick the box Stage 0 Texture 3DSmax crashes..
0

#4 User is offline   killakanz 

  • Man with a heart, a soul. And a gun.
  • Group: Volcano Lord
  • Posts: 4,639
  • Joined: 12-November 03
  • Location:Hampshire, UK
  • Mod Registrations:

Posted 07 July 2009 - 01:32 PM

If W3D material keeps crashing try using a standard material. Is the UVo scl setting only a colour swatch? No option to change it to a number swatch?

I really need to take an evening to play with the RA3 toolset...
0

#5 User is offline   Ruderalis 

  • Private
  • Group: Volcano Soldier
  • Posts: 25
  • Joined: 06-July 09
  • Location:Germany

Posted 07 July 2009 - 03:21 PM

At least i can export it without error when using standard materials but i can't see any animation neither in 3dsmax nor in game. In 3dsmax the Treads are turning black when the shader is applied.
In game RA3 doesn't seem to work with hidden SubObjects for the treads. If i'm right this code
CODE
<AnimationState
ParseCondStateType="PARSE_NORMAL"
ConditionsYes="MOVING"
Flags="RANDOMSTART"
StateName="STATE_DoorClosed">
<Animation
AnimationName="SUAntiVehicleVehicleTech3_MOVA"
AnimationMode="LOOP"
AnimationSpeedFactorMin="0.8"
AnimationSpeedFactorMax="1.2" />
<script>
Prev = CurDrawablePrevAnimationState()
if Prev == "STATE_DoorOpened" then
CurDrawableSetTransitionAnimState("TRANS_DoorClose")
end
</Script>
</AnimationState>

is responsible for the moving animation. So there is no part for moving right or left neither, like i saw it in an other tutorial for CNC3 where there were SubObjects for Stop, Moving, Right and Left.
I don't own CNC3 so i can't compare it to RA3.
Maybe i'm totally wrong and the animations are defined anywhere else.
For the Uvo scl setting i can't find any way to change it to a number swatch but i think the RGB channels are the Options for movement.

Thanks for your effort!
0

#6 User is offline   killakanz 

  • Man with a heart, a soul. And a gun.
  • Group: Volcano Lord
  • Posts: 4,639
  • Joined: 12-November 03
  • Location:Hampshire, UK
  • Mod Registrations:

Posted 07 July 2009 - 03:30 PM

Looks like they've switched to a more efficient way to make treads work for RA3. I never really liked the way C&C3 did it.

Once I get some time off, I'll be able to look into this.

The only thing I can advise you for now is see if you can open any RA3 sample units in Max and have a close look at it. That's pretty much how I figured out C&C3 units, hopfully RA3 units are just as revealing.
0

#7 User is offline   Ruderalis 

  • Private
  • Group: Volcano Soldier
  • Posts: 25
  • Joined: 06-July 09
  • Location:Germany

Posted 07 July 2009 - 05:30 PM

QUOTE (killakanz @ Jul 7 2009, 3:30 PM) <{POST_SNAPBACK}>
Looks like they've switched to a more efficient way to make treads work for RA3. I never really liked the way C&C3 did it.

Once I get some time off, I'll be able to look into this.

The only thing I can advise you for now is see if you can open any RA3 sample units in Max and have a close look at it. That's pretty much how I figured out C&C3 units, hopfully RA3 units are just as revealing.

Would have been nice by EA to put a tank with moving treads into the artpack which is included in the game...
It looks like they used one mesh for the complete model so there are no extra meshes for treads. To move parts of this mesh there is a smaller version of the model in the scene, which acutally has different parts like "Bone_tread_wheels_right". So this Object is linked to the right treads of the complete mesh, which is exported as geometry.
But i couldn't figure out how they get animated texture going with this way. I think there have to be a XML where Treads are defined?

I was wondering about the "MeshInstanceTemplate.xml" which seems to use the Predatortank of CNC3 in some kind of way:
CODE
<?xml version="1.0" encoding="us-ascii"?>
<AssetDeclaration xmlns="uri:ea.com:eala:asset">

<MeshInstanceTemplate
id="GlobalMeshInstanceTemplate">
<Rule MeshID="GUPREDTANK.TREADSSTOP" Instances="4"/>
</MeshInstanceTemplate>

</AssetDeclaration>

Looks like RA3 is a bit different to CNC3 with the organization of the meshes.
0

#8 User is offline   killakanz 

  • Man with a heart, a soul. And a gun.
  • Group: Volcano Lord
  • Posts: 4,639
  • Joined: 12-November 03
  • Location:Hampshire, UK
  • Mod Registrations:

Posted 07 July 2009 - 06:00 PM

curious indeed.
0

#9 User is offline   Ruderalis 

  • Private
  • Group: Volcano Soldier
  • Posts: 25
  • Joined: 06-July 09
  • Location:Germany

Posted 08 July 2009 - 08:17 PM

CODE
<TruckDraw
id="ModuleTag_Draw"
OkToChangeModelColor="true"
LeftFrontTireBone="Bone_Tracks_Front_Left"
RightFrontTireBone="Bone_Tracks_Front_Right"
LeftRearTireBone="Bone_Tracks_Rear_Right"
RightRearTireBone="Bone_Tracks_Rear_Left"

TireRotationMultiplier="0.0"
InitialRecoilSpeed="0.5"
MaxRecoilDistance="5"
RecoilDamping="2.0"
RecoilSettleSpeed="3.0"

ExtraPublicBone="Bone_Tread_Front_Left Bone_Tread_Front_Right Bone_Tread_Rear_Left Bone_Tread_Rear_Right FXTracksL FXTracksR Bone_Turret Bone_Turret_Pitch FX_Laser FXBone_Muzzle BONE_GUN_MUZZLE"
TrackMarks="EXTnkTrack"
TrackMarksLeftBone="FXTracksL"
TrackMarksRightBone="FXTracksR">
<TreadTerrainParticles>DefaultTankTerrainParticleMapping</TreadTerrainParticles>

<TreadScrollingMap
LeftTrack="Bone_Tread_Front_Left"
RightTrack="Bone_Tread_Front_Right"
SpeedMultiplier="-0.06"
TreadDriveSpeedFraction="10%"/>
<TreadScrollingMap
LeftTrack="Bone_Tread_Rear_Left"
RightTrack="Bone_Tread_Rear_Right"
SpeedMultiplier="-0.06"
TreadDriveSpeedFraction="10%"/>


This is from the Guardian Tanks XML. A Tank with Treads, not tires. Seems they manage the animation this way. But i couldn't explain to myself the part "TreadScrollingMap". Why do they use a bone here? ..


0

#10 User is offline   killakanz 

  • Man with a heart, a soul. And a gun.
  • Group: Volcano Lord
  • Posts: 4,639
  • Joined: 12-November 03
  • Location:Hampshire, UK
  • Mod Registrations:

Posted 09 July 2009 - 11:16 AM

It looks like they use a bone to label meshes that need to scroll the UVW map for the treads. Makes sense, much easier to set up the vehicle and this would also allow multiple independent treads on the vehicle.
0

#11 User is offline   Ruderalis 

  • Private
  • Group: Volcano Soldier
  • Posts: 25
  • Joined: 06-July 09
  • Location:Germany

Posted 09 July 2009 - 04:07 PM

QUOTE (killakanz @ Jul 9 2009, 11:16 AM) <{POST_SNAPBACK}>
It looks like they use a bone to label meshes that need to scroll the UVW map for the treads. Makes sense, much easier to set up the vehicle and this would also allow multiple independent treads on the vehicle.

Hm at least i figured out how to du usual animated textures with the defaulw3d.fx and it works..
But how do you scroll the uvw map with a bone? Do i have to bind the vertices of the Mesh to the bone with this WWSkinBinding and use an animated texture on the bone? I don't get it..
0

#12 User is offline   killakanz 

  • Man with a heart, a soul. And a gun.
  • Group: Volcano Lord
  • Posts: 4,639
  • Joined: 12-November 03
  • Location:Hampshire, UK
  • Mod Registrations:

Posted 09 July 2009 - 04:13 PM

It's just a guess, I still can't test the idea myself but I think the game is hard-coded to scroll the texture across the mesh of the treads, much like how Generals did but this time you don't need any special settings for the texture. The bonus with the game being able to control it rather than having tread sets like C&C3 is the game can dynamically control the direction and speed of the treads better as the vehicle moves.
Just a normal texture for the treads applied to the mesh, then link the bone to the mesh with a WWskin and the game takes over from there.
0

#13 User is offline   Ruderalis 

  • Private
  • Group: Volcano Soldier
  • Posts: 25
  • Joined: 06-July 09
  • Location:Germany

Posted 09 July 2009 - 05:06 PM

QUOTE (killakanz @ Jul 9 2009, 4:13 PM) <{POST_SNAPBACK}>
It's just a guess, I still can't test the idea myself but I think the game is hard-coded to scroll the texture across the mesh of the treads, much like how Generals did but this time you don't need any special settings for the texture. The bonus with the game being able to control it rather than having tread sets like C&C3 is the game can dynamically control the direction and speed of the treads better as the vehicle moves.
Just a normal texture for the treads applied to the mesh, then link the bone to the mesh with a WWskin and the game takes over from there.

If it worked this way it would have to work to use the Tread Meshes themselve as the bones defined in the <TreadScrollingMap......> or not?
I copied the tread to create a bone, linked the mesh with the texture to the bone with a WWskin but it doesn't work. If it worked this way i don't really get the point why you need a bone for the uvw scrolling.

Edit// Forget about the text above^^
I forgot to assign the bones in the XML. sad.gif
So hail to the king killakanz wink.gif Thanks alot!

I used the ObjectsAlliedTread.fx as the shader for the Treads, doesn't seem to be much different to the normal AlliedObjects.fx, i have to test whether it works with both shaders.
At least its really simple. Just clone the treads, bind them to the bones with the WWskin and use the bones in the xml. Looks a lot easier and more comfortable than the way i've seen for CNC3.

edit2/ To have the treads moved at accurate time and on the right side when turning, you have to use the shader for treads, which is used by every faction.

This post has been edited by Ruderalis: 09 July 2009 - 06:04 PM

0

#14 User is offline   killakanz 

  • Man with a heart, a soul. And a gun.
  • Group: Volcano Lord
  • Posts: 4,639
  • Joined: 12-November 03
  • Location:Hampshire, UK
  • Mod Registrations:

Posted 13 July 2009 - 11:24 AM

QUOTE (Ruderalis @ Jul 9 2009, 4:06 PM) <{POST_SNAPBACK}>
Looks a lot easier and more comfortable than the way i've seen for CNC3.

edit2/ To have the treads moved at accurate time and on the right side when turning, you have to use the shader for treads, which is used by every faction.


Excellent, indeed a far beter way than C&C3. Good to know. Well done.
0

#15 User is offline   Ruderalis 

  • Private
  • Group: Volcano Soldier
  • Posts: 25
  • Joined: 06-July 09
  • Location:Germany

Posted 13 July 2009 - 07:07 PM

QUOTE (killakanz @ Jul 13 2009, 11:24 AM) <{POST_SNAPBACK}>
QUOTE (Ruderalis @ Jul 9 2009, 4:06 PM) <{POST_SNAPBACK}>
Looks a lot easier and more comfortable than the way i've seen for CNC3.

edit2/ To have the treads moved at accurate time and on the right side when turning, you have to use the shader for treads, which is used by every faction.


Excellent, indeed a far beter way than C&C3. Good to know. Well done.

So you may add this as a hint to your tutorial for beginners in RA3-Modding. Everthing else is nearly the same and your tutorial is very good for beginners because it shows the whole way of bringing a model (and even model it) into CNC3/RA3 as a unit. And maybe this will get some new guys to do stuff for RA3.
P.S. If you want your tutorial to be translated in german i would like to do it.
0

#16 User is offline   killakanz 

  • Man with a heart, a soul. And a gun.
  • Group: Volcano Lord
  • Posts: 4,639
  • Joined: 12-November 03
  • Location:Hampshire, UK
  • Mod Registrations:

Posted 14 July 2009 - 02:53 PM

I might well do that, since there's little difference in other aspects of setting up a unit.
Also if you wish to translate, feel free to do so. I'm still waiting for my net connection at home to be sorted out before I can update the site, it's already been translated into Spanish.
0

#17 User is offline   Count von Phoib 

  • Dark Volcano Lord
  • Group: Volcano Lord
  • Posts: 15,323
  • Joined: 05-April 03
  • Mod Registrations:

Posted 14 July 2009 - 04:32 PM

Also, are you available for more translation work? ph34r.gif
0

#18 User is offline   Ruderalis 

  • Private
  • Group: Volcano Soldier
  • Posts: 25
  • Joined: 06-July 09
  • Location:Germany

Posted 24 July 2009 - 11:33 PM

Had to do some work for university last weeks, but i've got some more time now, especially because i hurt my leg.. mad.gif
If i would translate your tutorial, would it be ok to just translate the part concerning CNC3? At least i don't own 3dsmax in german so i don't know how some things are called in the german version. Translation would be easy without the modelling part.
@CountvonPhoib: If you don't want me to translate a book, i may translate some things. But i can't guguarantee anything.

Here are some screenshots from the work i did for RA3. Nothing special, just playing with the code and trying to use the shaders in a proper way.
Down at the right corner on the picture with the Phantom you can see, what you're able to do with the normal maps wink.gif This was more a kind of accident but i think you can do some pretty stuff with normal maps in RA 3 wink.gif
Hope you like it at least a bit, i didn't do any modding or even modelling/texturing work for a long time so don't be to hard cool.gif
(Of course the tank has working treads wink.gif )
http://img269.imageshack.us/img269/826/hueyh.jpg
http://img228.imageshack.us/img228/5330/ screenoio.jpg
http://img142.imageshack.us/img142/6994/allk.jpg

This post has been edited by Ruderalis: 25 July 2009 - 12:39 PM

0

#19 User is offline   Count von Phoib 

  • Dark Volcano Lord
  • Group: Volcano Lord
  • Posts: 15,323
  • Joined: 05-April 03
  • Mod Registrations:

Posted 25 July 2009 - 11:42 AM

Ever considered signing up to the Volcano? biggrin.gif

And I'm afraid the text is book-size caliber to translate, but if you are in need of a mod to model for... smile.gif
0

#20 User is offline   Ruderalis 

  • Private
  • Group: Volcano Soldier
  • Posts: 25
  • Joined: 06-July 09
  • Location:Germany

Posted 25 July 2009 - 12:55 PM

QUOTE (Count von Phoib @ Jul 25 2009, 11:42 AM) <{POST_SNAPBACK}>
Ever considered signing up to the Volcano? biggrin.gif

And I'm afraid the text is book-size caliber to translate, but if you are in need of a mod to model for... smile.gif

I think i have to get into moddeling again before i'm able to do good work. At the moment my workflow is crappy and i forgot a lot.
At last the uvw unwrapping takes a lot of time right now but i'm getting better again..
But if you have a mod project searching for modelers, i'm open for everything. (don't know whether this is the right expression in english^^)
Don't know what you mean with the volcano? ohmy.gif

Is your text another modding tutorial?

0

Share this topic:


  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users