Game Development Community

.DAE Trees Not Rendering Correctly

by Joshua Horns · in Torque 3D Professional · 05/06/2009 (5:09 am) · 33 replies

****Update... I made my own tree model with similar complexity and it didn't have the artifacts. It's odd that the problem doesn't manifest itself in other viewers but I'll chalk this one up to me and bad geometry.

This is just a proof of concept tree so it doesn't look that great... I'm just happy it works.

www.joshuahorns.com/T3D/FirstTree.jpg

****One more set of trees. I will say it's not exactly drag and drop easy to use collada but it does work really well once I edit the file produced by xsi.

www.joshuahorns.com/T3D/PineTrees.jpg****EndUpdate

I am using some tree files which I bought and converted from .obj to .dae files using XSI 7.

When I add them to my scene in Torque3D The trees come in fine (geometry) but the model is completely gray and no materials or leaves are rendered.

I cross-checked that the export was fine by importing the .dae into XSI and doing a render preview (the exact same file I am using with T3D). When I do that all of the materials etc are there.

After taking a second look at the render in T3D it looks like the geometry is messed up. What version of collada is required? For the life of me, I haven't been able to get a DAE to load correctly.

**I just used SwirlX3D (free collada viewer) and the geometry looks fine in that program. At this point I am convinced something's weird with the collada importer in the engine.

**To be honest it looks like the engine is importing as triangle strips because pieces of geometry are connected that should not be. That's just an off the wall guess though, based my own mistakes in the past while rendering primitives for school projects.

**I did use the triangulate method when exporting - fyi.

Windows Vista Ultimate x64
ATI 4870x2
Core i7


Page «Previous 1 2
#1
05/06/2009 (5:54 am)
This is where something like this might be a nice tool to have. Particularly for artists, with this exact problem.

www.garagegames.com/community/forums/viewthread/90927

This is a case where sure a person can check the DAE file in several common viewers, but having a dedicated viewer to view say a kits contents, or to browse a persons own list of items in his folder, before having to move it into his project (potentially creating clutter, forgeting about it at later versions, ect.). Showtools would prevent all of these issues. Its worth updating.
#2
05/06/2009 (6:21 am)
Have a try messing with the transparency material settings in the Materials Editor, see if you can make it a little more easier to see what's going on with your model.
#3
05/06/2009 (6:42 am)
I'll try that. The thing is the branches of the trees are connected to other branches via weird triangle craziness.

I'll post pictures of all of this when I get home. My ability to re-create the situation with ascii art is insufficient.


** To give you a better understanding... It's like the branches have "webbing" in between them.
#4
05/06/2009 (11:27 am)
Logged as THREED-428
#5
05/06/2009 (12:13 pm)
I've run into this problem in older Torque Engines and they were always linked to one of the following:

- Missing texture file
- Non-supported texture file format
- Texture resolution mismatch (i.e. 900x900 rather than 512x512)
#6
05/06/2009 (12:55 pm)
Hmmm... But texture files shouldn't have an impact on geometry. At least I can't think of a reason why.

Also, I'm looking for an example .DAE file that shipped with the engine and I haven't been able to find one. They all seem to be .DTS files.

The thing that would be different about what I'm doing and what was done in older engines is that I'm using Collada and the older engine only supported DTS.

I can view them perfectly in XSI, and in a quick test before I left for work I was able to at least see clean geometry in that other tool I mentioned in my original post.
#7
05/06/2009 (1:07 pm)
The physx demo contains various dae models also the FPS genre kit in the art/shapes folder

they are thought mainly used for decorations / detail meshes, beside the undercity.dae
#8
05/06/2009 (1:50 pm)
www.bloodknightstudios.co.uk/t3d/Torque3d_Trees.pngThe tree models was exported from treemagic as a wavefront obj file

Imported into milkshape 1.8.4

The tree on the left is exparted DTS using the latest exporter from Chris Robertson with just the translucent flag set (notice some texture conflicts, also the branches are completely invisible from underwater and the branches dont actually cast shadows)

The tree on the right is exported using the milkshape default collada exporter, as you can see no texture corruption at all, and the tree is fully visible from underwater and cast shadows (nive ones too :) )

