Material Converter
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Material Converter
Just finished a material converter script. It has 4 functions
Convert material instancing to None, Object or Scene
Convert a compiled material to a BlankDX(D3D) style
Convert BlankDX(D3D) material to Yafaray material
Convert BlankDX(D3D) material to Indigo material
It will convert basic colors and texture maps. Workspace procedural materials are not supported.
The instancing converter is useful for Indigo because it requires scene instanced materials.
Conversion to the BlankDX(D3D) style is useful because most exporter scripts I've written use this type of material and the Yafaray and Indigo converters listed above need the materials in this format. It will convert the Lightworks materials that are automatically converted to compiled materials when they cross the bridge and it will convert many(most?) of the materials from the Materials-DX9 and Materials-Textures libraries.
The conversion to Indigo needs to have the existing materials already scene instanced.
Be sure to save your scene before converting. Materials in trueSpace are not one consistent scheme and I could easily have missed a case or two that might give an unpredictable conversion.
Find the script here, middle of the page:
http://www.clintons3d.com/plugins/trues ... index.html"
Convert material instancing to None, Object or Scene
Convert a compiled material to a BlankDX(D3D) style
Convert BlankDX(D3D) material to Yafaray material
Convert BlankDX(D3D) material to Indigo material
It will convert basic colors and texture maps. Workspace procedural materials are not supported.
The instancing converter is useful for Indigo because it requires scene instanced materials.
Conversion to the BlankDX(D3D) style is useful because most exporter scripts I've written use this type of material and the Yafaray and Indigo converters listed above need the materials in this format. It will convert the Lightworks materials that are automatically converted to compiled materials when they cross the bridge and it will convert many(most?) of the materials from the Materials-DX9 and Materials-Textures libraries.
The conversion to Indigo needs to have the existing materials already scene instanced.
Be sure to save your scene before converting. Materials in trueSpace are not one consistent scheme and I could easily have missed a case or two that might give an unpredictable conversion.
Find the script here, middle of the page:
http://www.clintons3d.com/plugins/trues ... index.html"
-
Draise
- Captain
- Posts: 3200
- Joined: 21 Sep 2009, 19:33
- Type the number ten into the box: 0
- Location: Bogota, Colombia
Re: Material Converter
GREAT! This is awesome, I am starting to do pass shading in WS and sometimes loading object instances then needing to copy and paste and convert shaders to Scene instances for the pass script is quite tedious! Instance converter sounds amazing!
I will try this out and see how it will works!
I will try this out and see how it will works!
-
trueBlue
- Captain
- Posts: 5548
- Joined: 06 Jul 2009, 22:50
- Type the number ten into the box: 10
Re: Material Converter
This is an awesome script!
With regards to converting compiled materials:
I guess there is no D3D material equivalent for DiffuseStrength, SpecularStrength, Transparency, VertexColorStrength?
With regards to converting compiled materials:
I guess there is no D3D material equivalent for DiffuseStrength, SpecularStrength, Transparency, VertexColorStrength?
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: Material Converter
The D3d material has transparency in the form of alpha value. I'm guessing the various "strengths" are for lightworks rendering.trueBlue wrote: 05 May 2018, 23:24 This is an awesome script!
With regards to converting compiled materials:
I guess there is no D3D material equivalent for DiffuseStrength, SpecularStrength, Transparency, VertexColorStrength?
-
trueBlue
- Captain
- Posts: 5548
- Joined: 06 Jul 2009, 22:50
- Type the number ten into the box: 10
Re: Material Converter
I was looking at the Blinn material. Wonder if that would work? That is if it does not interfere with your exporters.
Looking at other components it looks like Color has an Alpha = W
Looking at other components it looks like Color has an Alpha = W
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: Material Converter
Where can I find the blinn material?trueBlue wrote: 06 May 2018, 00:34 I was looking at the Blinn material. Wonder if that would work? That is if it does not interfere with your exporters.
Looking at other components it looks like Color has an Alpha = W
-
trueBlue
- Captain
- Posts: 5548
- Joined: 06 Jul 2009, 22:50
- Type the number ten into the box: 10
Re: Material Converter
I remember Jack Edwards suggesting that this should be the Default Material.
It is in the 'Materials - DX9' library and also in the 'Shaders - Model Shaders' library.
As you mentioned it is using the Alpha Test which has to be Enabled and set the Opacity.
Take a peek inside the material at the Alpha_shader and Model_shader (which has Diffuse and Specular)
As for Transparency, I was experimenting with the Object Render Attributes, Surface Opacity.
It is in the 'Materials - DX9' library and also in the 'Shaders - Model Shaders' library.
As you mentioned it is using the Alpha Test which has to be Enabled and set the Opacity.
Take a peek inside the material at the Alpha_shader and Model_shader (which has Diffuse and Specular)
As for Transparency, I was experimenting with the Object Render Attributes, Surface Opacity.
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: Material Converter
I see, no it wouldn't work with the existing blinn model shader. The blinn shader would have to be altered to accept a color or some translation of color and then a second version would be needed to accept a texture or maybe both color and texture could be added at once.
I'm sure it can be done with some work. To work with the converter the blinn model shader would need to have the inputs for color, texture and shininess and it might have to be renamed to "DefaultModelShader" to fool the converter code and any exporters that depend on it, not sure about that.
I'm sure it can be done with some work. To work with the converter the blinn model shader would need to have the inputs for color, texture and shininess and it might have to be renamed to "DefaultModelShader" to fool the converter code and any exporters that depend on it, not sure about that.
-
trueBlue
- Captain
- Posts: 5548
- Joined: 06 Jul 2009, 22:50
- Type the number ten into the box: 10
Re: Material Converter
With your plugin, are you able to set a material in the Vray Material Editor?
If so do you set the string to the material in the library?
What is the Varible? Could you set a component of a material as in a Shader?
Trying to reset the shaders in the Vray Material Editor.
Vray.ResetMaterialEditorShader('Color');
The above command causes an error running Vray in tS761Std.
If so do you set the string to the material in the library?
What is the Varible? Could you set a component of a material as in a Shader?
Trying to reset the shaders in the Vray Material Editor.
Vray.ResetMaterialEditorShader('Color');
The above command causes an error running Vray in tS761Std.
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: Material Converter
I don't know. I don't have v-ray so I've never done anything with it.
-
trueBlue
- Captain
- Posts: 5548
- Joined: 06 Jul 2009, 22:50
- Type the number ten into the box: 10
Re: Material Converter
I am guessing that the YafaRay materials went through a name change at some point?
This is the converter you released in the Yafaray4tS v0.9.0 thread. All though it is dated June 14, 2013
These are the names in the combo control:
Yafaray Rough Glass
Yaf_Coated_Glossy
Yaf_Glass
Yaf_Glossy
Yaf_Light_Material
Yaf_Shiny_Diffuse
The current YafaRay Material names:
Yafaray Rough Glass
YafaRay Coated_Glossy
YafaRay Glass
YafaRay Glossy
YafaRay Light_Material
YafaRay Shiny_Diffuse
Also a complied D3D material has to be converted to a D3D Shader before converting to a Yafaray material.
These are the names in the combo control:
Yafaray Rough Glass
Yaf_Coated_Glossy
Yaf_Glass
Yaf_Glossy
Yaf_Light_Material
Yaf_Shiny_Diffuse
The current YafaRay Material names:
Yafaray Rough Glass
YafaRay Coated_Glossy
YafaRay Glass
YafaRay Glossy
YafaRay Light_Material
YafaRay Shiny_Diffuse
Also a complied D3D material has to be converted to a D3D Shader before converting to a Yafaray material.
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: Material Converter
Yep, the names changed.trueBlue wrote: 03 Aug 2018, 20:51 I am guessing that the YafaRay materials went through a name change at some point?
...
Wrong name.PNG
This is the converter you released in the Yafaray4tS v0.9.0 thread. All though it is dated June 14, 2013
...
Also a complied D3D material has to be converted to a D3D Shader before converting to a Yafaray material.
Nope, that's your version of the material converter, mine never had the extra controls or the new panel. When you started making changes I thought you would take care of it, so if you didn't fix the names no one did. Should I add that to my list or will you be doing it?
Yep, compiled has to be converted to d3d first.
-
trueBlue
- Captain
- Posts: 5548
- Joined: 06 Jul 2009, 22:50
- Type the number ten into the box: 10
Re: Material Converter
Yes the pic shown is the one in the update.
This is the original one I referring to:
viewtopic.php?t=5446&hilit=d3d+ater ... 580#p52448
This is the original one I referring to:
viewtopic.php?t=5446&hilit=d3d+ater ... 580#p52448
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: Material Converter
That link doesn't show any material converter, goes to page 59 of the discussion for metrueBlue wrote: 04 Aug 2018, 00:13 Yes the pic shown is the one in the update.
This is the original one I referring to:
viewtopic.php?t=5446&hilit=d3d+ater ... 580#p52448
Edit: also tried pages 58 an 60 to see if it was off by 1 page - no luck
-
trueBlue
- Captain
- Posts: 5548
- Joined: 06 Jul 2009, 22:50
- Type the number ten into the box: 10
Re: Material Converter
Interesting the link works for me. It is on page 59.
viewtopic.php?t=5446&hilit=d3d+ater ... 580#p52445
viewtopic.php?t=5446&hilit=d3d+ater ... 580#p52445
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: Material Converter
This is what the top of pg 59 using the link looks like for me. Does it look right?
-
trueBlue
- Captain
- Posts: 5548
- Joined: 06 Jul 2009, 22:50
- Type the number ten into the box: 10
Re: Material Converter
Nope! How about you search for D3D material Converter
Thats how I found it.
It is in the Yafaray4tS v0.9.0 thread.
Thats how I found it.
It is in the Yafaray4tS v0.9.0 thread.
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: Material Converter
July 2020 Update:
From previous updates persistent installer 2018, some bug fixes 2019
fix instancing script to work with materials from the FBX import scripts
smaller UI
installer clears recent files lists
http://clintons3d.com/plugins/truespace ... erter.html
From previous updates persistent installer 2018, some bug fixes 2019
fix instancing script to work with materials from the FBX import scripts
smaller UI
installer clears recent files lists
http://clintons3d.com/plugins/truespace ... erter.html
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: Material Converter
Update #2, July 2020
bug: Instancing restores the original setting when complete
instancing is multi-selection aware
compiled to D3D is multi-selection aware
the only mode that uses a single selected item is the Indigo converter
yafaray is already multi-selection aware
bug: Instancing restores the original setting when complete
instancing is multi-selection aware
compiled to D3D is multi-selection aware
the only mode that uses a single selected item is the Indigo converter
yafaray is already multi-selection aware
-
trueBlue
- Captain
- Posts: 5548
- Joined: 06 Jul 2009, 22:50
- Type the number ten into the box: 10
Re: Material Converter
Something is super wrong with this update!
I have 3 cubes in the scene
Nothing selected
I ran Convert with Instancing/Scene I took a peak at some of the scene materials and noticed materials from your Cube widget which was not even loaded.
I have 3 cubes in the scene
Nothing selected
I ran Convert with Instancing/Scene I took a peak at some of the scene materials and noticed materials from your Cube widget which was not even loaded.
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: Material Converter
I see. I suspect you had nothing selected then ran it with selected option. don't think I accounted for that.trueBlue wrote: 16 Jul 2020, 23:39 Something is super wrong with this update!
I have 3 cubes in the scene
Nothing selected
I ran Convert with Instancing/Scene
SceneInstancingProblem.png
I took a peak at some of the scene materials and noticed materials from your Cube widget which was not even loaded.
Edit:
Yep, 87 changes here...
Edit:
I did take it into account. It's just wrong, fix is on the way...
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: Material Converter
Fixed
Properly handles no selection used with selected only option for the Compiled to D3D and Instancing scripts. Also caught rare bug of trying to instance materials before any materials have been created.
Properly handles no selection used with selected only option for the Compiled to D3D and Instancing scripts. Also caught rare bug of trying to instance materials before any materials have been created.
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: Material Converter
This fix is only for the Unofficial Update version of the material converter.
Material Instance Converter was not working with objects that had several materials.
Fixed by moving the logic into a loop of command nodes.
Also added status feedback.
Run the attached script to install the fix. Fix will disappear after a context reset. Not permanent.
Material Instance Converter was not working with objects that had several materials.
Fixed by moving the logic into a loop of command nodes.
Also added status feedback.
Run the attached script to install the fix. Fix will disappear after a context reset. Not permanent.
- Attachments
-
- Material Instance Script Updater.RsObj
- (48.59 KiB) Downloaded 176 times
-
trueBlue
- Captain
- Posts: 5548
- Joined: 06 Jul 2009, 22:50
- Type the number ten into the box: 10
Re: Material Converter
I found your ConstantAlpha shader using your Collada Importer
I have added this shader to your D3D Material Converter and got it working for Transparency
.
Now I see it is missing DiffuseStrength and SpecularStrength
I have added this shader to your D3D Material Converter and got it working for Transparency
.
Now I see it is missing DiffuseStrength and SpecularStrength
-
trueBlue
- Captain
- Posts: 5548
- Joined: 06 Jul 2009, 22:50
- Type the number ten into the box: 10
Re: Material Converter
Seems to me that DiffuseStrength and SpecularStrength is like Intensity
Code: Select all
function OnComputeOutputs(params)
{
var SpecularStrength = params.ConValue('SpecularStrength');
var ColorIn = params.ConValue('ColorIn');
var Specular_Color = System.CreateDO('Common Data Package/Color Data');
Specular_Color.SetRed(ColorIn.GetRed() * SpecularStrength);
Specular_Color.SetGreen(ColorIn.GetGreen() * SpecularStrength);
Specular_Color.SetBlue(ColorIn.GetBlue() * SpecularStrength);
params.ConValue('Specular_Color') = Specular_Color;
}
function OnDefaultValue(params)
{
var conName = params.Param('conName');
switch (conName)
{
case 'SpecularStrength':
params.Param('vtData') = 1.0;
params.Param('bHandled') = true;
break;
}
}
-
trueBlue
- Captain
- Posts: 5548
- Joined: 06 Jul 2009, 22:50
- Type the number ten into the box: 10
Re: Material Converter
D3D Material Converter
List of changes:
D3D material
SolidColorShader 'DiffuseStrength'
DefaultModelShader 'SpecularStrength'
ConstantAlpha 'Tansparency'
TextureAlpha 'Switch to Alpha X'
convert compiled to d3d script
Add
if(Node.ConExists(currentNode,"Transparency")) processTransparency(currentNode, d3dmat);
function processTransparency(currentNode, d3dmat)
Modified
function processDiffuseColor(currentNode, d3dmat)
function processShininess(currentNode, d3dmat)
Disabled
if(Node.ConExists(currentNode,"SpecularStrength")) processSpecular(currentNode, d3dmat)
function processSpecular(currentNode, d3dmat)
Missing
TextureShader - DiffuseStrength & DiffuseColor
VertexColorStrength
AlphaTest
AlphaTestValue
List of changes:
D3D material
SolidColorShader 'DiffuseStrength'
DefaultModelShader 'SpecularStrength'
ConstantAlpha 'Tansparency'
TextureAlpha 'Switch to Alpha X'
convert compiled to d3d script
Add
if(Node.ConExists(currentNode,"Transparency")) processTransparency(currentNode, d3dmat);
function processTransparency(currentNode, d3dmat)
Modified
function processDiffuseColor(currentNode, d3dmat)
function processShininess(currentNode, d3dmat)
Disabled
if(Node.ConExists(currentNode,"SpecularStrength")) processSpecular(currentNode, d3dmat)
function processSpecular(currentNode, d3dmat)
Missing
TextureShader - DiffuseStrength & DiffuseColor
VertexColorStrength
AlphaTest
AlphaTestValue
-
trueBlue
- Captain
- Posts: 5548
- Joined: 06 Jul 2009, 22:50
- Type the number ten into the box: 10
Re: Material Converter
Got the VertexColorShade to work
Looks like there needs to be more than one ModelShader
Also, would be better if the shaders included their Move and Scale attributes
Looks like there needs to be more than one ModelShader
Also, would be better if the shaders included their Move and Scale attributes
-
Finis
- Captain
- Posts: 5410
- Joined: 21 May 2009, 18:26
- Type the number ten into the box: 0
- Location: America!
Re: Material Converter
Wow! AI spam? Even slaves in a spam center in India or China wouldn't be cheap enough to create reply text that is relevant to the post.
The spammer inserted links to whatever into the quoted post.
The spammer inserted links to whatever into the quoted post.
One goes to cracked software and hack tools. The other to something about free stuff in games.Saul wrote: 19 Aug 2023, 22:32 Hmmmm, wonder where those links go?
Last edited by Finis on 20 Aug 2023, 01:06, edited 4 times in total.
I prefer dangerous freedom over peaceful servitude. -- Thomas Jefferson/Jean Jacques Rousseau
-
Saul
- Senior Chief Petty Officer
- Posts: 308
- Joined: 22 May 2009, 16:50
Re: Material Converter
Hmmmm, wonder where those links go?
-
U3Dadmin_uno
- Site Admin
- Posts: 1
- Joined: 13 Jan 2017, 18:45
- Type the number ten into the box: 10
Re: Material Converter
great catch Finis, I missed those links.
-
trueBlue
- Captain
- Posts: 5548
- Joined: 06 Jul 2009, 22:50
- Type the number ten into the box: 10
Re: Material Converter
@Clinton
I was able to figure out how to add DiffuseStrength to the TextureShader using your Image Gamma from the Components - Compositing library
TextureShader
Add:
Image Gamma
DiffuseStrength
I was also able to figure out how to add the AlphaTestValue to the TextureAlphaShader and connect it to the Material - AlphaTestValue
TextureAlphaShader
Add:
AlphaTestValue
The only thing I can not figure out how to do is the Material - AlphaTest ComboControl
Any chance you could help with this?
EDIT: Just figured out how to do it
This is the last thing that is needed to convert all of the Compiled Material Attributes
I am using the InstancingMaterialTree as a test object
The tree on the right has been converted to shaders
As you can see with the Shadow, the AlphaTest ComboControl needs to change to Enable
I was able to figure out how to add DiffuseStrength to the TextureShader using your Image Gamma from the Components - Compositing library
TextureShader
Add:
Image Gamma
DiffuseStrength
I was also able to figure out how to add the AlphaTestValue to the TextureAlphaShader and connect it to the Material - AlphaTestValue
TextureAlphaShader
Add:
AlphaTestValue
The only thing I can not figure out how to do is the Material - AlphaTest ComboControl
Any chance you could help with this?
EDIT: Just figured out how to do it
This is the last thing that is needed to convert all of the Compiled Material Attributes
I am using the InstancingMaterialTree as a test object
The tree on the right has been converted to shaders
As you can see with the Shadow, the AlphaTest ComboControl needs to change to Enable
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: Material Converter
Update July 12 2024
new update uses the new load on demand style installation
added the changes that only existed in the UU except,
- removed clear history
- rewrote to use undo friendly util commands
- does not include the extra material functions that don't actually convert materials
new warning if try to convert a scene instanced material to a yafaray material, which does not support scene instancing
http://clintons3d.com/plugins/truespace ... erter.html
new update uses the new load on demand style installation
added the changes that only existed in the UU except,
- removed clear history
- rewrote to use undo friendly util commands
- does not include the extra material functions that don't actually convert materials
new warning if try to convert a scene instanced material to a yafaray material, which does not support scene instancing
http://clintons3d.com/plugins/truespace ... erter.html
-
trueBlue
- Captain
- Posts: 5548
- Joined: 06 Jul 2009, 22:50
- Type the number ten into the box: 10
Re: Material Converter
The Material Converter is missing a key component
The Base/Compiled D3D material .
Is it possible to create a TextureShader that has:
DifTexCoordMoveX
DifTexCoordMoveY
DifTexCoordScaleX
DifTexCoordScaleY
Similar to the TextueAlphaShader and NormalMapShader? .
Edit: Does not look possible due to not being compatible with the UV Editor
The Base/Compiled D3D material .
Is it possible to create a TextureShader that has:
DifTexCoordMoveX
DifTexCoordMoveY
DifTexCoordScaleX
DifTexCoordScaleY
Similar to the TextueAlphaShader and NormalMapShader? .
Edit: Does not look possible due to not being compatible with the UV Editor
-
trueBlue
- Captain
- Posts: 5548
- Joined: 06 Jul 2009, 22:50
- Type the number ten into the box: 10
Re: Material Converter
@Clinton
I think have a better working solution for the Material Converter's convert compiled to d3d script
Updates
Several Functions
Support for old/bad and new Material node
If the D3D material has Alpha or Normal Scale X or Y values greater than 1.000, remove the DefaultTexCoordShader node
Previous version was combing these values in the DefaultTexCoordShader which was negating Alpha and or Normals Scale X or Y
The only limitation is now, the DifCoordScaleX and Y are not being used, in the above scenario, but the conversion is much closer
Also, updated the Material node found in the Components - Inputs and compilers library
The BrikishTextureBump material, found in the Materials - Textures library is a good example to compare this version with the previous version
Previous version negated the Normals shader
Removed due to update
I think have a better working solution for the Material Converter's convert compiled to d3d script
Updates
Several Functions
Support for old/bad and new Material node
If the D3D material has Alpha or Normal Scale X or Y values greater than 1.000, remove the DefaultTexCoordShader node
Previous version was combing these values in the DefaultTexCoordShader which was negating Alpha and or Normals Scale X or Y
The only limitation is now, the DifCoordScaleX and Y are not being used, in the above scenario, but the conversion is much closer
Also, updated the Material node found in the Components - Inputs and compilers library
The BrikishTextureBump material, found in the Materials - Textures library is a good example to compare this version with the previous version
Previous version negated the Normals shader
Removed due to update
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: Material Converter
trueBlue wrote: 01 Aug 2024, 19:49 @Clinton
I think have a better working solution for the Material Converter's convert compiled to d3d script
Updates
Several Functions
Support for old/bad and new Material node
If the D3D material has Alpha or Normal Scale X or Y values greater than 1.000, remove the DefaultTexCoordShader node
Previous version was combing these values in the DefaultTexCoordShader which was negating Alpha and or Normals Scale X or Y
The only limitation is now, the DifCoordScaleX and Y are not being used, in the above scenario, but the conversion is much closer
Also, updated the Material node found in the Components - Inputs and compilers library
The BrikishTextureBump material, found in the Materials - Textures library is a good example to compare this version with the previous version
Previous version negated the Normals shader
Using the new Material Converter the color texture is wrong. Left is new material with the faint image of giant bricks. Right is the original base material.
The second image shows the corrected original material. The normalmap is set to 1 to adjust. So the DefaultTexCoordShader is set to the original value and then any alpha or normal coords would be adjusted to make it match up. Some math is needed.
-
trueBlue
- Captain
- Posts: 5548
- Joined: 06 Jul 2009, 22:50
- Type the number ten into the box: 10
Re: Material Converter
I saved the original compiled Diffuse and Normal images
Both are 16x16 24 bit .
The original compiled D3D material's Diffuse and Normal's ScaleX & ScaleY are set to 20
So, I guess I am not following what is wrong
You have the Diffuse set at 20 and the Normal set to 1
Seems they should both be set as the original, which is 20
Not sure about tS's UV Editor, it only shows one image for both complied and shaders
. Left = original compiled
Middle = converted without DefaultTexCoordShader shader with the script I just uploaded
Right = converted with DefaultTexCoordShader shader
As you can see, the right does not show the Normal and does not look like the original
Both are 16x16 24 bit .
The original compiled D3D material's Diffuse and Normal's ScaleX & ScaleY are set to 20
So, I guess I am not following what is wrong
You have the Diffuse set at 20 and the Normal set to 1
Seems they should both be set as the original, which is 20
Not sure about tS's UV Editor, it only shows one image for both complied and shaders
. Left = original compiled
Middle = converted without DefaultTexCoordShader shader with the script I just uploaded
Right = converted with DefaultTexCoordShader shader
As you can see, the right does not show the Normal and does not look like the original
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: Material Converter
trueBlue wrote: 01 Aug 2024, 22:09 I saved the original compiled Diffuse and Normal images
Both are 16x16 24 bit
DifuuseBrick.png
NormalBrick.png
.
The original compiled D3D material's Diffuse and Normal's ScaleX & ScaleY are set to 20
So, I guess I am not following what is wrong
You have the Diffuse set at 20 and the Normal set to 1
Seems they should both be set as the original, which is 20
Not sure about tS's UV Editor, it only shows one image for both complied and shaders
.
Conversions.png
Left = original compiled
Middle = converted without DefaultTexCoordShader shader with the script I just uploaded
Right = converted with DefaultTexCoordShader shader
As you can see, the right does not show the Normal and does not look like the original
Here I replaced the brick color to show the difference more clearly. Left is new material right is the original base material. So now if I add a texture coordinate shader to the new material and set it to scale 20 and 20 the color will match, except now the normal map will multiply and give 400 and 400, so setting normal back to 1 and 1 will make it pick up the texture coord 20 and 20 resulting in both color and normal at 20 and 20. The single source of truth should come from the texture coordinate shader and the others should be adjusted for the desired result.
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: Material Converter
"As you can see, the right does not show the Normal and does not look like the original"
Zoom in and you can see the tiny normal map.
Zoom in and you can see the tiny normal map.
-
trueBlue
- Captain
- Posts: 5548
- Joined: 06 Jul 2009, 22:50
- Type the number ten into the box: 10
Re: Material Converter
Okay, thanks!
I will not add code that removes the DefaultTexCoordShader node
I will not add code that removes the DefaultTexCoordShader node
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: Material Converter
Update Aug 11
base to d3d converter will read the base material alpha and normal texture coordinates
base to d3d converter will read the base material alpha test value
cleans out temp nodes after yafaray conversion is complete
internally the code has been updated to work with the new Material node, but the old Material node is still used in the conversion
base to d3d converter will read the base material alpha and normal texture coordinates
base to d3d converter will read the base material alpha test value
cleans out temp nodes after yafaray conversion is complete
internally the code has been updated to work with the new Material node, but the old Material node is still used in the conversion
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: Material Converter
One thing about the alpha test value. I just got a new laptop and the alpha wasn't working. I had to set it up so tS used the actual graphics card instead of the secondary intel graphics card.
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: Material Converter
Top image shows conversion from base material to compound material using the Unofficial Update version of the D3D Material Converter.
The converted sphere on the right does not match the original on the left.
Bottom image adds the third sphere using the material converter from the website. This result looks the same as the original.
Both scene files are attached below.
The converted sphere on the right does not match the original on the left.
Bottom image adds the third sphere using the material converter from the website. This result looks the same as the original.
Both scene files are attached below.
- Attachments
-
- Space3D_VertColorCorrect.RsScn
- (666.75 KiB) Downloaded 34 times
-
- Space3D_VertColor.RsScn
- (597.94 KiB) Downloaded 34 times
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: Material Converter
Update Aug 25
convert from base to compound will use the DiffuseStrength
convert from base to compound will use the SpecularStrength with values greater than 1, before only used values less than or equal to 1
https://clintons3d.com/plugins/truespac ... erter.html
convert from base to compound will use the DiffuseStrength
convert from base to compound will use the SpecularStrength with values greater than 1, before only used values less than or equal to 1
https://clintons3d.com/plugins/truespac ... erter.html
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: Material Converter
Update Aug 25 again
convert from base to compound will use diffuse strength with diffuse texture
convert from base to compound will read transparency value
convert from base to compound option to convert material as metallic
When converting as metallic the specular color will be taken from the diffuse color. Texture material will use the texture as the specular color.
Non-metallic conversion will continue to use white/shades of gray for the specular color.
There is no way for script to tell if a base material is metallic or not. So it uses the all or nothing checkbox to control the conversion.
convert from base to compound will use diffuse strength with diffuse texture
convert from base to compound will read transparency value
convert from base to compound option to convert material as metallic
When converting as metallic the specular color will be taken from the diffuse color. Texture material will use the texture as the specular color.
Non-metallic conversion will continue to use white/shades of gray for the specular color.
There is no way for script to tell if a base material is metallic or not. So it uses the all or nothing checkbox to control the conversion.
-
trueBlue
- Captain
- Posts: 5548
- Joined: 06 Jul 2009, 22:50
- Type the number ten into the box: 10
Re: Material Converter
Here is a TexCoord.RsObj
Changed TCMoveX connector from Float to TCMoveX
Changed TCMoveX connector from Float to TCMoveX
- Attachments
-
- TexCoord.RsObj
- (19.97 KiB) Downloaded 38 times
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: Material Converter
How did you change it?trueBlue wrote: 27 Aug 2024, 16:13 Here is a TexCoord.RsObj
Changed TCMoveX connector from Float to TCMoveX
When I looked at the original the label is "TCMoveX" but when hover over the connection it is "Float" and the scripts see "Float".
I tried changing it but nothing I did worked.
-
trueBlue
- Captain
- Posts: 5548
- Joined: 06 Jul 2009, 22:50
- Type the number ten into the box: 10
Re: Material Converter
I add a script inside the TexCoord.RsObj with a number attribute named TCMoveXclintonman wrote: 27 Aug 2024, 16:57How did you change it?trueBlue wrote: 27 Aug 2024, 16:13 Here is a TexCoord.RsObj
Changed TCMoveX connector from Float to TCMoveX
When I looked at the original the label is "TCMoveX" but when hover over the connection it is "Float" and the scripts see "Float".
I tried changing it but nothing I did worked.
Removed the Float connector
Exported the script's TCMoveX connector
Hooked up the TCMoveX to the Input
Removed the script .
Renaming the Float to TCMoveX does not really work, especially when trying to animate it, it shows a Float
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: Material Converter
Thanks, good to know. I think I'll make a script based on those steps.trueBlue wrote: 27 Aug 2024, 17:03I add a script inside the TexCoord.RsObj with a number attribute named TCMoveXclintonman wrote: 27 Aug 2024, 16:57How did you change it?trueBlue wrote: 27 Aug 2024, 16:13 Here is a TexCoord.RsObj
Changed TCMoveX connector from Float to TCMoveX
When I looked at the original the label is "TCMoveX" but when hover over the connection it is "Float" and the scripts see "Float".
I tried changing it but nothing I did worked.
Removed the Float connector
Exported the script's TCMoveX connector
Hooked up the TCMoveX to the Input
Removed the script
Hook it up.png
.
Renaming the Float to TCMoveX does not really work, especially when trying to animate it, it shows a Float
-
trueBlue
- Captain
- Posts: 5548
- Joined: 06 Jul 2009, 22:50
- Type the number ten into the box: 10
Re: Material Converter
A better way would be to create an OnComputeOutputs Map
So, you can set Default values and use more mean full names You could make individual Maps for Alpha and Normal .
That way it would make animating attributes much easier .
So, you can set Default values and use more mean full names You could make individual Maps for Alpha and Normal .
That way it would make animating attributes much easier .
- Attachments
-
- AlphaTexCoord.RsObj
- (24.74 KiB) Downloaded 34 times
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: Material Converter
When I said I would write a script I didn't mean for the Material Converter.trueBlue wrote: 27 Aug 2024, 17:57 A better way would be to create an OnComputeOutputs Map
So, you can set Default values and use more mean full names
OnComputeOutputs Map.png
You could make individual Maps for Alpha and Normal
Alpha and Normal Maps.png
.
That way it would make animating attributes much easier
Attribute Browser.png
.
The new release does have some new code in place for using uv move and scale if the Alpha and Normal nodes already have them. It just needs some small changes to make it work.
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: Material Converter
Aug 27 2024 update
added ALPHAMAP usage required for the tS collada exporter, also some other usage values set
fixed UV move XY for alpha and normal
convert to yafaray light material, if constant color will use it instead of diffuse color
base to compound, if base has Name copy it
fix - only add normal and alpha tex coords nodes if needed when converting base to compound. thats to say only add extra nodes if normal uv or alpha uv doesn't match the diffuse uv
added ALPHAMAP usage required for the tS collada exporter, also some other usage values set
fixed UV move XY for alpha and normal
convert to yafaray light material, if constant color will use it instead of diffuse color
base to compound, if base has Name copy it
fix - only add normal and alpha tex coords nodes if needed when converting base to compound. thats to say only add extra nodes if normal uv or alpha uv doesn't match the diffuse uv
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: Material Converter
March 2025 Update
There was a bug in the scene instance conversion.
A mesh with multiple materials will have a material node order when created. When one of the materials is replaced this can change the order the material node connections. The instanced converter couldn't handle the reordered nodes. The fix ignores the order of the material nodes and only looks at the material indices.
https://clintons3d.com/plugins/truespac ... erter.html
There was a bug in the scene instance conversion.
A mesh with multiple materials will have a material node order when created. When one of the materials is replaced this can change the order the material node connections. The instanced converter couldn't handle the reordered nodes. The fix ignores the order of the material nodes and only looks at the material indices.
https://clintons3d.com/plugins/truespac ... erter.html





















