It is currently Fri Mar 29, 2024 10:55 am


Bug: Leafs from Mesh Layers are not exported double sided

Any thing to do with Tree It, post and read about it here.
  • Author
  • Message

nlcoaster

  • Posts: 5
  • Joined: Sat May 01, 2021 5:02 pm

Bug: Leafs from Mesh Layers are not exported double sided

PostSat May 01, 2021 5:30 pm

When a tree that contains mesh layers is exported, the leafs from mesh layers are single sided only in the exported files, even if the mesh layers are supposed to be double sided.

They are displayed double sided in Tree It, but are exported single sided, only.

I tested exporting .DBO files and .OBJ files where the mesh layers came from .TRE files.

When there are no mesh layers, the leafs are exported fine with triangles for front and back sides.
User avatar

EVOLVED

Site Admin

  • Posts: 72
  • Joined: Wed Mar 05, 2014 7:52 am

Re: Bug: Leafs from Mesh Layers are not exported double side

PostMon May 03, 2021 11:18 am

I did some messing about and it seems to be working as it should.

just be aware that double sided when checked is referring to the use of double sided rendering when only one side of the leaf face is created with back faces then drawn with culling mode disabled.

nlcoaster

  • Posts: 5
  • Joined: Sat May 01, 2021 5:02 pm

Re: Bug: Leafs from Mesh Layers are not exported double side

PostMon May 03, 2021 2:08 pm

I understand, I misinterpreted what the double sided option is supposed to mean. Thanks for clearing it up.

Is that double sided or cull information somehow exported in the .DBO files?

I wrote my own .DBO file importer and there seems to be a Cull flag for each mesh (DBOBLOCK_MESH_CULL). Unfortunately, it is always exported from Tree It with a value of 1=TRUE, no matter what the double sided option in Tree It is set to. If the double sided/culling information is not exported, yet, I suggest that maybe that CuLL flag should be used for it, so that .DBO importers could automatically know if back face culling should be used or not.
User avatar

EVOLVED

Site Admin

  • Posts: 72
  • Joined: Wed Mar 05, 2014 7:52 am

Re: Bug: Leafs from Mesh Layers are not exported double side

PostFri May 07, 2021 8:39 am

This is a good idea to actually have the correct cull flag for exported dbo objects, so in the next update I shall see if I can get this in.

nlcoaster

  • Posts: 5
  • Joined: Sat May 01, 2021 5:02 pm

Re: Bug: Leafs from Mesh Layers are not exported double side

PostFri May 07, 2021 12:51 pm

Excellent, that would help to improve importing .dbo files and conversion a lot.

My .dbo importer, right now, is also not able to detect automatically if a mesh should be shaded with a leaf shader or tree shader. It would be great if the material bytes in the .dbo file could also include that information, somehow.

I noticed an issue/bug that makes some trees to not export correctly. It happens for exporting the 'Old.tre' tree. This tree makes use of the same diffuse texture for both leafs and stems, and both parts will be exported as one single material and mesh only. I checked .dbo and .obj exports. This is problematic, because the leaf material and stem material are most likely shaded with two different shaders. I suggest that when there are shared textures between stems and leafs, that those should be exported as separate materials.
User avatar

EVOLVED

Site Admin

  • Posts: 72
  • Joined: Wed Mar 05, 2014 7:52 am

Re: Bug: Leafs from Mesh Layers are not exported double side

PostSun May 09, 2021 7:42 pm

Just made an updated, the cull flag should now be set on dbo exports. Also set the transparency flag for leaf and meshes with alpha testing, hope you can some how make use of this as a means to differentiate between leaf or tree shader.

The Old.tre sample has an atlas map applied (not sure why, must of used the sample at some point to test atlas on export and forgot to remove it). there is now a clear texture atlas button under "tree" that becomes enabled when texture atlasing is in use, if you remove the texturing atls the exported model should now be separated and constructed of 3 submeshes.

nlcoaster

  • Posts: 5
  • Joined: Sat May 01, 2021 5:02 pm

Re: Bug: Leafs from Mesh Layers are not exported double side

PostThu May 13, 2021 12:33 pm

Nice! The cull and transparency flags work perfectly in the new version. The .DBO files can now be imported into my engine without the need of supplying any additional info manually. This helps a lot streamlining the work flow.

Thank you very much!

Return to Tree It



cron