Jump to content

SpiderPig

Members
  • Posts

    2,285
  • Joined

  • Last visited

Posts posted by SpiderPig

  1. That would be good.  Something like Texture::RemoveMipMap() maybe?  Would also be cool if you didn't have to restart the game for it to take effect.  You would probably need access to a list of materials to loop through... maybe.  Or maybe the user should add there materials to their own list so they can identify what textures should be changed and what shouldn't be.

  2. SetFileTime() would be nice to have.  I want to be able to convert a file to DDS and then set the DDS file to the creation date / time of the source file.  That way when I run my converter again it won't re-convert the source file unless it is newer than the already existing converted DDS file.  :)

  3. 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.

  4. 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.

  5. 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

  6. 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());
    }

     

  7. 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.

  8. 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
  9. 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.

  10. 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

×
×
  • Create New...