Applying texture image to object shader causes Terragen to crash

Started by DMFW, November 18, 2020, 10:00:08 AM

Previous topic - Next topic

DMFW

Just reporting a repeatable bug which reliably crashes Terragen. I've created a simplified scene which is sufficient to demonstrate the issue. I am using Terragen 4.4.67 which I believe is the last stable version.

Steps to reproduce:-

(1) I loaded a free object model downloaded from Turbo Squid (obj file) as per the attached scene. I am unable to attach the actual object file due to forum upload restrictions but if required it can be found here:-

https://www.turbosquid.com/3d-models/3d-ship-pirates-1473574

The textures failed to link for whatever reason (that was probably due to an invalid mtl file) and it isn't the issue I'm reporting. It shows up as an ObjReader error in the error window, which is fair enough. The problem happens when attempting to apply changes to the texture shaders manually in Terragen as follows:-

(2)  Selected the shader for a material part as shown, and tried to apply a texture.
SelectingTexture.jpg

(3) A short time after selecting the texture path (a matter of a couple of seconds or so) Terragen crashes completely. I don't think the exact image is critical or the specific shader, it seems to happen for all the related shaders in the same way on any image file.

I have had similar problems to this with other models when applying texture files as well, at the point of manually texturing them and I think a work around is to create a new shader.

I am viewing the object only as a bounding box at this stage so I am not expecting a refresh in the preview window but the crash isn't instant, suggesting it occurs at the end of some kind of update/refresh processing.

Dune

First of all the ship doesn't seem to have normals. I think you should take it through Poseray and adjust some things first. Maybe that already helps.

sboerner

Textures load fine here, though the model's uvs haven't been properly mapped so it looks a bit wonky. What sort of file are you trying to load? Windows or Mac?

DMFW

Thanks for the suggestions and the experiment! It's interesting that it can be done, so that suggests something that may be specific to my set up. 

I am working on Windows 10. I found texture files with the download which I assume were meant to be linked via an mtl file (or just manually) and I figured I could link them myself after the import. They are jpg files and seem perfectly OK when opened in other applications (as simple jpg files I mean, I don't know whether there might be something pathalogical about the UV mapping process with them). I've never delved too deeply into UV mapping so the possibility that the absence of normals might cause me an issue isn't something I've considered before. In any case, the complete crash to the desk top is a little unfriendly and I will be extra careful to save my scene before I try any retexturing like this in future!

In this particular case, the model was only going to be a very distant background object to lend scale to the scene. I found that I could apply a simple flat colour texture to each shader and that's actually fine for this usage, where the POV is not close enough to require better textures. I would like to find out a little bit more about what's going wrong here, though, just for future use, so I will try and come back to this, perhaps using Poseray or another import/export process.

I've learned that working with figures and exporting them as obj files for Terragen seems to work better from DAZ studio than Poser, with the latter exporting obj files that don't pick up textures, whilst the former works fine and successfully pulls together all the textures with the obj file. Again I am only doing this for distant tiny figures, so I am not too worried about texture fidelity but it is still nice when it works out of the box. Interestingly, DAZ Studio seems to offer a lot more control over the way the obj file is created than Poser does including an explicit option for the creation of normals which may account for the greater success I had using that export method.

sboerner

I missed the texture files on the Turbosquid website, but if they are jpegs they should load OK. When I get a chance I'll take another look.

Glad you are able to make it work. Besides flat colors, you can create more detailed procedural materials by mixing power fractals and other nodes and connecting them to the material's default shader. You can find many examples on this forum. This is a good place to start.

The model's normals looked OK when I looked at it in Blender, but maybe Blender fixed them during the import process. Simply importing obj files into other applications like Maya, Blender, or Poseray (as Dune suggests) and then re-exporting them can fix some issues, though sometimes you'll need to make a few tweaks. Poseray is free and can fix many mesh problems.

Free models usually have some issues. This looks like a nice one, though.

Good luck with your scene and please post a render.

cyphyr

I was able to load the model and swap images about with no issues.
The mtl file doesn't reference the images or texture channels at all so is serving no purpose I can see. Might as well delete it.

I did notice that the model took a very long time to load so in this instance I think there may be an issue with the model. If there is some kind of problem with the model (missing normals could be indicative) then this may explain the crashing (at least partially).

I agree with Dune  that loading it into PoseRay may well help. Alternatively, if you are already happy using DAZ maybe loading it into DAZ and re-exporting as an obj from there may be sufficient.
www.richardfraservfx.com
https://www.facebook.com/RichardFraserVFX/
/|\

Ryzen 9 3900X @3.79Ghz, 64Gb (TG4 benchmark 6:20)
Ryzen 9 5950X @3.4Ghz, 16Gb (TG4 benchmark 4:28)

Matt

Hi DMFW,

I am trying to reproduce this crash but so far I have not been able to.

Please try the following to see if it changes the behaviour:

1) Are you textures located in OneDrive? If so, try with textures on a regular drive path.

2) Try closing the shader preview (click the button with the blue square to the right of the "Add Object" button), and also close the main 3D Preview window.

3) Try loading these textures from the Node Network View rather than the node list.

Please let me know if any of those things help.
Just because milk is white doesn't mean that clouds are made of milk.