if you want the files to test with they are all here
http://www.bloodknightstudios.co.uk/t4d/testree.rar
the rar file contains all textures and .obj models exported from treemagic, the .dts file and the .dae file the cached dts file and the materials.cs

i hope that this stuff will help you better identify the problem :)
#9
05/06/2009 (2:02 pm)
Quote:Hmmm... But texture files shouldn't have an impact on geometry. At least I can't think of a reason why.

Texture files wouldn't have an impact on geometry, but you said the geometry shows up fine but the model is simply just gray; i.e. no texture is being displayed, right?

When a model is imported into Torque, it'll be a default gray color if no texture shows up for whatever reason.
#10
05/06/2009 (3:13 pm)
The model shows up gray in SwirlX3D with no textures. It is a ball of craziness in T3D, which I will now demonstrate via screenshots. (have to make the shots)



SwirlX3D - Viewer
www.joshuahorns.com/T3D/SwirlTree1.jpg
www.joshuahorns.com/T3D/SwirlTree2.jpg
XSI
www.joshuahorns.com/T3D/XSITree1.jpg
www.joshuahorns.com/T3D/XSITree2.jpg
T3D
www.joshuahorns.com/T3D/T3DTree1.jpg
www.joshuahorns.com/T3D/T3DTree2.jpg
#11
05/06/2009 (3:48 pm)
The triangles I circled in green.... those are artifacts. Something is amiss. Could be my fault but the other 2 viewers were able to show the model geometry just fine with the same file.

**BTW I've imported simple shapes like a sphere just fine. Seems like it's the complex stuff that fails.

**Just tried it again (exporting/importing) with normals and it clearly shows the issue.

www.joshuahorns.com/T3D/T3DTree3.jpg
#12
05/06/2009 (4:07 pm)
I have experimented a lot with converting all of my resources to collada almost without a hitch. Everything gets imported into T3D like it should be and no more pesky exporter troubles. Anyway I export it using FBX dae plugin exporter for MAX. There is also a standalone version of the converter you can download. Haven't tested it, but as indicated on the Autodesk page it is very similar to the plugin I'm using. You can find it at this address:
images.autodesk.com/adsk/files/fbx20100_fbxconverter_win.exe
#13
05/06/2009 (4:09 pm)
I'm using Crosswalk... I'll try your tool.

I tried 3dsMax 2009 exporter.. same issues. Dunno.

The tree file I'm using is free online and can be downloaded here if you are interested.

www.xfrogdownloads.com/greenwebNew/products/Version2/press.htm

Download the free sweet birch at the top. I chose the OBJ file.
#14
05/06/2009 (4:22 pm)
I did a quick test just now and it seems you can't convert to collada directly with this tool. There seems to be a workaround for this though, if you convert your file first to fbx then convert it from fbx to collada, that seems to work nicely.
#15
05/06/2009 (4:24 pm)
Yeah I ran into that issue... so I tried 3dsMax2009 because I have the academic. It did the same thing.
#16
05/06/2009 (4:31 pm)
Bummer... sorry if I wasn't of much help. Actually now when I think about it I think I've seen this thing in tgea with some DTS files, where triangle strips weren't exported correctly, so triangles became "extruded" when viewed in engine. I guess I can take a look at the code and see if that is the specific issue or maybe GG guys will fix before I find a fix :D.
#17
05/06/2009 (4:38 pm)
@Joshua, are you trying to use alpha blend on your leaf billboard material? Because that definitely won't work in Advanced Lighting. You'll need to set it up to use alpha test.
#18
05/06/2009 (4:48 pm)
Yup, definitely not a texture issue, Josh :)
#19
05/06/2009 (7:02 pm)
@Ross

I haven't really looked around the options. Could you tell me if there is a toggle or other GUI method to set the render state in T3D for that?

I think the alpha issue is secondary to the geometry problem, though.

*Edit - Uhh TorqueScript, I think. Sorry, still new to torque. I haven't set any materials for this model via script yet.
#20
05/06/2009 (8:25 pm)
On second thought I really have to scour the docs. A lot of info there I haven't looked at as far as blending goes. However, I think there still may potentially be a problem with the geometry. Not sure though.

**If you look at the picture above, the tree's branches are connected by triangles which are circled in green.
Page «Previous 1 2