Jump to content

Recommended Posts

Posted

Here I tried to recreate a technique from Substance Designer used to height blend  objects.   Each of two layers have its height info stored in integer part of floating point values, and color values after comma.   So a pixel with value 7000,34  consist of 7000 which is height/depth info  and 0,34 as a color info.     Then I use floor operation    like R-floor(R)  to see only color , like  7000,34 -7000=0,34  in top  procedural filter .  

It all works only  if on screen resampling is set to nearest neighbor  so pixel values stay the same.

Now a question:  how can I modulate  the height of layers  with real time visual feedback.  Like sending  some object  forward or backward  by modulating only integer (height)  part of pixel values.   What should be an expression for this in procedural filter?  

floor2.afphoto

Posted

I hope i understand this correctly. You want to simulate 3D / z-buffer rendering in Photo.

Very interesting, nice challenge.

nest another PT filter to the red object (or any layer you want to lift)

 

441058249_Screenshot2023-04-01at11_04_52.png.fb9cc874fcbad45333f7e0dfce4d6ae5.png

 

 

 

Mac mini M1 A2348 | MBP M3 

Windows 11 - AMD Ryzen 9 5900x - 32 GB RAM - Nvidia GTX 1080

LG34WK950U-W, calibrated to DCI-P3 with LG Calibration Studio / Spider 5 | Dell 27“ 4K

iPad Air Gen 5 (2022) A2589

Special interest into procedural texture filter, edit alpha channel, RGB/16 and RGB/32 color formats, stacking, finding root causes for misbehaving files, finding creative solutions for unsolvable tasks, finding bugs in Apps.

I use iPad screenshots and videos even in the Desktop section of the forum when I expect no relevant difference.

 

Posted

We could improve the formula to add depth only for non-black pixels. Which values do you use to store transparent / black pixels?

 

the magic is to use the step function and multiply the result.

Mac mini M1 A2348 | MBP M3 

Windows 11 - AMD Ryzen 9 5900x - 32 GB RAM - Nvidia GTX 1080

LG34WK950U-W, calibrated to DCI-P3 with LG Calibration Studio / Spider 5 | Dell 27“ 4K

iPad Air Gen 5 (2022) A2589

Special interest into procedural texture filter, edit alpha channel, RGB/16 and RGB/32 color formats, stacking, finding root causes for misbehaving files, finding creative solutions for unsolvable tasks, finding bugs in Apps.

I use iPad screenshots and videos even in the Desktop section of the forum when I expect no relevant difference.

 

Posted
22 hours ago, NotMyFault said:

Which values do you use to store transparent / black pixels?

Thanks a lot for the example.   That expression syntax is something I don't understand quite well.    Those  spirals are  16 bit integer  screen captures from Zbrush .  So black pixels are just 0.    My guess it could be a proper render from 3d soft where black pixels get deep negative value but my purpose is not to simulate  actual deep Z buffer , rather  just a small depth to do depth based blending of materials. Small pebbles and a sand  and such matters.   So having an option for just  a subtle up and down and your formula works perfectly.

 

Another challenge is how to make this subtle up and down by a brush with manual input .  Something that would  multiply on integer part of values or  only on  after comma part for color editing .    So far nothing I tried  is working.    Ideally a combination  of  hand painted mask  and  levels/ HLS  filter that would do it for integers /height  or after comma part(color) separately.   Hoped  just procedural "floor"  layer after any normal layer   would do the trick but seems it doesn't.

 

ps.  I added mask on top of the spiral image  and it solves blacks RGBGrab05.afphoto

My goal is to make a non-destructive version of what  Zbrush   calls  2,5D canvas. 

 

Posted
56 minutes ago, kirk23 said:

Another challenge is how to make this subtle up and down by a brush with manual input .  Something that would  multiply on integer part of values or  only on  after comma part for color editing

That is easy. Just put another pixel layer above, set blend mode to add, and use the PT filter to multiply RGB values incl floor.

