Convert a texture channel to a Texture2D
Hi, it is possible to convert a texture sampler`s channel to a Texture 2D? I would like to have 4 individual information in each channel and use it in functions like the NormalFromHeightMap. However, it only accepts a Texture 2D, making me work on each image individually inside photoshop.
asked Oct 13 '14 at 03:17 PM in Rendering
Hey danielvmacedo -
Currently there is no way to take a Texture Sampler and convert to a Texture Object (T2D input). However, the NormalFromHeightMap is a Material Function and you can pull the Instructions out of the Material Function and then use the regular Texture Samplers OR create a copy of the Material function and replace the Function Inputs in the Material Function with the actual Texture Samples you want to use. OR copy the function and pull off the texture samples in the Material Function from the appropriate RGBA channels then when you place the T2d it will pull the separate channels of that Texture as you have set up.
answered Oct 15 '14 at 02:34 PM
Lovecraft_K ♦♦ STAFF
I know that this was years ago, but I found myself wanting an answer. This seemed a bit complex for a simple action, so I managed to find a very easy way for those who stumble upon this. In the following image, I am getting the material of my gun, finding the PatternMap texture, casting to that texture as Texture2d, then setting a variable in a Widget that is of type Texture2d. The Widget then displays the texture. This seemed to do the trick!
answered May 11 '18 at 06:41 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here