After digging trough the default material source code I am not sure if opacity maps should even work with .fbx files (or general).
1. Reason why opacity maps should be supported:
Modelling package 3DsMax needs opacity maps in standard renderer (no alpha channel supported)
2. How to use opacity maps with sceneform at the time -requires workaround / steps performed by artists
Either follow workaround b) as described here #696
Or do it manually:
a) Add opacity map via 'injections' as described in #696 a)
b) Then create your own material definition with support for opacity map.
Example: (line 137 in fbx_material.sfm)
`{
name: "opacity",
description: "Workaround for opacity map",
options: [
{
default: null,
valid_if: propUseOpacityMap != 1.0,
//blending: "opaque",
fragment: ""
}, {
default: sfm.sourceTexture("Opacity"),
valid_if: sfm.hasSourceTexture("Opacity"),
requires: ["uv0"],
fragment:
3. What I would like to see change in Sceneform:
a) Modify the Sceneform importer to include support for opacity map textures
b) Add the lines default: sfm.sourceTexture("Opacity"), valid_if: sfm.hasSourceTexture("Opacity"), requires: ["uv0"], fragment: ||| float myOpacityValue = texture(materialParams_opacity, getUV0()).r; material.baseColor = material.baseColor * myOpacityValue; |||
to the default .fbx material ( perhaps with a nicer layout, e.g. values opacity & opacityMap for sampled texture (like baseColor and baseColorMap)
your fix doesn't seem to work anymore. I force blending to transparent in a custom material .sfm and a png with transparency that is used as a texture doesn't have any transparency.
After digging trough the default material source code I am not sure if opacity maps should even work with .fbx files (or general).
1. Reason why opacity maps should be supported: Modelling package 3DsMax needs opacity maps in standard renderer (no alpha channel supported)
3. What I would like to see change in Sceneform: a) Modify the Sceneform importer to include support for opacity map textures b) Add the lines
default: sfm.sourceTexture("Opacity"), valid_if: sfm.hasSourceTexture("Opacity"), requires: ["uv0"], fragment: ||| float myOpacityValue = texture(materialParams_opacity, getUV0()).r; material.baseColor = material.baseColor * myOpacityValue; |||
to the default .fbx material ( perhaps with a nicer layout, e.g. values opacity & opacityMap for sampled texture (like baseColor and baseColorMap)