With brush color, you can then set the height information.

so basically just use 2 pixel layers, and group them together:

  • upper for height, with PT filter to multiply and use floor 
  • lower for color.

 

Mac mini M1 A2348 | MBP M3 

Windows 11 - AMD Ryzen 9 5900x - 32 GB RAM - Nvidia GTX 1080

LG34WK950U-W, calibrated to DCI-P3 with LG Calibration Studio / Spider 5 | Dell 27“ 4K

iPad Air Gen 5 (2022) A2589

Special interest into procedural texture filter, edit alpha channel, RGB/16 and RGB/32 color formats, stacking, finding root causes for misbehaving files, finding creative solutions for unsolvable tasks, finding bugs in Apps.

I use iPad screenshots and videos even in the Desktop section of the forum when I expect no relevant difference.

 

Posted
2 hours ago, NotMyFault said:

so basically just use 2 pixel layers, and group them together:

  • upper for height, with PT filter to multiply and use floor 
  • lower for color.

it's basically what I try to do  but  get something  weird.  

floor4.afphoto

Posted

Below my file.

It is important that you never use a same height value (grey color) for 2 layers - both colours would mix then.

Screenshot 2023-04-02 at 17.14.31.png

25D layers.afphoto

Mac mini M1 A2348 | MBP M3 

Windows 11 - AMD Ryzen 9 5900x - 32 GB RAM - Nvidia GTX 1080

LG34WK950U-W, calibrated to DCI-P3 with LG Calibration Studio / Spider 5 | Dell 27“ 4K

iPad Air Gen 5 (2022) A2589

Special interest into procedural texture filter, edit alpha channel, RGB/16 and RGB/32 color formats, stacking, finding root causes for misbehaving files, finding creative solutions for unsolvable tasks, finding bugs in Apps.

I use iPad screenshots and videos even in the Desktop section of the forum when I expect no relevant difference.

 

Posted

I have made a new version, this time in RGB/16 to be able to work gamma corrected.

  • you have only 254 allowed color values (I compress the values from 0 to 255 into 1 to 254, otherwise edge cases can cause rendering bugs).
  • color values are shifted to the lower 8 from 16 bits
  • height values reside in higher 8 from 16 bits, but need to avoid 0 and 255 so will be compressed, too.
  • set all leaders anti-aliasing off (nearest neighbour is not required)

to my tests, everything works better (less delay, almost no rendering artifacts), gamma corrected colors etc. So if you can live with 8 bit heigh / color precision, this is easier to use

 

25D layers RGB16.afphoto

Mac mini M1 A2348 | MBP M3 

Windows 11 - AMD Ryzen 9 5900x - 32 GB RAM - Nvidia GTX 1080

LG34WK950U-W, calibrated to DCI-P3 with LG Calibration Studio / Spider 5 | Dell 27“ 4K

iPad Air Gen 5 (2022) A2589

Special interest into procedural texture filter, edit alpha channel, RGB/16 and RGB/32 color formats, stacking, finding root causes for misbehaving files, finding creative solutions for unsolvable tasks, finding bugs in Apps.

I use iPad screenshots and videos even in the Desktop section of the forum when I expect no relevant difference.

 

Posted
18 hours ago, NotMyFault said:

if you can live with 8 bit heigh

Thanks a lot NotMyFault   The problem is although  those 8 bit per depth is not enough , even 7000 value I used is marginally enough actually and still gets  stepped  sometimes when you convert this depth into a normal map.   The original purpose of all this was  to composite materials   and  to get  usable normal map too.

   I am close to give up  on the whole idea 🙁   

  It still would be possible if keep the color and height  on totally different layers and in different groups   but producing necessary dynamic masking for  color ones would turn the whole  layer  stack into  a huge undecipherable and unusable  mess.    I think v2 with transform links makes it a bit easier  but still it will be a monstrosity.   I tried it couple years ago. :(

 

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.