Skip to main content
Umar AR
Inspiring
July 6, 2023
Answered

Colour Sample at a point

  • July 6, 2023
  • 2 replies
  • 278 views

In substance 3d designer I have a square tile that needs to change colour from taking a sample of the colour of a disc shape beneath it that has a colour gradient across it. The point the colour sample shall be taken from shall be the centre of the square. The disc beneath it could be rotating beneath the sample point with the discs centre point offset from the centre of the square. The colour of the square needs to update at a max of 60 fps.

This topic has been closed for replies.
Correct answer Umar AR

Hi Dave,

 

Sorry about any ambiguity in my question as I am preparing an fbx model for a strobing type effect where the individual polygon centres sample the colour of the colour gradient map beneath it giving a triangular faceted look to the animation.

 

The fbx is a model for a game I'm developing. Such a Newbie.. oh dear

 

Anyway, I did ask an Adobe advisor and this was the response I got..

 

To begin with, set up the scene with square tiles and the disc shape beneath it.

 

Once that is ready, Add a gradient node to the graph to create the color gradient for the disc shape.

 

Then you will set the gradient as per your requirement of color and orientation.

 

Connect the "Gradient" node to a Position 2D node to define the color sample point on the disc shape.

 

Then, use a "Sample" node to sample the color at the position defined by the "Position 2D" node; once that is done Connect the "Sample" node to the "Color" input of the square tile.

 

Now to apply the rotation effect to the disc, use a Time node or any node that provides a time value and connect this node to a Transform 2D node.

 

Once all this is done, You need to connect the Transform 2D node to the Position 2D node to control the rotation offset.

Then set the material to update at 60 fps in the render settings..

 

This was of course for a simpler application of the idea so I could take this solution in manageable steps.

 

I have yet to implement it but it shows promise.

 

Anyway thanks again.

 

Umar AR

 

 

 

 

 

 

 

 

2 replies

Umar AR
Umar ARAuthorCorrect answer
Inspiring
July 6, 2023

Hi Dave,

 

Sorry about any ambiguity in my question as I am preparing an fbx model for a strobing type effect where the individual polygon centres sample the colour of the colour gradient map beneath it giving a triangular faceted look to the animation.

 

The fbx is a model for a game I'm developing. Such a Newbie.. oh dear

 

Anyway, I did ask an Adobe advisor and this was the response I got..

 

To begin with, set up the scene with square tiles and the disc shape beneath it.

 

Once that is ready, Add a gradient node to the graph to create the color gradient for the disc shape.

 

Then you will set the gradient as per your requirement of color and orientation.

 

Connect the "Gradient" node to a Position 2D node to define the color sample point on the disc shape.

 

Then, use a "Sample" node to sample the color at the position defined by the "Position 2D" node; once that is done Connect the "Sample" node to the "Color" input of the square tile.

 

Now to apply the rotation effect to the disc, use a Time node or any node that provides a time value and connect this node to a Transform 2D node.

 

Once all this is done, You need to connect the Transform 2D node to the Position 2D node to control the rotation offset.

Then set the material to update at 60 fps in the render settings..

 

This was of course for a simpler application of the idea so I could take this solution in manageable steps.

 

I have yet to implement it but it shows promise.

 

Anyway thanks again.

 

Umar AR

 

 

 

 

 

 

 

 

davescm
Community Expert
Community Expert
July 6, 2023

Strange instructions. As far as I know there is no Position 2D node or Time node in Substance Designer.

 

You can get the current pixel position within a function, e.g. in the pixel processor, using a Get node to read the variable $Pos.

Similarly there is no time node - but again you can read a system variable $time with a get node in a function.

https://helpx.adobe.com/substance-3d-designer/function-graphs/variables/system-variables.html

 

The Substance engine though does not directly support animation

 

Dave

Umar AR
Umar ARAuthor
Inspiring
July 7, 2023

Thanks for your help Dave

davescm
Community Expert
Community Expert
July 6, 2023

I'm interested in how you will use a material triggered to update in a loop for presumably for  a video.

Sampling a point colour is very easy using a pixel processor function with a sample node.

So to read an input bitmap at a specified point and output a single colour based on that point

 

The pixel processor function is very simple :

 

However that relies on it reading an input bitmap not a moving image. Using such a material in a continuous moving way i.e. updating the input bitmap x times per second is not the way Substance Designer was created so you would need to work out how to do that outside of Designer

 

 

Dave