PDA

View Full Version : Question about the shadow meshes in TS3


zano972
12th Sep 2011, 12:19 PM
Hi all,

As you've already expected it (during the reading of my previous posts), I dont master the english language, but be sure I shall do my best with this one to be as well precise as possible! :lol:

For peoples who has to do with TS3 meshing, they know that most of the time an TS3 object is built from: 1 x MODL and 1 or more MLOD(s) ... Right... We all know the function / purpose of these MODL/MLOD... ALL ? no !... Apparently at this time I must be the only one who doesn't understand!!!

...But let's go, if you please it, in the heart of the subject... :faceslap:

For example, a TS3 dining chair / table or anything else is made of 3 x MLOD and 1 x MODL... In S3PE (if I refer to the TGI) the 3 MLODs (the high level details mesh and the sadow meshes - low details meshes) are (for exemple):

- MLOD (1) / 0x01D10F34-00000000-XXXXXXXX....
- MLOD (2) / 0x01D10F34-00000001-XXXXXXXX....
- MLOD (3) / 0x01D10F34-00010001-XXXXXXXX....

Well, let us leave on the side the first MLOD (0000000) to inspect closer the shadow meshes (0000001 and 00010001).

MilkShape 3D show us that these 2 meshes (the shadows) are always bigger, unrefined and always placed under the ground... Ok I can understanding it, they are only shadows! But what I really dont understand is the existing relation between the scale of the MLOD-1 (high level details mesh - 00000000 -) and the MLOD-2 / 3 (shadows - 00000001 and 00010001) !!!

I made a big column and I've scaled / sized my new column to be 5 or 6 x higher as a normal TS3 column. No matter this new simple object works fine but this new object has no shadow in the game! I've already tried hundred of time to modify the position (under the ground) and the size of these shadows meshes with no... result!... In the game the column don't want to show me his shadow! The column is of course an outside object.

Now my question:

What is the relation between a normal object mesh and these shadows meshes ???

Is it a question of shadow mesh position, size or both and why not, something else I don't expect ?

I've, if necessary, some pictures to illustrate what I'm meaning, but I think that everybody understood the main part of my problem.

Thanks a lot in advance for some answers and some lights in my dark brain.

nice day to all.

orangemittens
12th Sep 2011, 12:31 PM
The shadow lods are numbers 10000 and 10001. Having them appear correctly in-game is a function of both their size and their position.

What tools are you using to create your mesh and which versions are you using? It's a known issue in the development process that some test versions of s3pe were removing the outdoor shadow in-game. If you're using a test version of s3pe try creating your object again using the stable version.

zano972
12th Sep 2011, 04:24 PM
Thanks for reply orangemitems... I'm using the latest stable S3OC, S3PE version (11-0809-1034), MilkShape 3D or Blender 2.59 to import / export meshes, but with MS 3D or Blender the problem is the same, I can't find the right size and position for the shadows meshes.

PS:

The shadow lods are numbers 10000 and 10001

No matter I've just put a 1 in a wrong position when I'm writting the post :lol: but isn't the problem's heart :blink:

BloomsBase
12th Sep 2011, 05:13 PM
Shadow meshes usually are lower in polygon count and dont have their normals fixed.(They are completly black)
To make em black you can use the direct x tool and pull its slider back and forth, it will kill the normals after saving.

But i dont think that is the cause of your problem.
I would clone the original again, load the scaled meshes in it(exept the shadow meshes) and see ingame if the original shadow mesh still works.
If they show its prolly due your custom shadow mesh, if not, the file might get corrupt during cloning.

zano972
12th Sep 2011, 06:02 PM
hi BloomBase

Shadow meshes usually are lower in polygon count and dont have their normals fixed.(They are completly black)
To make em black you can use the direct x tool and pull its slider back and forth, it will kill the normals after saving.

Thanks! This is a really usefull and interessant information :lol:

I would clone the original again, load the scaled meshes in it(exept the shadow meshes) and see ingame if the original shadow mesh still works....

Good idea..I'm going to try it as soon as possible...

Thx.

orangemittens
12th Sep 2011, 11:54 PM
Shadow meshes usually are lower in polygon count and dont have their normals fixed.(They are completly black)
To make em black you can use the direct x tool and pull its slider back and forth, it will kill the normals after saving.

But i dont think that is the cause of your problem.
I would clone the original again, load the scaled meshes in it(exept the shadow meshes) and see ingame if the original shadow mesh still works.
If they show its prolly due your custom shadow mesh, if not, the file might get corrupt during cloning.You don't have to "kill normals" to get the shadow lods to work...at least I've never done this and mine work :)

Also, if you use direct X on any of the lods you'll strip the joint(s) off of it and it won't export right.

