Author Topic: Vector Displacement Shader : The offsets  (Read 6106 times)

Offline Matt

  • Planetside Staff
  • *
  • Posts: 3589
  • I'm the crazy one
Re: Vector Displacement Shader : The offsets
« Reply #15 on: June 08, 2013, 12:20:21 AM »
Thanks, Matt for the insights


I am using an EXR format map which is built on a plane object in C4D.
The background of the EXR is gray in a viewer.
I have been using the colour setting  Data is Linear in every render.
I did try the most straight forward connections first  :) Just can't find one that works.

I am trying your suggestion of one Add Vector of -0.25,-0.25,-0.25.
I have placed it directly between the Image Shader and the Vector Displacement.
It is producing the same "block" effect I want to get rid of.

Then I don't understand how you got rid of the block effect in your other image  :o Your nodes would still have that effect because they operate on everything, they're not restricted to just the image projection. What am I missing?

Matt
Just because milk is white doesn't mean that clouds are made of milk.

Offline Matt

  • Planetside Staff
  • *
  • Posts: 3589
  • I'm the crazy one
Re: Vector Displacement Shader : The offsets
« Reply #16 on: June 08, 2013, 12:23:38 AM »
Right this second I've just added some offset parameters to the Image Map Shader which should be useful in a future version.

Does C4D have any offset options on the displacement map export?

In the mean time, you could try multiplying your offset vectors by a mask (a white image with the same projection settings).

Matt
Just because milk is white doesn't mean that clouds are made of milk.

Offline fleetwood

  • Member
  • *
  • Posts: 1232
Re: Vector Displacement Shader : The offsets
« Reply #17 on: June 08, 2013, 01:04:38 AM »
I don't see any offset options on the C4D side.

My hunch is that the nodes I came up with work because  they cause offsets to balance in the middle.

I think that is the reason that the value 0.25 works instead of the more logical 0.5.
It seems that the vectors from the image are lowered by 0.25 while the planet is lifted by 0.25 (verified that Alt is 2.5m in the flat in the preview window, plus it can be seen in the render by the position of the Blue sphere located at 2.5 meters altitude).

I do know that my method only works with the individual X,Y,and Z vectors fed into the Build Vector.
I wonder if what happens inside the Build Vector when it is fed vectors is key.

Attached is the TGD with the EXR file I'm using if anyone would like to fool with it.
« Last Edit: June 08, 2013, 02:01:52 AM by fleetwood »

Offline Dune

  • Member
  • *
  • Posts: 15225
    • www.ulco-art.nl
Re: Vector Displacement Shader : The offsets
« Reply #18 on: June 08, 2013, 06:10:44 AM »
Is this the answer to your problem? In the experiments I did with VDisp by image map I had a black background, not gray.

Offline fleetwood

  • Member
  • *
  • Posts: 1232
Re: Vector Displacement Shader : The offsets
« Reply #19 on: June 08, 2013, 05:08:32 PM »
Yes that's it !
Thanks Dune  :D

Using the Vector Displacement as the child of a surface shader and blending back in a single Add Vector using blend as coverage allowed eliminating all of the extra nodes and keeps the planet at 0 altitude.

Just need one Add Vector now as Matt said. ( I have the Add Vector is set -0.46,-0.46,-0.46, which seems a little strange but that is
the exact amount needed to bring the displacement level. At least it is far closer to the expected -0.5)

A Plus is that the displacement has fewer distortions from what was modeled .
« Last Edit: June 08, 2013, 05:12:01 PM by fleetwood »

Offline Matt

  • Planetside Staff
  • *
  • Posts: 3589
  • I'm the crazy one
Re: Vector Displacement Shader : The offsets
« Reply #20 on: June 08, 2013, 09:25:54 PM »
I don't see any offset options on the C4D side.

My hunch is that the nodes I came up with work because  they cause offsets to balance in the middle.

I think that is the reason that the value 0.25 works instead of the more logical 0.5.
It seems that the vectors from the image are lowered by 0.25 while the planet is lifted by 0.25 (verified that Alt is 2.5m in the flat in the preview window, plus it can be seen in the render by the position of the Blue sphere located at 2.5 meters altitude).

I do know that my method only works with the individual X,Y,and Z vectors fed into the Build Vector.
I wonder if what happens inside the Build Vector when it is fed vectors is key.

