Replies: 16 (Who?), Viewed: 6100 times.
Forum Resident
Original Poster
#1 Old 23rd Jun 2005 at 2:21 PM
Animation via texture-rotation
Hi Folks.

I have done texture-animations in the MATD via tiling and via transforms (transitions), both are not too hard to do.

But was not able so far to do anything with rotating textures.

I tried to set the stdMatTextureCoordAnimMode to "rotate" (I have no idea if this parameter really exists, but I guessed so, since there are "tile" and "transform" as parameters for this), and I also tried "transform".
Further I set stdMatTextureCoordTfAnimRotSpeed to ten as a starting value, left stdMatTextureCoordTfAnimRotStartEnd to 0 and 1 (and asked myself if 0 is standing for 0 degrees and 1 is standing for 360 degrees, or if I have to put in values between 0.000... and 360.000..., tried different values, though). I left stdMatTextureCoordTfAnimRotWaveform at "triangular".

But when I tested my objects in the game, I never got any animation at all.

Has anyone more insight in this? Maybe one of the Maxoids would be so kind and give a hint?

happy simming,
Xanathon


Xanathon's Laboratory :: WishList

.: Do not harass me with requests via PM, you will only get ignored :.
.: Don't post my objects or objects derived from them on paysites or the exchange! :.
Advertisement
Inventor
#2 Old 23rd Jun 2005 at 4:06 PM
I can BET that no Maxoid will come.
Forum Resident
Original Poster
#3 Old 23rd Jun 2005 at 5:08 PM
Very helpful comment... :blah: :screwy:

happy simming,
Xanathon


Xanathon's Laboratory :: WishList

.: Do not harass me with requests via PM, you will only get ignored :.
.: Don't post my objects or objects derived from them on paysites or the exchange! :.
One of those Maxoids
#4 Old 23rd Jun 2005 at 9:20 PM
Quote:
Originally Posted by xanathon
Very helpful comment... :blah: :screwy:


I agree, very helpful.

There is no "rotate" option on for the stdMatTextureCoordAnimMode. The applicable options are: transform, tile, video, or none. If you want the texture to rotate, you have to use the transform option and play with the following:

stdMatTextureCoordTfAnimOrigin
stdMatTextureCoordTfAnimRotWaveform
stdMatTextureCoordTfAnimRotSpeed
stdMatTextureCoordTfAnimRotStartEnd
stdMatTextureCoordTfAnimScaleWaveform
stdMatTextureCoordTfAnimScaleSpeed
stdMatTextureCoordTfAnimScaleStartEnd
stdMatTextureCoordTfAnimTransWaveform
stdMatTextureCoordTfAnimTransSpeed
stdMatTextureCoordTfAnimTransStart
stdMatTextureCoordTfAnimTransEnd

Btw, what happens now that mod_bv has lost the bet?
Forum Resident
Original Poster
#5 Old 23rd Jun 2005 at 10:36 PM
Quote:
Originally Posted by MaxoidTom
There is no "rotate" option on for the stdMatTextureCoordAnimMode. The applicable options are: transform, tile, video, or none. If you want the texture to rotate, you have to use the transform option and play with the following:

(...)


Ah, thank you very much for the hints, MaxoidTom, I appreciate it and I will certainly do further experiments.

Quote:
Originally Posted by MaxoidTom
Btw, what happens now that mod_bv has lost the bet?


Grin, I think he should come up with something reasonable as what kind of wager he placed, now that he has lost it... :D

happy simming,
Xanathon


Xanathon's Laboratory :: WishList

.: Do not harass me with requests via PM, you will only get ignored :.
.: Don't post my objects or objects derived from them on paysites or the exchange! :.
Mad Poster
#6 Old 21st Feb 2006 at 8:06 AM Last edited by niol : 21st Feb 2006 at 12:52 PM.
Quote:
Originally Posted by MaxoidTom
I agree, very helpful.

There is no "rotate" option on for the stdMatTextureCoordAnimMode. The applicable options are: transform, tile, video, or none. If you want the texture to rotate, you have to use the transform option and play with the following:

