Hello, the module for exporting JSON material in "blender2ogre" seems quite limited for my use, so I'm trying to modify it to add and fix some features, so I've been messing with a .material.json file for "leaf.png" to learn about the correct setups for certain effects. I kinda got the basics, but still have 2 questions:
As I understand, OgreV2 use "alpha_test" to determine which pixels to cut out from the texture file. Currently, it seems only the alpha channel from the "diffuse" image is supported, are there any plans to give the users the choice to use another image like "opacity.png" instead?
_Since using "opacity.png" as replacement for alpha channel is supported in Blender, right now I'm planning to modify blender2ogre to turn "opacity.png" into the alpha channel for "basecolor.png" at the output.How to use "Transparency" properly? This setting is quite confusing and I still don't know if it is correlated to "alpha_test" given how they both use alpha channel.
_I've been able to create transparent texture by modifying the blendblock to "Type: Transparent Colour" like instructed here:https://ogrecave.github.io/ogre-next/ap ... ckref.html
_However, "Transparency" doesn't seem to be affected by "use_alpha_from_textures". And "value " only determines transparency on "Transparent" mode, but makes the texture dark in "Fade" mode.
Here's the json:
Code: Select all
{
"pbs": {
"alpha_material": {
"alpha_test": ["greater_equal", 0.5, false],
"blendblock" : ["blendblock_name", "blendblock_name_for_shadows"],
"diffuse": {
"texture": "leaf.png",
"value": [1.0, 1.0, 1.0, 1.0]
},
"metalness": {
"value": 0.0
},
"roughness": {
"value": 0.5
},
"specular": {
"value": [1.0, 1.0, 1.0]
},
"transparency": {
"mode": "Transparent",
"use_alpha_from_textures": true,
"value": 1
},
"two_sided": false,
"workflow": "metallic"
}
},
"blendblocks" :
{
"blendblock_name" :
{
"alpha_to_coverage" : false,
"blendmask" : "rgba",
"separate_blend" : false,
"src_blend_factor" : "src_colour",
"dst_blend_factor" : "one_minus_src_colour",
"src_alpha_blend_factor" : "src_colour",
"dst_alpha_blend_factor" : "one_minus_src_colour",
"blend_operation" : "add",
"blend_operation_alpha" : "add"
}
}
}
I want to make sure the how the alpha affect "Transparency" for Ogre-next to decide which alpha setup in Blender should export the right json file