www.tombraiderforums.com  

Go Back   www.tombraiderforums.com > Tomb Raider Modding > Tomb Raider Level Editor > Software Development

Reply
 
Thread Tools
Old 09-01-21, 14:28   #11
Bergus
Hobbyist
 
Join Date: Dec 2020
Posts: 52
Default

Thanks not Again!
It seems to me that the shine is stored using different materials. Since the same texture can be applied with multiple shine values to different faces of the same mesh, it is like having 32 different materials that differ only by some glossy parameter.

I'll see how to manage that. I think that applying different materials to different faces is quite painful to the object designer, I would rather have some friendly way to edit this property.

EDIT: I think it is the only way: when you open the wad, blender creates 32 materials with the the same uvs but different shine values. If some face needs shine, the proper material is applied.

Last edited by Bergus; 09-01-21 at 14:51.
Bergus is offline   Reply With Quote
Old 09-01-21, 15:27   #12
Zebra
Legend
 
Zebra's Avatar
 
Join Date: Jun 2007
Location: Germany
Posts: 26,357
Default

Quote:
Originally Posted by Bergus View Post
Thanks not Again!
It seems to me that the shine is stored using different materials. Since the same texture can be applied with multiple shine values to different faces of the same mesh, it is like having 32 different materials that differ only by some glossy parameter.

I'll see how to manage that. I think that applying different materials to different faces is quite painful to the object designer, I would rather have some friendly way to edit this property.

EDIT: I think it is the only way: when you open the wad, blender creates 32 materials with the the same uvs but different shine values. If some face needs shine, the proper material is applied.
Could you maybe use something like weights, vertex groups or vertex colours to store shine value variations? That would make them easy to edit and I believe vertex colours should also straightforward to integrate into materials so you could preview it properly in Blender without needing a bunch of materials.
__________________
Wozu zuhören, wenn man reden kann?
Zebra is online now   Reply With Quote
Old 09-01-21, 16:05   #13
not again!
Archaeologist
 
not again!'s Avatar
 
Join Date: Feb 2008
Posts: 1,042
Default

Ah, apologies, I think I worded my initial comment about OBJ being best for shininess confusingly. What I meant was that the Blender export script for OBJ is so far the only one that exports the new Principled BSDF shader in way that will give a model imported into WadTool glossiness.
Models exported as FBX or COLLADA appear matte in game no matter what shader settings are used. So basically if you want to have a model exported from Blender to have glossiness ingame you need to export as OBJ.
Personally I don't find it a problem if the shine attribute is not imported from the Wad, since it can be re-applied in Blender.

Last edited by not again!; 09-01-21 at 16:24.
not again! is offline   Reply With Quote
Old 09-01-21, 18:24   #14
Bergus
Hobbyist
 
Join Date: Dec 2020
Posts: 52
Default

Quote:
Originally Posted by Zebra View Post
Could you maybe use something like weights, vertex groups or vertex colours to store shine value variations? That would make them easy to edit and I believe vertex colours should also straightforward to integrate into materials so you could preview it properly in Blender without needing a bunch of materials.
I used vertex color to define the light map of statics objects since it is based on vertices. However, movables shine is applied to each polygon, and if you set the shine as vertex weights, the face would take the average of the vertex weights around it.

I'm thinking of adding a simple entry in the panel that you get pressing N, where you can select the shine when faces are selected. In this way there's no need for the user to mess with materials.

Quote:
Originally Posted by not again! View Post
Ah, apologies, I think I worded my initial comment about OBJ being best for shininess confusingly. What I meant was that the Blender export script for OBJ is so far the only one that exports the new Principled BSDF shader in way that will give a model imported into WadTool glossiness.
Models exported as FBX or COLLADA appear matte in game no matter what shader settings are used. So basically if you want to have a model exported from Blender to have glossiness ingame you need to export as OBJ.
Personally I don't find it a problem if the shine attribute is not imported from the Wad, since it can be re-applied in Blender.
Don't worry I just forgot about shine and wanted to figure out how to import it. Unfortunately TRLE is old, otherwise the correct way would be to make another image that maps the glossiness and assign it to the shader.
Bergus is offline   Reply With Quote
Old 10-01-21, 08:59   #15
not again!
Archaeologist
 
not again!'s Avatar
 
Join Date: Feb 2008
Posts: 1,042
Default

^^ Oh, good - I'm relieved to hear I did not accidentally waste your time.

