Pages

Sunday, November 3, 2024

Foliage Wind

    I've finished adding wind to all of the foliage with pivot painter.





    Next, I'm going to sketch out some thumbnails for a full scene that I can build with these assets. My general idea is to keep the layout fairly close to this current scene, but add some wetland areas and a walkway. Building this scene should also be a great opportunity to practice with PCG and World Partition.

Sunday, September 15, 2024

Footprint Effect

     The footprint effect is functional now. There's still an issue where some of the prints appear in the wrong location while going up sloped surfaces. It isn't too noticeable from the player's perspective though, so I think it will suffice.

 

 

    To make the footprint textures, I basically added cubes around the feet in ZBrush and then applied a boolean to them.



    After that, I smoothed out some of the edges and then baked the imprints to a height and normal map.



    Since I divided the texture into quarters, I also used the flip book function in Unreal to make it easy to select each print based on a phase value.



    Next, I added anim notifies in the walk cycle for each frame where a foot contacts the ground.



    Finally, I added those anim notify events into the animation blueprint to trigger a spawn footprint event. This event creates a particle system and also spawns a decal.


 

    Aside from that, I also used a line trace to get the ground's physical material so I can select different effects and footprint materials based on the surface type.



    Once all of that was working, I realized that the physical material detection wasn't always the most accurate due to the relatively low polygon count of my landscape. To work around that, I made a footstep override volume. Basically, it allows me to set a specific physical material for the area within the volume, rather than pulling it from the landscape. It should also be useful in cases where there isn't collision available to represent the material, such as with decals.



    Now that I've got the footprints set up, I'm going to apply wind animations to the rest of the foliage.


Saturday, July 6, 2024

Turtle Textures

    Here's some progress on the turtle textures.


    I think they are at a decent point for now. I may try mirroring some of the UVs though to get some extra texture resolution. It depends on how noticeable the mirroring ends up being. Aside from that, I also set up an AI character for the turtle and added an animation where it goes in its shell when you walk close to it.

 

 

    Next I'm going make a footprint effect for the turtle and add wind to the rest of the plants that don't have it yet.

Saturday, June 22, 2024

Turtle Low Poly

    I think the low poly version of the turtle is about ready now. It currently has 5182 tris, which should be reasonable for its intended screen size. Aside from that, I also set up UVs and baked normals from the high poly version. This low poly version ended up being much easier to UV than the high poly version. The UV editor ran pretty slow when I was originally unwrapping the high poly, and it was also difficult to mark seams just because there were so many edges. 


   Next I'm going to start on textures and then project the skin weights to this new low poly version. I already tested it earlier, and it's pretty straight forward.




Tuesday, June 11, 2024

Turtle Animation Test

     I created a quick walk cycle to test out the rig.

 


 

    Overall the rig is fairly easy to animate with, so I'm going to move on to texturing next. I'm having a bit of trouble UVing this mesh due to its density. To make that easier, I'm going to try retopologizing so it has a lower polycount. I haven't used Maya's retopology tools too much before, but I'm finding them to be pretty intuitive and fun to use.

 

 

Starting to retopologize the shell.

        We'll see how this goes. Worst case scenario, I can set up the UVs in ZBrush instead. I'm hoping the retopolgy works out though. It should also help with performance since skeletal meshes can't use Nanite.

Sunday, February 4, 2024

Finding a Perpendicular Vector Using Dot Product

     While setting up a rig for the turtle, I decided to add IK/FK snapping functionality to help with animation. To set this up, I needed a way to calculate the pole vector for the legs when snapping IK to FK. I found this great tutorial by Greg Hendrix explaining how to do that. https://vimeo.com/240328348

    As I incorporated this into my rig though, I was confused on how he found the vector that's perpendicular to the middle joint. After experimenting with it, I found a different method that makes sense to me, so I want to record some notes on how it works.

     Basically, I needed this vector to help place the pole vector. With this vector, I could subtract it from the mid joint to get a new vector that's perpendicular to the IK line. This new vector could then be scaled depending on how far I want the pole vector to be from the mid joint.

    The first step was to find the length along the IK line up to the perpendicular point. I found this through calculating the dot product of the rootToMid line and ikLine. The important thing that I realized is that ikLine needs to be normalized for this to work. If I didn't normalize, it returned a length that was scaled by the ikLine vector. By normalizing ikLine, it gave the exact distance to the perpendicular point.

    In python, I wrote this out as follows.

 ikLineMidLength = rootToMid * ikLine.normal()

    After getting the length, I divided it by the ikLine length to get a scale value. 

ikLineScale = ikLineMidLength / ikLine.length()

    Finally, I multiplied the ikLine vector by the scale value to get a new vector at the perpendicular point.

ikMidVector = (ikLine * ikLineScale) + rootJntVector

    Here's the Python code that I used to find the perpendicular vector and place a locator at it's coordinates. After finding that vector, I also needed to offset it by the root vector. The initial vector subtractions caused everything to be relative to the origin, so it needed to be moved back to match the original joint locations.

import maya.cmds as cmds
import maya.OpenMaya as om

def addLocator(inputVector, inputName):
    cmds.spaceLocator( p=(inputVector.x, inputVector.y, inputVector.z), n=inputName )
    
# Joint Positions
rootJointPos = cmds.xform('rootJoint', q=True, ws=True, t=True)
midJointPos = cmds.xform('midJoint', q=True, ws=True, t=True)
endJointPos = cmds.xform('endJoint', q=True, ws=True, t=True)

# Joint Vectors
rootJntVector = om.MVector(rootJointPos[0], rootJointPos[1], rootJointPos[2])
midJntVector = om.MVector(midJointPos[0], midJointPos[1], midJointPos[2])
endJntVector = om.MVector(endJointPos[0], endJointPos[1], endJointPos[2])

# Distance Vectors
ikLine = endJntVector - rootJntVector
rootToMid = midJntVector - rootJntVector

ikLineMidLength = rootToMid * ikLine.normal() # Find the distance to the point on ikLine that is perpendicular to the midJoint.
ikLineScale = ikLineMidLength / ikLine.length() # Find the ratio of the perpendicular distance to the length of the ikLine.
ikMidVector = (ikLine * ikLineScale) + rootJntVector # Scale the ikLine by the ratio to find the vector at the perpendicular distance.

# Place Locator at Perpendicular Vector
addLocator(ikMidVector, "ikMidVector")

 

    Initially I had some trouble figuring this out. In particular, I was stuck on the mid length dot product until I realized that the IK Line needed to be normalized. Hopefully I can go back to this post if I ever forget how this works.

    Aside from that, I've also started on a script where you can provide 3 input joints and automatically place a new pole vector based on them. I'll make another post about that when it's ready.