I'm using the latest stable S3OC, S3PE version (11-0809-1034)11-809-1034 is an outdated test version and it's posted in the test section. The most current stable version of s3pe is from April 2011. It's located here: http://dino.drealm.info/den/denforum/index.php?topic=189.0

BloomsBase
13th Sep 2011, 09:42 AM
You don't have to "kill normals" to get the shadow lods to work...at least I've never done this and mine work :)

Also, if you use direct X on any of the lods you'll strip the joint(s) off of it and it won't export right.


True :)
It is something i did when i just started creating and as i said prolly not the cause of his problem.

These days i use TSRW wich auto generates the shadow lods from the detail lods.

Inge Jones
13th Sep 2011, 12:17 PM
I wish it would do it for my objects without crashing :(

Is there some thread about how to make shadows manually? Surely there is some standard squishing factor known now? (must be, or WS couldn't make them)

orangemittens
13th Sep 2011, 01:00 PM
I wish it would do it for my objects without crashing :(

Is there some thread about how to make shadows manually? Surely there is some standard squishing factor known now? (must be, or WS couldn't make them)To make them manually I use the EA one as a template...bring in the original EA item made into .obj, select it and my object .obj both at the same time, resize/position them both until the EA .obj matches the EA shadow lod model in size and position. Then use the resulting version of my .obj as the start of my shadow model. It's a little painful but usually works and I've never had s3pe crash when making them this way. If someone has developed an easier way using s3pe I'd really like to try it :)

zano972
13th Sep 2011, 01:50 PM
You're right orangemittens about stable and S3PE test version, I've and use the latest test version because I find very practical the functions 'Export To s3asc and Import From s3asc' instead the old Export and Import functions. And these 2 news functions even in the test version always worked well and fine for me.

I keep and work with this test version because I do not really believe that there is any close relation with the fact that I don't be able to set the right size and position of object's shadows and the fact that S3PE is a test version !!!

Right... I test and try further... Soon or later some lights will come to light my darkness...

nice day and so long.

BloomsBase
13th Sep 2011, 03:44 PM
I wish it would do it for my objects without crashing :(

Is there some thread about how to make shadows manually? Surely there is some standard squishing factor known now? (must be, or WS couldn't make them)

I did compare a few meshes in the past and it seems that most objects have their X and Z increased with 200%(scale factor 2)
The height(Y) however varies alot.....from 80 to 95 %(exept with chairs, those stay the same and are also 200% scaled in height.)


The movement after scaling in height(Y) is always -1
But the movement(absolute or relative) on the X and Z is diffrent on every mesh so i suspect it is done by a angle(degrees) but im to lazy to calculate it(I dont have that option in MS anyway.....)

There are however objects that dont use these settings, cars for instance.......

Inge Jones
13th Sep 2011, 04:17 PM
Thanks, that is useful to start me off, anyway. Oh, what if the mesh starts off straddling the axis, so you have pos and neg vertices? Do they always increase (ie slope off to the front right? I mean a vertex at x=+1 and a vertex at x=-1 wouldn't end up at +2 and -2 - you don't mean that, do you?

BloomsBase
13th Sep 2011, 05:19 PM
Always scale from origin(not center of mass, wich is set as default)

But to be honest, i dont think there is a squising factor(unless its done by quaternation?) because after importing a few more objects things only get more confusing. :(

With most objects i had the best results by:
1/Move the object to
X0
Y0
Z0
Move options set to ABSOLUTE
Then scale the object to:
See post 21
I am convinced it has to do with absolute movement and scaling since the shadow meshes got correctly positioned outside the center while i didn't use diffrent values(does this make sence?)
But when i had a look at the footballtable i got confused or maybe they use a diffrent setup on those(as with cars)

Inge Jones
13th Sep 2011, 05:23 PM
What do you mean by the origin? Where the x and z cross in Milkshape, or the front right of the footprint (or is is front left?)

BloomsBase
13th Sep 2011, 06:23 PM
When scaling a mesh you have a few scaling options:
You can tick the following boxes:
Center of mass(scales the mesh from the center of it)
Origin (scales the mesh from X0 Z0 Y0)
User point(click a spot and scale from there)

But before you scale you have moved the mesh with the move options set to ABSOLUTE
Even if you dont fill in any values(X0Y0Z0) the mesh already moves below X0Z0 and after scaling it comes close to the positions of the original shadow meshes)


I am curious how TSRW does create them and if they all are similar to the ones EA included.

Inge Jones
13th Sep 2011, 07:40 PM
When you say move the object to
X-0.15
Y0
Z-0.15, which part of the object? I can move the whole thing *by* that amount, of course, but *to* that location is tricky given that if the left hand side is at x = -0.15 the right hand side will be at 0.85. Do you mean the centre of the object?

WesHowe
13th Sep 2011, 09:30 PM
You might find the location to place the sunshadow mesh at from these two fields in the MLOD (see the wiki entry for the source):

FLOAT[3] MirrorPlaneNormal // 3d normal vector specifying the direction of a mirror's reflection
FLOAT MirrorPlaneOffset //offset along the normal vector


<* Wes *>

Inge Jones
13th Sep 2011, 10:33 PM
I am afraid that's a bit obscure for me - mirrors?

Well I didn't have any problem understanding the "where" from Bloombase's post, just the what. *What* do I line up with that location? The centre of my mesh? One edge of it? I think I would also have the same question if I read an offset from the data you have just suggested. It suggests a "move by" relative rather than a "move to" absolute.

orangemittens
13th Sep 2011, 11:41 PM
You're right orangemittens about stable and S3PE test version, I've and use the latest test version because I find very practical the functions 'Export To s3asc and Import From s3asc' instead the old Export and Import functions. And these 2 news functions even in the test version always worked well and fine for me.

I keep and work with this test version because I do not really believe that there is any close relation with the fact that I don't be able to set the right size and position of object's shadows and the fact that S3PE is a test version !!!

Right... I test and try further... Soon or later some lights will come to light my darkness...

nice day and so long.As long as you're using the specific version of s3pe you're using no light is gonna come and make your sunshadow show up...that one has this known sunshadow problem...believe it or not as you wish ;)

The current stable version of s3pe allows export and import from s3asc just as the test version does. I suggest you use that or get the latest test version which doesn't have the same sunshadow issue the old one you're using does.

WesHowe
14th Sep 2011, 01:53 AM
The centre of my mesh? One edge of it? I think I would also have the same question if I read an offset from the data you have just suggested. It suggests a "move by" relative rather than a "move to" absolute.

All positions are relative to something. In a 3D editor, that is relative to the "origin", at 0,0,0. When the mesh is placed in the game, that origin is repositioned to a new location, and each vertex now has a position equal to the world position + local position. You don't do anything different at the modeling stage, the transformation is done at run time.

The so-named "mirror position" (I think atavera documented that) look to me like a vector/distance to the sun shadow, and I suspect the impression that it is a mirror vector is the result of swapped Y and Z component values in the vector.

The sun shadow mesh itself is just a copy of the main mesh, reduced to a single group, repositioned and stored without normals, UVs, assignments, weights; and shaded with a semi-transparent gray shader instead of a texture. It is apparent that since TSRW can recreate sun shadow meshes that the proper angle and offset for the shadow mesh has to be accessible somewhere.

At any rate, I don't plan on researching this further, although that is the type of thing I always enjoy playing with in the past. However, I have too many other irons in the fire, so to speak, and will pass on this one.

<* Wes *>

BloomsBase
14th Sep 2011, 07:21 AM
Figured it out but no idea when to write a tutorial.....

I discovered that every EA shadow mesh is positioned on X-1, Y-1 and Z-1.


Ill try to explain how to create the height:

* first create a reference floor at Y-1(or use the bottom of a original EA shadow mesh as reference)
* Select your mesh and duplicate it
* The duplicate gets autoselected
* Go to Model/Move and choose ABSOLUTE at the move options(no need to fill in any values)
* Hit the move button(your mesh jumps with its centerpoint to X0, Y0 and Z0)
* Go to scale and choose Origin at the scale options
* Now Take a look at your mesh, when done scaling its bottom needs to fit the Z-1 floor.
Determine wether your mesh needs to be scaled bigger or smaller and fill in a correct scaling value in the Y box at the scaling options.(1.01 for bigger and 0.99 for smaller)
* Start scaling till the bottom of your mesh hits the Y-1 floor, then your done.

This is how you do the height

The scaling on the Z axis is pretty much the same, you create a reference wall at Z-1
After you have moved the mesh ABSOLUTE to 0,0,0(no need to do it when you just finished the height!!) you scale the side of the mesh till it hits the Z-1 reference wall
If you do this with a lamp or small object it becomes bigger but a car gets really small :)
Same story for the X axis, create a wall at X-1 and scale the object till it hits that wall.


The height and sides can be done in side view while the front/back can be done in top view

Inge Jones
14th Sep 2011, 07:49 AM
I am afraid I still don't understand which bit of my mesh to move to that location. Assuming I have a huge cube. Corner A is at -2,0,-2, the opposite corner is at +2, +4, +2 - ie it's four tiles high by four tiles wide. Where is my cube? It's at 0,0,0, and it's at 1,1,1 and it's at 2,2,2 and so on - it is on all those places because it is large. If I move it so it is "positioned on X-1, Y-1 and Z-1" as per your guidance, where is Corner A now? See your instructions are actually very clear and seem logical while I am reading them, but when I come to apply them to my more-than-one-tile object, I don't know what to actually do! :) Are you actually saying I should get the bit of my object that is on 0,0,0 of Milkshape's grid onto -1,-1,-1 of Milkshape's grid? This is what I would call moving relative. If not, I am really stumped as to *what* exactly to move to -1,-1,-1

BloomsBase
14th Sep 2011, 08:04 AM
you move the mesh absolute(with its own centerpoint) to X0, Y0 and Z0
But its good possible that a cube(box) is already positioned at that spot. ;)

Origin is part of the scaling in MS, if you scale from Origin the scaling is done from X0, Y0 and Z0(instead of scaling from the mesh its centerpoint)

I try to write a tutorial with screenshots Inge, my english is very limited to give a proper explanation

Inge Jones
14th Sep 2011, 08:12 AM
So just to check I have understood you properly, in the the case of example cube above, moving it to 0,0,0 would mean it would stay where it is in X,Z space, since it was already centered on that intersection, but become lower in the Y direction?

BloomsBase
14th Sep 2011, 08:13 AM
yes, it will only drop
Next step is to see were the bottom of your cube is located now.
Is it below Y-1 or above Y-1(or when it was 2x2x2 originally it is already at Y-1)


If its below -1 you scale your object smaller till it hits Y-1 or when the bottom of your object is above the Y-1 reference floor you need to scale it bigger till it hits Y-1
The scaling however is done from Origin(X0Y0 and Z0) NOT from the centerpoint of the mesh(wich is often the default setting)

I tried this with:
outdoor lamps
fuelpomp
cars
footballtable
All these meshes had diffrent shadowmeshes, bigger, taller or smaller as the original mesh but i was able to recreate(and position) new shadowmeshes from the original base mesh with the above methode


Edit,

I have to be honest here, i have it working for the height but still strugling how to scale them from scratch for a proper width.

Positioning your shadow mesh is pretty easy, i included a template that you can use.
Your new shadow mesh must be positioned at X-1, Y-1 and Z-1(against the reference walls and floor)
The template includes several gamemeshes(with its shadow)
All of them are positioned the same, just the scaling seems diffrent when it comes to the width(the heightscaling is the same for all meshes, explained in post 21)

Inge Jones
14th Sep 2011, 09:07 AM
Thanks, I think I can probably (hopefully) work with this now :D

BloomsBase
14th Sep 2011, 10:54 AM
Found it :)

Duplicate your mesh
Scale the whole mesh 200% bigger(X2, Y2, Z2) scaled from origin X0, Y0, Z0
Move it absolute to X0, Y0, Z0(your mesh jumps with its centerpoint to X0, Y0 and Z0)
Now you need to line up the back of the mesh with the backwall, the right side of the mesh with the right wall and the bottom of the mesh with the floor, simply by moving it BUT do not move it if the mesh exceeds the wall or floor already
You then FIRST scale the necesarry Axis back till it hits the reference wall/floor X-1, Y-1 and Z-1( scaled from origin X0, Y0, Z0)

Here is the tutorial:

http://www.modthesims.info/showthread.php?p=3643460&posted=1#post3643460

zano972
14th Sep 2011, 07:45 PM
Hi BloomsBase,

Great job and thank you again. I read your tutorial "Creating a shadowmesh" with attention and of course I tried to make as explained... But with my really big object, I don't understand how can I fit a normal objet (in MS 3D: 512px width - (2 x grid steps - and 2304px height - 9 x grid steps -) after scaling this big object X2 Y2 and Z2, in a 2x2x2 box ??? Without being obliged to reduce the scale down ??? :blink: :blink: :blink:

...And in that case the first scale X2 Y2 Z2 is useless!

I show you some pictures:

The normal column following by the X2 Y2 Z2 scaled column:

If you want to test it here is the obj object:

BloomsBase
15th Sep 2011, 04:41 AM
You are right that if the object exceeds the box on all levels before starting the 200% scaling is useless.
Just move the colum absolute to 0,0,0 and scale it in the box :)
I included your file with shadowmesh if you cant figure it out.

Take a look at the military tower.
It is a 6x6x17 tile object but look how its shadowmesh is squized in.

http://thumbs2.modthesims2.com/img/3/4/2/2/9/7/2/MTS_BloomsBase-1233160-mil.jpg

http://thumbs2.modthesims2.com/img/3/4/2/2/9/7/2/MTS_BloomsBase-1233161-mil2.jpg

zano972
17th Sep 2011, 11:55 AM
Hi BloomsBase

Thanks a lot for your help. It doesn't work with my column but please don't spend more time about this little problem.

nice day and so long.