Barayase Posted November 11, 2020 Share Posted November 11, 2020 Is there mathematical way in procedural texture plugin to convert float displacement out of zbrush to mid gray 16bit, or maybe a workflow in affinity photo? Im thinking the scale of the object also matters on texture displacement amount from zbrush would that also be a problem. Thanks Mariusz Quote My Portfolio https://www.artstation.com/barayase Link to comment Share on other sites More sharing options...
Staff stokerg Posted November 13, 2020 Staff Share Posted November 13, 2020 Hi @Barayase, I'll try my best to help here. Would you be referring to floating point displacement maps? As we can convert these to Gray/16 with no issue. Whats thrown me is the reference to "mid grey". Do you want to remap values to 0-1? As you could just normalise the RGB values. Which would mean doing this in procedural texture, create one equation field targeting RGB and use: norm(vec3(R,G,B)) If that doesn't give the results you are after, if you can give some more information on what you are trying to do, i can see if i can get some further information on this Quote Link to comment Share on other sites More sharing options...
Barayase Posted November 14, 2020 Author Share Posted November 14, 2020 Hi Yes basically remapping the 0-1 float values is what im after, im including the original displacement textures. I cant get equation to work it may be that the float texture has information in R channel only. For texture work mid gray (value of .5) is mostly used with bump mapping anything above .5 value raises the surface anything below lowers it. Mid gray maps can also be used as displacement they aren't as accurate. They can be convenient because they can be stacked with overlay blending and just be more useful as a utility map. Float maps 0-1 there is not much you can do with them except displacement. They are dependent more on the real world scale of your objection in the scene, you have to increase the value a lot sometimes to see anything more than black. Sometimes i need a mid gray file for whatever texturing work which means baking a new version out in zbrush, big negative is this can take a really long time depending on how many maps there are and the size of them. Thank you for the help so far. Mariusz disp_original.zip Quote My Portfolio https://www.artstation.com/barayase Link to comment Share on other sites More sharing options...
lepr Posted November 14, 2020 Share Posted November 14, 2020 (The 3D vector normalisation function suggested by @stokerg is not applicable to your problem.) The linear floating point image contains signed values, with 0 representing no displacement. The required linear 16-bit integer image will contain unsigned values with 32,768 representing no displacement. Find the maximum absolute value in the floating point image so that the values can be normalised For each value: divide by maximum, add 1 and then divide by 2 Convert the modified image to 16-bit integer format without a gamma transform Regarding step 3: Affinity will apply a gamma transform to R, G and B values when converting from floating point to an integer format, which is not wanted for displacement data. Fortunately, Alpha and Spare Channels are converted linearly, so step 3 can be broken down as: flatten the floating point document to a single Pixel object duplicate an R, G or B channel to a Spare Channel convert the RGB/32 document to Grey/16 (the profile is irrelevant and will be discarded when exporting) load the Spare Channel into the Intensity channel of the Pixel object export to Grey/16 TIFF with no embedded profile. Here is the result of that process applied to your EXR file (I approximated the maximum floating point value with 0.00257): disp 16.tiff Quote Link to comment Share on other sites More sharing options...
Barayase Posted November 16, 2020 Author Share Posted November 16, 2020 Brilliant! Thank you this works great, can you tell me how you got maximum floating value whats your procedure. Small tip ror anyone using maya, you can convert the mid gray map using maya math nodes and move mid gray value of .5 to 0 by using aiAdd node with color management off, set RGB value to -0.5 now you can add displacement and however many bump maps you have together. With this and above procedure this can save lots of bake time! Thanks Quote My Portfolio https://www.artstation.com/barayase Link to comment Share on other sites More sharing options...
lepr Posted November 17, 2020 Share Posted November 17, 2020 5 hours ago, Barayase said: can you tell me how you got maximum floating value whats your procedure. That was trial and error, unfortunately, so not very helpful for real world use. The app's auto-levels function could have helped greatly, but it is too aggressive and produces clipping. Also, I created a macro to do the whole job with the user only needing to manipulate a slider to adjust the white point. A bug in the app's macro system prevented this from being useful, otherwise I'd have posted it, but I have something in mind to try when I find time later today. Quote Link to comment Share on other sites More sharing options...
lepr Posted November 17, 2020 Share Posted November 17, 2020 Tried an alternative macro. Again, thwarted by a problem in the macro system. Best I can do using AP alone at the moment is a two macro procedure: run first macro then adjust the image intensity and then run second macro. Quote Link to comment Share on other sites More sharing options...
Barayase Posted November 18, 2020 Author Share Posted November 18, 2020 Much appreciated either way, understanding the steps gets me to my goal on whichever app and if takes a bit fiddling so be it. Many Thanks Mariusz lepr 1 Quote My Portfolio https://www.artstation.com/barayase Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.