Jump to content

SpiderPig

Developers
  • Posts

    2,261
  • Joined

  • Last visited

Everything posted by SpiderPig

  1. Updated. Improved speed when exporting large amounts of vertices.
  2. Thanks. Bone positions the same? Local to parent?
  3. @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.
  4. Okay, let me know when it's done and I'll get blender to export it.
  5. Interesting! I havnt looked at embeded colliders yet. Is the data the same as the external collider? With the json then the binary?
  6. 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.
  7. Updated download. Works with 0.9.6 Fixed a bug where saving a child's position was global instead of local
  8. Why is the stride now 88? I don't see any extra information saved, is it for future development?
  9. 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; }
  10. 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.
  11. 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?
  12. 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 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
  13. 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.
  14. 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.
  15. 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; }
  16. As per the workflow here I've create a AO_ROUGH_METAL map with AO in the red channel but it appears to not be showing up on the model when rendered. Looking at the PBR/Fragment.glsl shader it looks like AO is only being loaded from it's own dedicated slot. Is this intentional or can t be revised to use the red channel of the same texture that metal & roughness are in? 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; }
  17. This is working fine now with build 611.
  18. There is still some issues. Project is up to date. I've attached the map I used as well as the updated files. Extract the pine tree to the Models folder. As you move the camera away the billboard stage has no material applied. Yet if you drag LOD3 into the scene it does and it's shadow casting is correct, yet as part of the main model it is not correct. You'll also notice that changing the shadow casting of LOD3 only sometimes updates the editor straight away. Also, not saving a model will still save it. After a bit more playing around I'm finding changing the shadow casting of LOD3 is not even updating the editor at all no matter what I do. I think if you play around with the attached map you should find a few things not working like they should. Pine.zip PineLeaves_DIFF.zip
  19. This was a while ago, but I'll check again today.
  20. Thanks, I just figured it out. I just needed to add a line to an existing file. auto stream = OpenFile(path + "\\Game.log"); if (stream != nullptr) { auto pos = stream->GetSize(); stream->Seek(pos); stream->WriteLine(line.ToString()); stream->Close(); }
  21. Is there an AppendFile function or similar available?
  22. No banding in that map. Not in the editor or in game. I re-enabled shadows on that spotlight and there's banding in editor and game.
  23. I'll make an example for you. 🙂
×
×
  • Create New...