How to bake roughness into green channel only for usage with GLTF (Blender 2.8) I've got a node setup that uses the red channel of the diffuse map for the roughness. I've described this method here. This works really well for wood textures. The node setup looks like:



I want to export my object to GLTF. To create correct GLTF files, you have to connect one texture that holds the roughness (G), metallic (B) and AO (R) in the different color channels. Therefore the setup I currently have doesn't work. The setup that is needed by the GLTF exporter looks like:



(I'm not 100% sure about the connection to the glTF Metallic Roughness group node; Blender crashes atm when I use this setup).

I use a 2 step procedure now. First I use the setup as described at the top of this post. Then I bake the roughness into a texture. Then use that texture and connect the green channel to the roughness input of the principled bsdf node. Problem is that the generated roughness map contains the roughness in all channels (R,G,B). So when I connect the blue channel to the metallic it uses the same values as the roughness instead. 

Is there a better way to do this? Or maybe a way to only bake into one channel? What solution do you use to export GLTF files from blender 2.8?
ok I do kinda understand what you want to achive, you need to do it differently though to get the best possible outcome.
you need a CombineRGB node, plug the Rougthness in R, the Metallic in G and the AO in B (if you want to use the Red channel of the diffuse as the rougthness) and then you plug that in to a diffuse node, this then to the output


then you go over to the baking section, there you select Diffuse (COLOR)


Create your image in the image editor and put it into the material you want to bake, make sure its selected


if you now bake it, you will see that it works, it only uses the color of the diffuse node, not shades, nothing else, just color.

to get the data back you will simply use a SeperateRGB node.