stdMatTextureCoordTfAnimOrigin
stdMatTextureCoordTfAnimRotWaveform
stdMatTextureCoordTfAnimRotSpeed
stdMatTextureCoordTfAnimRotStartEnd
stdMatTextureCoordTfAnimScaleWaveform
stdMatTextureCoordTfAnimScaleSpeed
stdMatTextureCoordTfAnimScaleStartEnd
stdMatTextureCoordTfAnimTransWaveform
stdMatTextureCoordTfAnimTransSpeed
stdMatTextureCoordTfAnimTransStart
stdMatTextureCoordTfAnimTransEnd

Btw, what happens now that mod_bv has lost the bet?


Wow, thanks for the info...(Update: I mean to all who input here...)

Anyway, "Btw, what happens now that mod_bv has lost the bet?"
it happened that MaxoidTom came to answer the question...!
Mad Poster
#7 Old 19th Mar 2006 at 10:09 AM
I've come across a little different problem with the textural animation,

How to use "video" for stdMatTextureCoordAnimMode.?
I've tried to use it but got no result at all seemingly, or I overlooked on something?
I've set the mode into it alone or with other combinations with tile, transform and their combinations. But, nothing visible happened... Or that, the type of combo settings just don't work while it takes others to set the video...?
Also, what objects to find for and how to use "stdMatTextureCoordTfAnimOrigin", "steamLayer1Rotation", "steamLayer2RotationX" and "steamLayer2RotationY" do...
How to know if they're set properly?

Thanks in advance...
Forum Resident
#8 Old 19th Mar 2006 at 12:13 PM
I believe (but am not sure) that for video an actual video has to be referenced.
Inventor
#9 Old 19th Mar 2006 at 12:54 PM
I lost the bet! Hmmm.... could we...(runs away) :D
Mad Poster
#10 Old 19th Mar 2006 at 2:39 PM
So, "video" can really mean the actual video files.. like avi or mpg
Thanks Fat D, I'll try to fool around the TVs to see if any clue is there...
Forum Resident
Original Poster
#11 Old 20th Mar 2006 at 10:04 AM
niol: I hope you enlighten us if you come to any conclusions. :o)

happy simming,
Xanathon


Xanathon's Laboratory :: WishList

.: Do not harass me with requests via PM, you will only get ignored :.
.: Don't post my objects or objects derived from them on paysites or the exchange! :.
Forum Resident
#12 Old 20th Mar 2006 at 2:16 PM
I'm not sure, but I don't get any other possibility in my head. But I believe it has to be a special encoding.
Mad Poster
#13 Old 20th Mar 2006 at 3:05 PM Last edited by niol : 16th Oct 2006 at 8:10 PM.
I've not found any "video" for the mode in TV TMXTs yet.
However, I've found that parameter appeared in one of the material files. It's in xml and C++ alike, and I know I suck on that still.
The material.package file is the one located "...\EA GAMES\The Sims 2\TSData\Res\Materials", but not the one in the catalogue.
This file has many programming wordings about "material" effects like water effect, steam, fight cloud, tiles, encube settings, water layers, etc...




For those interested in " A collection of standard parameterized materials" The last eighth file in my sorting
It has many definitions of those property lines there...
"video" was mentioned in this file as well, but slightly...
...
sete stdMatTextureCoordAnimMode none (none transform tile video)
#attrdescription Type of texture coordinate animation
...
create DetermineHardwareSupport()

if (strcmp("${stdMatTextureCoordAnimMode}", "video") = 0)
setb modifiyEachFrameHintFlag true
endif
...

I'm gonna experiment a bit on the some tof them a bit especially the listed one as well as
mirrorReflectionsEnabled = true/false...

Added the file just in case it's hard to find...
With it, I assume one can know almost all the common txmt properties for the base game.
Also, for every EP, each has its own material.package file in the relatively same structural directory.


Also, may check out the name map to learn the terms' references.

Wow, we may have a funny amount of things to test out, reading on the file... :moose:

********
Here's the part about how to use those properties:

#beginshader StandardMaterial

# --- Default values for shader parameters -------------------------------------

# Comment below marks this as the start of attributes which are set by artists
# in Maya for the standard material
#BeginStdAttrBlock

set shaderNotifyString ""
set shaderNotifyString ""
#attrdescription Notification string sent out whenever material is rendered

