The title pretty much explains it. I made sure I have the latest versions of everything.
Say you have an Env Factor with RGB values of 1.3 (from SCS material), which shows up as V value of 1.121871 (in HSV tab). When importing after converting from game format, the RGB values will be of 1.121871.
Overdriven RGB values are replaced with V value when importing
Re: Overdriven RGB values are replaced with V value when importing
This is not a bug. SCS material files use linear RGB values while blender uses sRGB values (non-linear). If you convert your model with scs_conversion_tools back to the game format, you will notice that your 1.3 value is back in your scs material file.
[edit]
hmmm maybe I misunderstood you, I need to test that
[edit 2]
looks like values above 1.0 aren't converted when converting to the game format. So if you set 1.3 env factor in blender it will get converted to 1.3 in the .mat file (should be 1.823259), then when you import using converter_pix it will be converted to 1.12 in blender and when you export that again it will be 1.12 in .mat file (should be 1.3) - so each conversion loop will decrease this value until it gets to (or below) 1.0 - then will stay at that value.
[yet another edit]
So now the question is, should sRGB values above 1.0 be converted to linear when converting to game format (by scs conversion tools), or maybe linear values above 1.0 shouldn't be converter to sRGB when converting from game format (by converter_pix).
[edit]
hmmm maybe I misunderstood you, I need to test that
[edit 2]
looks like values above 1.0 aren't converted when converting to the game format. So if you set 1.3 env factor in blender it will get converted to 1.3 in the .mat file (should be 1.823259), then when you import using converter_pix it will be converted to 1.12 in blender and when you export that again it will be 1.12 in .mat file (should be 1.3) - so each conversion loop will decrease this value until it gets to (or below) 1.0 - then will stay at that value.
[yet another edit]
So now the question is, should sRGB values above 1.0 be converted to linear when converting to game format (by scs conversion tools), or maybe linear values above 1.0 shouldn't be converter to sRGB when converting from game format (by converter_pix).
Re: Overdriven RGB values are replaced with V value when importing
Did anyone try to just import/export? We need to know if it's a problem of converter_pix or blender tools first.
Re: Overdriven RGB values are replaced with V value when importing
Yes I did like I said in my edits when you import a .mat with a color value of 1.3, converter_pix converts it to 1.12 (so it's 1.12 in the .pit file). Then when you export it with blender tools it's still 1.12 in the .pit file. After running conversion tools it stays 1.12 in the final .mat file - so I would say it's conversion tools issue. Blender tools seems to be transparent - it reads 1.12 from the .pit file and writes the same value back to .pit file.
Re: Overdriven RGB values are replaced with V value when importing
Well this is how it's implemented. We convert srgb for 0-1 values. Everything above it, is just remapped value (max value in a color is identified, divide each color channel value by that max value, convert to linear and then multiplied with max value all channels again).
So to get it properly converterPIX should adopt that when converting from binary data (.mat files).
So to get it properly converterPIX should adopt that when converting from binary data (.mat files).
Re: Overdriven RGB values are replaced with V value when importing
Thanks! I implemented this change in my fork of converter_pix and now I get proper values:
.pit file generated by blender tools:
.mat file generated by conversion tools from the above .pit file:
and .pit file generated by converter_pix from the above .mat file:
I will do a pull request to mwl4 as soon as he merges my previous pull request with a fix in ppd conversion.
.pit file generated by blender tools:
Code: Select all
Attribute {
Format: FLOAT3
Tag: "diffuse"
Value: ( 1.600000023841858 0.30000001192092896 0.6000000238418579 )
}
Attribute {
Format: FLOAT3
Tag: "specular"
Value: ( 0.18571430444717407 0.6214286088943481 1.0 )
}
Code: Select all
diffuse : { 1.6 , 0.0469486 , 0.185626 }
specular : { 0.028827 , 0.344133 , 1 }
Code: Select all
Attribute {
Format: FLOAT3
Tag: "diffuse"
Value: ( 1.600000 0.300000 0.600000 )
}
Attribute {
Format: FLOAT3
Tag: "specular"
Value: ( 0.185714 0.621428 1.000000 )
}
Re: Overdriven RGB values are replaced with V value when importing
Damn. I'm glad you guys know what you're doing. Thanks.
Re: Overdriven RGB values are replaced with V value when importing
No problem mwl4 merged this fix yesterday and compiled a new windows binary so if you're using converter pix wrapper it should be ok now.
Who is online
Users browsing this forum: No registered users and 5 guests