Jump to content

SpiderPig

Developers
  • Posts

    2,271
  • Joined

  • Last visited

Everything posted by SpiderPig

  1. I recall you rotated six terrains to make a cube, then used a vertex callback to position all the vertices at a constant radius from the centre. Or has this changed?
  2. Wouldn't this break the idea of making sphereical worlds?
  3. I can convert the local matrix to a quaternion. I've been looking over the Leadwerks mdl exporter too, although half the stuff no longer works the same in blender 4.0.
  4. 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.
  5. 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?
  6. No it appears to be random. I just clicked this Grass folder and it only generated three of six. It's not animated. Grass.zip
  7. I'm seeing a few thumbnails not being rendered. From DDS, GLTF and MAT to MDL. Here's one of the files (converted from fbxtomdl.exe) that does not have a thumbnail. G3D_Tests.zip
  8. Click view->show skeleton and there is no skeleton visible. G3D_Tests.zip
  9. Updated. Improved speed when exporting large amounts of vertices.
  10. Thanks. Bone positions the same? Local to parent?
  11. @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? You are correct. Animation is hard.
  12. Okay, let me know when it's done and I'll get blender to export it.
  13. Interesting! I havnt looked at embeded colliders yet. Is the data the same as the external collider? With the json then the binary?
  14. My character has a basket attached to the hand bone, when he walks / runs the basket goes on a wild ride. Is it possible to change the strength the animation has on the hand bone so that the arm doesn't swing as much during a run? I was thinking I'd have to set the strength per bone up to the shoulder, so the shoulder remains at 1.0 and the hand goes down to 0.1 or something small.
  15. Updated download. Works with 0.9.6 Fixed a bug where saving a child's position was global instead of local
  16. Why is the stride now 88? I don't see any extra information saved, is it for future development?
  17. Just a minor error in the loader. If the stride is wrong it gives the wrong info. if (vertexstride != 88) { Print("Vertext stride must be 84"); return false; }
  18. Download updated with support for exporting children. Only need to select the root object. All child objects will automatically be exported if they are parented to the root object and export option "Export Children" is set to true. Empties can also be exported as a child. Ultra treats them as a Model without LODs / Meshes.
  19. No thumbnails are rendered for the new MDL format in the editor. Do you need a model to try with or do you have one already?
  20. Been working on this exporter for Blender 4.0 during the latter half of this week. It's not fully completed yet but I kind of need feedback now to see where it can be improved. io_mesh_ultra_v020.zip Things left to do: Embeded Colliders Calculate & Export Tangents & BiTangents Animation Issues: Won't export a mesh that has no material assigned These are the current default settings: Export Position False (Default) - will not export the objects position. This will be exported as 0,0,0 True - will export position Use Object Name False (Default) - Uses the file name written in the file save dialog to name the exported MDL file True - Uses the object name in blender as the MDL file name Export LODS True (Default) - will search the scene (selected objects or not) for any LOD objects E.g. If you select a model named "Cube", it will search for and export objects that are named; "Cube_LOD1" "Cube_LOD2" etc... False - Does not export LODS Export Collider True (Default) - Searches the scene for an object with a suffix of _PHY E.g. If you select a model named "Cube", it will search for an object named "Cube_PHY" and export that mesh as a collider file. (Embedded colliders coming soon) False - Does not export Collider Convert Textures This is a WIP. It should work, but it is slow sometimes depending on how many and how large your textures are. So if blender hangs and goes non responsive for a few minutes that could be why. False (Default) - will copy textures that the blender materials use to the target directory where you have specified to save the MDL file too. True - Will first convert any non DDS files to DDS with the correct compression, saving them in the same folder as the source image, before then copying the new DDS file over to the target directory where you have specified to save the MDL file too. All DDS file are renamed to the material name appended with the appropriate slot name E.g. If the material name is "Cube" Diffuse textures will be named "Cube_DIFF.dds" Normal textures will be named "Cube_NORM.dds" Ambient occlusion, roughness and metalness maps will be combined into one DDS file name "Cube_AO_ROUGH_METAL.dds" Ultimate the only object you need to select when exporting is the root object. E.g. the LOD0 object. Doesn't currently work if the root object is named LOD0 though. Has to be "Cube" not "Cube_LOD0". I can add support for this if it's needed. You can also batch export be default. All you need to do is select all the root objects that you want to export and it will export them all to the same folder. Best to set "Use Object Name" to true when batch exporting other wise the file names will conflict and each selected object will just overwrite the previous one. Materials are exported to the same directory as the specified MDL path. Here is the only node setup that will be able to collect and export the textures. Please excuse the low resolution image - not sure how I can get blender to render to an image larger than the screen! I'll add some better images later. You don't need all of these images loaded to export the material correctly. From top to bottom on the left hand side, DIFFUSE, AO, METAL, ROUGH & NORM. Love to hear feed back with this and thoughts on how it should be improved! I have had MDL files straight from Blender working in the editor
  21. Maybe I've missed something, but I've made a blender exporter that removes all double vertices of the mesh. So there are 590 vertices in the mesh. But by doing so, there are several areas where the UV coords are off because of the way the model is unwrapped. Here you can see the texture's are compressed / stretched in certain places. More noticeably on the stump. This is because the cylinder is unwrapped and stretched across an image, so the same vertex can have multiple UV Coords. Here's how it's unwrapped in blender. The only way I can correct it is to double the vertices where the UV Coords are different. But of course, I get lots more vertices. It seems a shame to create so many extra vertices just to get the UV Coords working correctly. But, it is what it is. I've never noticed it before but all models that have UV coords must have many extra vertices just to get the unique UV coords. Unless there is something I've missed and there is a way to use the second UV Coord set? I don't see how though, as the shaders would have no way of identify which coord set it should be using. The only way to reduce vertex count would be to create a better UV map that has faces joined together as much as possible.
  22. Oh I see, so just give the texture to both slots. Yeah like you said, the only thing I don't like about that is the extra texture sample as TEXTURE_METALLICROUGHNESS already has the AO sampled in mrSample.r.
  23. To test it I did this. ambient_occulsion is 1.0f by default. #ifdef MATERIAL_METALLICROUGHNESS //-------------------------------------------------------------------------- // Metallic roughness //-------------------------------------------------------------------------- materialInfo.metallic = material.metalnessRoughness.r; materialInfo.perceptualRoughness = material.metalnessRoughness.g; if (material.textureHandle[TEXTURE_METALLICROUGHNESS] != uvec2(0)) { // Roughness is stored in the 'g' channel, metallic is stored in the 'b' channel. // This layout intentionally reserves the 'r' channel for (optional) occlusion map data vec4 mrSample = texture(sampler2D(material.textureHandle[TEXTURE_METALLICROUGHNESS]), texcoords.xy); ambient_occlusion = mrSample.r; materialInfo.metallic *= mrSample.b; materialInfo.perceptualRoughness *= mrSample.g; } materialInfo.perceptualRoughness = clamp(materialInfo.perceptualRoughness, 0.0f, 1.0f); materialInfo.metallic = clamp(materialInfo.metallic, 0.0f, 1.0f); // Achromatic f0 based on IOR. materialInfo.c_diff = mix(materialInfo.baseColor.rgb, vec3(0.0f), materialInfo.metallic); materialInfo.f0 = mix(materialInfo.f0, materialInfo.baseColor.rgb, materialInfo.metallic); #endif I only use it if there is no AO map specified. if (material.textureHandle[TEXTURE_AMBIENTOCCLUSION] != uvec2(0)) { float ao = texture(sampler2D(material.textureHandle[TEXTURE_AMBIENTOCCLUSION]), texcoords.xy).r; f_diffuse *= ao; // apply ambient occlusion to all lighting that is not punctual f_specular *=ao; f_sheen *= ao; f_clearcoat *= ao; } else{ f_diffuse *= ambient_occlusion; f_specular *= ambient_occlusion; f_sheen *= ambient_occlusion; f_clearcoat *= ambient_occlusion; }
×
×
  • Create New...