seti stdMatLayer 0 # min:-32 max:32
#attrdescription Layer for drawing. Higher numbers are drawn later. 0 is the default.

sete stdMatFillMode solid (solid wireframe)
#attrdescription Type of primitive rendering

sete stdMatCullMode cullClockwise (none cullClockwise cullCounterClockwise)
#attrdescription Culling (usually back-face) of primitive rendering

setb stdMatLightingEnabled true
#attrdescription Whether to light surfaces with this material applied to them

sete stdMatMinLightRangeHint 4 (1 2 4)
#attrdescription The minimum required light intensity range this material must support

sete stdMatAlphaBlendMode none (none blend additive addNoSrcAlphaScale)
#attrdescription Use none for opaque surfaces or mask surfaces; additive scales colors against alpha and adds to destination; addNoSrcAlphaScale adds color and alpha to dest.

setb stdMatAlphaTestEnabled false
#attrdescription Turn this on for mask surfaces

seti stdMatAlphaRefValue 127 # min:0 max:255
#attrdescription For mask surfaces, threshold value for alpha

setf stdMatAlphaMultiplier 1 # min:-5 max:5
#attrdescription Straight multiplier on alpha channel

setb stdMatBaseTextureAlphaReplicate false
#attrdescription Whether to expect a grayscale "-alpha" texture and use
#attrdescription that one value for all three color channels.

set stdMatBaseTextureParam ""
#attrdescription Extra parameters for the base texture, enabling e.g. procedurally
#attrdescription generated textures to be specified

set stdMatSpecMaskTextureParam ""
#attrdescription Extra parameters for the spec mask texture, enabling e.g. procedurally
#attrdescription generated textures to be specified

set stdMatNormalMapTextureParam ""
#attrdescription Extra parameters for the normal map (bump map) texture, enabling e.g.
#attrdescription procedurally generated textures to be specified

set stdMatCutoutTextureParam ""
#attrdescription Extra parameters for the cutout texture, enabling e.g. procedurally
#attrdescription generated textures to be specified

set stdMatEnvCubeTextureParam ""
#attrdescription Extra parameters for the env cube texture, enabling e.g. procedurally
#attrdescription generated textures to be specified

sete stdMatEnvCubeMode none (none reflection)
#attrdescription What kind of env cube is expected

setf stdMatEnvCubeBlurFactor 0 # min:0 max:64
#attrdescription Blurriness of environment cube reflections/radiance

setb stdMatEnvCubeLockedToCamera false
#attrdescription If true, the environment cube is locked to the camera.

sete stdMatTextureCoordAnimMode none (none transform tile video)
#attrdescription Type of texture coordinate animation

setv2 stdMatTextureCoordTfAnimOrigin (0.5, 0.5)
#attrdescription Origin of rotation and scale for when 'transform' texture
#attrdescription coordinate animation is enabled

setf stdMatTextureCoordTfAnimRotSpeed 0 # min:0 max:60
#attrdescription Revolutions per second for when 'transform' texture coordinate
#attrdescription animation is enabled, or zero to disable rotation animation

setv2 stdMatTextureCoordTfAnimRotStartEnd (0, 1)
#attrdescription Rotation start/end position (1=360deg) for when 'transform'
#attrdescription texture coordinate animation is enabled

sete stdMatTextureCoordTfAnimRotWaveform triangular (sawtooth triangular sine)
#attrdescription Rotation waveform type for when 'transform' texture coordinate
#attrdescription animation is enabled

setf stdMatTextureCoordTfAnimScaleSpeed 0 # min:0 max:60
#attrdescription Scale cycles per second for when 'transform' texture coordinate
#attrdescription animation is enabled, or zero to disable scale animation

setv2 stdMatTextureCoordTfAnimScaleStartEnd (1, 2) # min:0.001 max:100
#attrdescription Scale start/end values for when 'transform' texture coordinate
#attrdescription animation is enabled

sete stdMatTextureCoordTfAnimScaleWaveform triangular (sawtooth triangular sine)
#attrdescription Scale waveform type for when 'transform' texture coordinate
#attrdescription animation is enabled

setf stdMatTextureCoordTfAnimTransSpeed 0 # min:0 max:60
#attrdescription Translation cycles per second for when 'transform' texture coordinate
#attrdescription animation is enabled, or zero to disable translation animation