Some more feedback and a potential bug report: the option to batch export models is truly a wild luxury after being used to the old time consuming workflows!
Batch exporting Statics seems buggy on my end though: a FBX file for each static object is created, but the files all have 4kb and are seemingly empty when trying to import them into Blender. Everything else (Lara and Moveables) exports fine, I tested with several of the original Core wads.
not again! is offline   Reply With Quote
Old 10-01-21, 17:53   #16
Bergus
Hobbyist
 
Join Date: Dec 2020
Posts: 52
Default

Quote:
Originally Posted by not again! View Post
^^ Oh, good - I'm relieved to hear I did not accidentally waste your time.

Some more feedback and a potential bug report: the option to batch export models is truly a wild luxury after being used to the old time consuming workflows!
Batch exporting Statics seems buggy on my end though: a FBX file for each static object is created, but the files all have 4kb and are seemingly empty when trying to import them into Blender. Everything else (Lara and Moveables) exports fine, I tested with several of the original Core wads.
Thanks, I'll look into it!
I almost finished with the shine. I wanted to ask, if you know, whether tomb editor is also able to import opacity/transparency. I think that the way to do in blender is to use the bsdf shader alpha parameter. For the shine I'm using the roughness (shine = 0 => roughness = max).

Last edited by Bergus; 10-01-21 at 17:56.
Bergus is offline   Reply With Quote
Old 10-01-21, 21:49   #17
not again!
Archaeologist
 
not again!'s Avatar
 
Join Date: Feb 2008
Posts: 1,042
Default

Yes, it's possible to import models into Tomb Editor / WadTool with transparency. Vertex colors also import fine into WadTool & Tomb Editor when the model is in either .fbx or .dae* file format.
Both transparency and shine work exactly as you described: by adjusting the Alpha and the Roughness slider of the BSDF shader.

Though as mentioned the Roughness value of the BSDF shader only carries over into the game as shininess when exporting as .obj
When exporting as .fbx (or .dae) the export scripts for those file formats apparently interpret the Roughness setting in a way that doesn't translate into in-game glossiness. None of the BSDF shader sliders that control specularity, sheen and reflectiveness have any effect in game when exporting as anything other than .obj
Transparency on the other hand does work with all three file formats.


* from the file formats that Blender can export without additional plugins OBJ, FBX and COLLADA are the three best supported for import into WadTool / Tomb Editor.

And thank you again for your amazing work!

Last edited by not again!; 10-01-21 at 21:59.
not again! is offline   Reply With Quote
Old 11-01-21, 19:28   #18
Bergus
Hobbyist
 
Join Date: Dec 2020
Posts: 52
Default

There is a new release (0.2) on Github

You can now import shine and opacity information. To edit their values, you need to go into edit mode and it will appear a Wad Blender tab into the panel that you get by pressing N. By selecting a face of the active mesh, it will appear a form where you can edit shine (0-31) and opacity (ON OFF).

There is also the possibility to batch export in obj format plus probably many bugs. When I'm sure that everything works, I'll make some tutorials, maybe

Last edited by Bergus; 11-01-21 at 19:30. Reason: typos
Bergus is offline   Reply With Quote
Old 12-01-21, 05:26   #19
not again!
Archaeologist
 
not again!'s Avatar
 
Join Date: Feb 2008
Posts: 1,042
Default

This keeps getting better and better, and it was already amazing to begin with!
Export of statics works now perfectly on my end and I'm a big fan of the way applying shine and transparency has been integrated into the addon. Many thanks for adding the option to batch export to OBJ as well!
Having the option to adjust rotation on import is also greatly appreciated. One thing I noticed is that Moveables without rig (like inventory items and puzzle pieces) are not affected by the rotation-transform though when ticking "rotate objects upright".
Again, not really a problem since objects can easily be rotated manually - just mentioning in case that's the sort of thing you'd like people to report.
I think having the option "rotate upright" ticked by default is probably going to be more convenient - I suspect that it's going to be used way more often than it's not going to be used.
Thank you for this great update!
not again! is offline   Reply With Quote
Old 12-01-21, 08:04   #20
Bergus
Hobbyist
 
Join Date: Dec 2020
Posts: 52
Default

Thanks for the feedback, please report everything! The code is fresh and I can correct it very easily. Later will be hard because coding for Blender is quite nasty
Bergus is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 02:23.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.