Jump to content

SpiderPig

Developers
  • Posts

    2,282
  • Joined

  • Last visited

Posts posted by SpiderPig

  1. How do games mange the texture resolution that's used in game?  In the options menu you sometimes have the ability to change the texture detail from Low to High.  I guess all it's doing is using a different resolution per setting.

     For example;

    • LOW 512x512
    • MEDIUM 1024x1024
    • HIGH 2048x2048
    • ULTRA 4096x4096

    I'm wondering if it's possible for everything to have 4K textures, but maybe on game load / restart you could remove the higher resolution mip-maps via code depending on the setting?  Surely they can't have 4 copies of each texture, that'd be an insane hard drive guzzler.

  2. 6 hours ago, Josh said:

    Yes, I always forget which is which. Maybe these should be ScreenToWorld and WorldToScreen?

    Yeah, in one of my projects I made a wrapper for them.  I called them CastToScreen and CastToWorld.  Naming them to show what they do will help.

  3. This may be silly but I'm constantly forgetting which function does what when it comes to the camera functions Project() & UnProject().  It might be helpful if the first argument of both commands were renamed to "Vec3 &screen_position" & "Vec3 &world_position" respectively.  That way it be easy to identify what does what! :D

  4. Hmm it crashes with an out of memory range error.  My class inherits Object so the function is available and compiles.

    void NotificationManager_UpdateHook(shared_ptr<Engine::Object> source, shared_ptr<Engine::Object> object) {
    }
    ...
    void NotificationManager::Init() {
    	AddHook(HOOKID_UPDATE, NotificationManager_UpdateHook, Self());
    }

     

  5. I'm using the latest steam version on the dev branch and get the error popup "Invalid function syntax fot hook ID 2".  This is my code.

    void NotificationManager_UpdateHook(shared_ptr<Object> object) {
    }
    ...
    void NotificationManager::Init() {
    	world->AddHook(HOOKID_UPDATE, NotificationManager_UpdateHook, Self());
    }

    Based on the parameters for AddHook() my function syntax looks correct... and HOOKID_RENDER works.

  6. Here's a few videos I've found on how to deal with animated objects in blender.  Specifically transforming them to new locations, and scaling an armature with animations.  (Like from mixamo)

    In this video the only thing that needs to be done different for armatures with animation tracks, is instead of going "Ctrl+A->Apply Transformations".  Go "Ctrl+A->All Transforms to Deltas".  This will scale the keyframes for the animations as well.

     

    • Like 2
  7. There is a local matrix that has the bones position local to its parent.  I've since disabled converting the matrices to Y up so I'm left with raw blender data.  I think I understand what's going on now.... we'll see.

  8. I don't quite understand the exactly what's needed in the bone data.  I think that's the only issue I have left.

    This is going to be hard to explain, so bare with me.

    I understand that both bone position and rotation should be local to their parent.

    What I was doing is getting the local bone position like this.

    bone_local_pos = bone.global_position - bone.parent.global_postition

    However that only works if the quaternions are left as this.  I knew from the start this probably wasn't correct.

    quat.x = 0.0
    quat.y = 0.0
    quat.z = 0.0
    quat.w = 1.0

     

    I think what I need to is rather than setting the bone position to the "yellow dot" relative to the "red dot."  I need to calculate the "blue dot", and then the "quaternion will be the "orange angle".

    The "blue dot" will basically be the normal the parent bone is pointing * the length of the child bone.

    This is the only way I see Ultra being able to give the correct bone position with bone rotation.  Am I on the right track or have I utterly confused you? :D

    BoneStuff.png.0667e7caba068506678683c44e17dbff.png

  9. @Josh I'm giving animation a go and just need to confirm a few things to help me debug;

    In LoadBone(), is the bone position;

    • Global coords
    • Local to skeleton
    • Or, Local to the parent bone

    Is bone->quaternion;

    • The rotation of the bone toward the position of it's child?
    • For example, blender only stores the tail and head positions of bones when they are created. No matter the direction the bones are facing when they are created, they have a rotation of 0 on all axis.

    E.g. All the bones in this shot have a rotation of 0 an all axis;  Do I need to calculate what these rotations would be for Ultra?

    1247237492_BoneRotation.png.181fcac95358b74b495dc9c00f0d78b3.png

    You are correct.  Animation is hard.

×
×
  • Create New...