setv2 stdMatTextureCoordTfAnimTransStart (0, 0)
#attrdescription Translation start UV coords for when 'transform' texture coordinate
#attrdescription animation is enabled

setv2 stdMatTextureCoordTfAnimTransEnd (0, 0)
#attrdescription Translation end UV coords for when 'transform' texture coordinate
#attrdescription animation is enabled

sete stdMatTextureCoordTfAnimTransWaveform triangular (sawtooth triangular sine)
#attrdescription Translation waveform type for when 'transform' texture coordinate
#attrdescription animation is enabled

setf stdMatTextureCoordTileAnimSpeed 0 # min:0 max:60
#attrdescription The number of tiles per second for when 'tile' texture coordinate
#attrdescription animation is enabled

setv2 stdMatTextureCoordAnimNumTiles (1,1)
#attrdescription Defines number of tiles in the source texture for when 'tile'
#attrdescription texture coordinate animation is enabled

setb forceHighQualitySkinning false
#attrdescription When enabled, the object will ignore the skinning quality settings.
#attrdescription Only to be used on troublesome objects that require more-than-one bone.


# Comment below marks this as the end of attributes which are set by artists
# in Maya for the standard material
#EndStdAttrBlock

setv3 stdMatDiffCoef (1,1,1)
setv3 stdMatSpecCoef (0,0,0)
setv3 stdMatEmissiveCoef (0,0,0)
setv3 stdMatEnvCubeCoef (0,0,0)
setf stdMatSpecPower 0

setf stdMatUntexturedDiffAlpha 1

setb stdMatBaseTextureEnabled false
setb stdMatSpecMaskTextureEnabled false
setb stdMatNormalMapTextureEnabled false
setb stdMatReduceBoneWeights false # only applies the first (most important) weight.
setb stdMatMorphState true # whether morph targets are applied.

set stdMatBaseTextureName reggrid
set stdMatSpecMaskTextureName reggrid
set stdMatNormalMapTextureName reggrid-bump
set stdMatCutoutTextureName "0" # default is not to do cutouts
set stdMatEnvCubeTextureName reflectionCubeTemplate-envcube

sete stdMatBaseTextureAddressingU tile (tile mirror clamp borderColor)
sete stdMatBaseTextureAddressingV tile (tile mirror clamp borderColor)
sete stdMatBaseTextureAddressingW tile (tile mirror clamp borderColor)

sete stdMatSpecMaskTextureAddressingU tile (tile mirror clamp borderColor)
sete stdMatSpecMaskTextureAddressingV tile (tile mirror clamp borderColor)
sete stdMatSpecMaskTextureAddressingW tile (tile mirror clamp borderColor)

sete stdMatNormalMapTextureAddressingU tile (tile mirror clamp borderColor)
sete stdMatNormalMapTextureAddressingV tile (tile mirror clamp borderColor)
sete stdMatNormalMapTextureAddressingW tile (tile mirror clamp borderColor)

sete stdMatCutoutTextureAddressingU clamp (tile mirror clamp borderColor)
sete stdMatCutoutTextureAddressingV clamp (tile mirror clamp borderColor)
sete stdMatCutoutTextureAddressingW clamp (tile mirror clamp borderColor)

# the only bumpMapping flag now, default on for clockwork, contentviewer, casie, etc. Config manager will set off.
# defaulting VS2 light looping OFF, since radeons as of (6/6/2004) are broken in some cases
setb bumpMapping true
setb flagSkinnedObjects false
#setb mirrorReflectionsEnabled false
setb vs2LoopsFunctional false
setb causticsEnabled false
setb appInDebugMode false

seti stdMatShapeColorIndex -1
#setc stdMatShadowColor (0.33, 0.33, 0.39)
setc stdMatShadowColor (0.63, 0.63, 0.85)
# Default shadow colour. Generally this will be overridden by code.
Download - please read all instructions before downloading any files!
File Type: rar A collection of standard parameterized materials.rar (7.4 KB, 31 downloads)
Lab Assistant
#14 Old 24th Mar 2006 at 6:07 AM
Niol - have you found a parameter for the animation settings in the Material Definition that will tell it to animate only once, rather than continually loop? Eg. run from cell #1 to last cell x and stop back at cell #1 (or stop at last cell x, it doesn't matter which)?