Attached is the TGD with the EXR file I'm using if anyone would like to fool with it.

Ah, I see what's happening now. Your vectors are being converted into scalars automatically when you plug them into the Build Vector. Now, because you subtracted 0.25 from them, this produces some negative values, but when these negative vectors are converted into a scalar they become positive again. This is similar to taking the absolute value (where negative values are reflected to become positive). It's a very unexpected way of solving the problem but it works in this case! :) However, you have to be careful with this method. If any of the values in the displacement map are below 0.25 then they will get clamped and reflected back in the other direction.

Matt
« Last Edit: June 08, 2013, 09:28:47 PM by Matt »
Just because milk is white doesn't mean that clouds are made of milk.

Offline Matt

  • Planetside Staff
  • *
  • Posts: 3589
  • I'm the crazy one
Re: Vector Displacement Shader : The offsets
« Reply #21 on: June 08, 2013, 09:30:57 PM »
Yes that's it !
Thanks Dune  :D

Using the Vector Displacement as the child of a surface shader and blending back in a single Add Vector using blend as coverage allowed eliminating all of the extra nodes and keeps the planet at 0 altitude.

This isn't right. You need to mask it with a value of 1 wherever the image is. That's why I suggested masking/blending with a second image map shader with a white image. If you mask by the original vector, you're distorting the values.

Matt
« Last Edit: June 08, 2013, 09:33:29 PM by Matt »
Just because milk is white doesn't mean that clouds are made of milk.

Offline fleetwood

  • Member
  • *
  • Posts: 1232
Re: Vector Displacement Shader : The offsets
« Reply #22 on: June 08, 2013, 10:25:10 PM »
Thanks Matt for looking into this.

Using a pure white image mask as a blender is working perfectly to show all the displacement including the lowest portions
and the amount subtracted from the original vector is the now the anticipated -0.5, -0.5, -0.5.
 

Thanks again for all the information and help.
« Last Edit: June 08, 2013, 10:32:01 PM by fleetwood »

Offline Matt

  • Planetside Staff
  • *
  • Posts: 3589
  • I'm the crazy one
Re: Vector Displacement Shader : The offsets
« Reply #23 on: June 08, 2013, 10:56:57 PM »
Great :)
Just because milk is white doesn't mean that clouds are made of milk.

Offline Dune

  • Member
  • *
  • Posts: 15225
    • www.ulco-art.nl
Re: Vector Displacement Shader : The offsets
« Reply #24 on: June 09, 2013, 07:14:10 AM »
A simple shape shader of 10x10 will as well as a blender.

Offline Matt

  • Planetside Staff
  • *
  • Posts: 3589
  • I'm the crazy one
Re: Vector Displacement Shader : The offsets
« Reply #25 on: June 09, 2013, 09:22:11 AM »
A simple shape shader of 10x10 will as well as a blender.

Only if you can guarantee that the border blending will be the same ;)
Just because milk is white doesn't mean that clouds are made of milk.

Offline Dune

  • Member
  • *
  • Posts: 15225
    • www.ulco-art.nl
Re: Vector Displacement Shader : The offsets
« Reply #26 on: June 09, 2013, 04:16:57 PM »
Yes. In this case it was, and when I made it a circle of 10x10 it also worked as that was obviously slightly smaller than the max map size (apparently).


Offline Mid-Knight Acchan

  • Member
  • *
  • Posts: 78
  • https://www65.atwiki.jp/terragen/
    • Terragen 4 japanese wiki
Re: Vector Displacement Shader : The offsets
« Reply #27 on: February 05, 2019, 05:54:16 AM »
Hello. I am studying with a very wonderful Tpic.
When connecting to the Surface layer, problems will occur in shadows.
Am I doing something wrong?

>> That's why I suggested masking/blending with a second image map shader with a white image.
The mask image is a blank image map.
« Last Edit: February 05, 2019, 11:28:05 PM by Mid-Knight Acchan »

Offline Dune

  • Member
  • *
  • Posts: 15225
    • www.ulco-art.nl
Re: Vector Displacement Shader : The offsets
« Reply #28 on: February 05, 2019, 07:15:40 AM »
You are masking by an image map. It's not included, so it's hard to see what's going on, but I guess it cuts off the displacement. Better check its location and settings, or include it in a zip.

 

anything