### First person legs and body

Level design, models, animations, physics, etc.

#### Re: First person legs and body

marauder2k9
Posts: 318
Joined: Wed Feb 18, 2015 7:36 am
the arms are actually coming from the first person model for each weapon that u make, the client/player sees the usual first person model file and the third person model file without arms or head, u only have to make accurate reload animations for the first person meshes and not the third person mesh. the third person mesh that will be used for first person body will only need ur basics eg: walk run jump land look etc etc no weapon animations then a separate 3rd person mesh would be used for what the server/multiplayer sees. this is the one that would need to be used for shadows as well otherwise your shadows will have no head or arms lol i think this is similar to what the likes of battlefield uses. Accurate reload animations for every weapon in a third person mesh are rare and also expensive to have. Best to use simple ones and keep expensive ones that can be re-used for your fp arms meshes

#### Re: First person legs and body

marauder2k9
Posts: 318
Joined: Wed Feb 18, 2015 7:36 am

The result, and problem, shadow needs 2nd lod not 1st anyone know how to change this?

This was just a quick edit of the soldier model to remove arms nothing else just to illustrate how it could be pulled off

#### Re: First person legs and body

Duion
Posts: 1398
Joined: Sun Feb 08, 2015 1:51 am

You probably will need some coding skills for changing the shadowcasting that it will use the third person model for first person shadowcasting.

The easy solution is to just turn it off.

#### Re: First person legs and body

marauder2k9
Posts: 318
Joined: Wed Feb 18, 2015 7:36 am
i original thought this would be something to do with it \$pref::PSSM::detailAdjustScale = "0.85"

but ive changed the value a few different times and im not seeing much difference each time

#### Re: First person legs and body

Azaezel
Posts: 473
Joined: Tue Feb 03, 2015 9:50 pm

You're looking for what's touched by https://github.com/GarageGames/Torque3D ... 3db7a637ca though I do have to say at this point, I'm not quite following what it is you're going for here...

#### Re: First person legs and body

marauder2k9
Posts: 318
Joined: Wed Feb 18, 2015 7:36 am
It will become clear when i get it working, the idea is simple, u have 3 meshes, a high poly realistic first person hands mesh and a first person body and legs mesh as seen in the screen shot. but i want shadows to see a separate mesh, i was trying to set it up so it could be done with LOD's though but i dont think that is going to work.

1st LOD = 1st person body and legs
2nd LOD = 3rd person mesh, what the shadowpass and server sees.
then all LOD meshes after this will be as usual

I think that link you shared may be a good place to start, might just take an extra bit of code to read shadows from a separate mesh (wouldnt it be great if it was that easy =/ )

#### Re: First person legs and body

marauder2k9
Posts: 318
Joined: Wed Feb 18, 2015 7:36 am
anyone know how to add a another image index to the shapeimage.cpp file successfully?

#### Re: First person legs and body

marauder2k9
Posts: 318
Joined: Wed Feb 18, 2015 7:36 am

Code: Select all

U32 ShapeBase::getImageShapeIndex(const MountedImage& image) const { U32 shapeIndex = ShapeBaseImageData::StandardImageShape; const ShapeBaseImageData* data = image.dataBlock; if (data && data->useFirstPersonShape && isFirstPerson()) shapeIndex = ShapeBaseImageData::FirstPersonImageShape; if (data && data->useShadowShape) shapeIndex = ShapeBaseImageData::ShadowImageShape; return shapeIndex; }

so far i have this, it seems to work correctly, i have streams set up to suit, header files set up correctly aswell, i think the problem lies here

Code: Select all

for (U32 i=0; i<MaxShapes; ++i) { // Shape 0: Standard image shape // Shape 1: Optional first person image shape // Shape 2: Optional shadow shape StringTableEntry name; if (i == FirstPersonImageShape) { if ((useEyeOffset || useEyeNode) && shapeNameFP && shapeNameFP[0]) { // Make use of the first person shape useFirstPersonShape = true; name = shapeNameFP; } else { // Skip the first person shape continue; } } else { name = shapeName; }
Every time i try to add another statement to this for the shadow file, it still builds but u get really bad result.

In player.cpp i have this

Code: Select all

if ( state->isShadowPass() ) { // Force the shadow image shapes for the shadow pass. imageShapeIndex = ShapeBaseImageData::ShadowImageShape; }
which is just a modification of the code that was already there to use my new image index

#### Re: First person legs and body

marauder2k9
Posts: 318
Joined: Wed Feb 18, 2015 7:36 am
Tried this again last night with a fresh version of torque to see if there was something i missed and i think i forgot to add the resources code into shapebase.cpp aswell. Just out of curiosity has anyone messed with the shape indexes before? anything i should know about like for example should all meshes be a lower index than the fp arms mesh for a reason or is that just coincidence?

#### Re: First person legs and body

marauder2k9
Posts: 318
Joined: Wed Feb 18, 2015 7:36 am
Okay i think i have this finally working, attached to this post is how most devs do first person models for their characters. You see no torso up until the point the player can see

Screenshot from alien isolation.

The problem i was having before was that with a mesh similar to this it was only rendering a shadow for the arms legs etc, the 2nd lod of the model (the one used for 3rd person) had everything in the model and i wanted the shadow to come from that instead. Now i am able to do this to some extent in torque but i have to use an alpha mask for the parts of the model i want hidden. So far its been the only way i can find to do it.

#### Who is online

Users browsing this forum: No registered users and 0 guests