I live vicariously through my Sims. This is a sad reflection on my life and theirs.
The ModFather
retired moderator
#15 Old 24th Mar 2006 at 8:16 AM
Darylmarkloc - I don't know if such a parameter exists, but in any case it would be quite useless: the animation would run only once when the lot is loaded (and you are probably not watching it) and then never again.

My suggestion is to to create two Material Definitions, one animated and one static (frame rate = 0), pointing to the same texture; and then, when the animation is needed, you can use a BHAV like this:
Code:
  • Change Material -> changes to animated material
  • Idle (minutes) -> waits n sim-minutes
  • Change Material -> changes back to "static" TXMT

I've finally started my Journal. Information only, no questions.

My latest activity: CEP 9.2.0! - AnyGameStarter 2.1.1 (UPD) - Scriptorium v.2.2f - Photo & Plaques hide with walls - Magazine Rack (UPD) - Animated Windows Hack (UPD) - Custom Instrument Hack (UPD) - Drivable Cars Without Nightlife (UPD) - Courtesy Lights (FIX) - Custom Fence-Arches - Painting-TV - Smarter Lights (UPD)


I *DON'T* accept requests, sorry.
Lab Assistant
#16 Old 24th Mar 2006 at 10:48 AM
Numenor - Ahh..after fiddling for a while, I thought it might have to be something like that. My intention was to have a 'fade in' and 'fade out' color graduation effect on a texture when the player selected 'On' or 'Off' from a menu. If it had been a simple setting I would have included the effect but it isn't that important. Purely a cosmetic thing..

I live vicariously through my Sims. This is a sad reflection on my life and theirs.
Mad Poster
#17 Old 25th Mar 2006 at 7:22 AM Last edited by niol : 24th Dec 2006 at 10:52 PM.
Numenor,
Thanks for answering that coz you know I don't know sufficient to answer that yet. ^_^

darylmarkloc,
I've not checked out more lately. I've messed up 2 of my game copies. One has serious problems after patching while the another one has its custom folder erased partially due to some unknown reasons. I lost my latest lots in that folder, but luckily I exported most of them out. Still finding ways to revive the sims... The files are still there, but the sims aren't working laying down on the floor like sick but moving.

Anyway just my stating the obvious, if there're some repetitive parts of your animations, you may also add some looping lines in bhav and combine the "on" and them serially.

Dec2006:
Here's a little bit more about the video setting.
define VertexShaderTextureMatrixAnimation()

if (strcmp("${stdMatTextureCoordAnimMode}", "transform") = 0)
#trace "Texture matrix animation enabled $currentMaterialName"

if ($stdMatTextureCoordTfAnimScaleStartEnd.x = 0.0)
setv2 stdMatTextureCoordTfAnimScaleStartEnd (0.001, $stdMatTextureCoordTfAnimScaleStartEnd.y)
endif

textureMatrixAnimation -targetType vsConstants -targetRegister 11 -aorigin $stdMatTextureCoordTfAnimOrigin -arot $stdMatTextureCoordTfAnimRotWaveform $stdMatTextureCoordTfAnimRotSpeed 0 $stdMatTextureCoordTfAnimRotStartEnd -ascale $stdMatTextureCoordTfAnimScaleWaveform $stdMatTextureCoordTfAnimScaleSpeed 0 $stdMatTextureCoordTfAnimScaleStartEnd -atrans $stdMatTextureCoordTfAnimTransWaveform $stdMatTextureCoordTfAnimTransSpeed 0 $stdMatTextureCoordTfAnimTransStart $stdMatTextureCoordTfAnimTransEnd
endif

if (strcmp("${stdMatTextureCoordAnimMode}", "tile") = 0)
#trace "Texture tile animation enabled $currentMaterialName"
textureTileAnimation $stdMatTextureCoordTileAnimSpeed -tiles $stdMatTextureCoordAnimNumTiles -targetType vsConstants -targetRegister 11
endif

if (strcmp("${stdMatTextureCoordAnimMode}", "video") = 0)
#trace("video texture mode\n")
sendNotifyString $shaderNotifyString
endif


enddef
Back to top