3
$\begingroup$

Is there a way to sample the color at a particular point on the mesh's surface?

enter image description here

Let's take this cube for example. It has a procedural texture applied on an emission material in cycles (but I'm open to solutions in BI or regardless of the rendering engine).

If I would simplify this question, how would I iterate over surface points and then check if each is black or white?

Is there a way to access the RGB value of a surface point prior to or after rendering? Even a vertex would do if there's no way to access the color at a surface point, but I'm looking for a more flexible solution.

It would be best if this can be achieved without baking to a UV mapped image, but if there's no other way, how would one go about accessing the data then?

$\endgroup$
6
  • $\begingroup$ What will you do with these values once you obtain them? Will the goal be another image in Blender or something else? $\endgroup$ Commented Feb 28, 2016 at 18:03
  • $\begingroup$ @atomicbezierslinger, generally I want to generate a new mesh from the texture. let's say sample the white points on the textured mesh with 1000 surface points as vertices and generate a mesh from them. $\endgroup$
    – TLousky
    Commented Feb 28, 2016 at 18:26
  • $\begingroup$ This gave a visual [appearance] of a plane with texture raised. All the vertices are still there. Plane with photographs. The original question had a photograph that corresponded with the images in the answer. Noise was present. Your images have no noise. blender.stackexchange.com/questions/16516/… $\endgroup$ Commented Feb 28, 2016 at 19:07
  • $\begingroup$ Thanks @atomicbezierslinger. A displacement map did come to mind of course, but I'm looking for a more controllable, precise and low level solution (that will also be relevenat for non grayscale textures). $\endgroup$
    – TLousky
    Commented Feb 28, 2016 at 19:40
  • $\begingroup$ You can evaluate noise, using the mathutils.noise module $\endgroup$ Commented Feb 28, 2016 at 23:25

2 Answers 2

4
$\begingroup$

Particle System

  • You can generate cubes or other as particles.
  • Convert them in the modifier panel.
  • Join them into Single Mesh
  • Vertex [Remove Doubles] may produce large surfaces if desired

enter image description here

Above image. Plane with UV Map Bounds. Particle System Grid Resolution 50. Adjust to Needs.

enter image description here

Image above. Particle System Texture affects density. Blender Internal Render.

enter image description here

Image Above. Converted Particles with [Convert] in Edit Mode.

enter image description here

Image Above. Vertex Remove Doubles with a Tolerance. Only the top surface had Remove Doubles. The original cubes had spaces for sake of explanation

enter image description here

Above image. Sphere shape which is a high density Cube to Sphere Transform. UV Mapped while in Cube appearance. Thus 6 repeating UV faces even though the repetition is difficult to see.

$\endgroup$
4
  • $\begingroup$ Nice one! That definitely helps, as I can then access the particle data directly and use the coordinates. $\endgroup$
    – TLousky
    Commented Feb 28, 2016 at 20:15
  • 1
    $\begingroup$ Hopefully one candidate for a start. $\endgroup$ Commented Feb 28, 2016 at 20:27
  • $\begingroup$ Hmm, you used a plane and rendered a rectangular density map then. So I guess this will need to be baked on a UV mapped object to work with 3D objects? $\endgroup$
    – TLousky
    Commented Feb 28, 2016 at 20:47
  • 1
    $\begingroup$ Edit above. Yes UV Map. $\endgroup$ Commented Feb 28, 2016 at 21:18
0
$\begingroup$

You can check the RGB values of every pixel in any image opened in the Image Editor, including renderings.

Just render your image and hold left-click on it. You can see the RGBA and HSV values in the bottom of the window.

Note that if your Emission shader has the Strength value over 1.0 the results may differ with the actual texture's values.

$\endgroup$
2
  • $\begingroup$ I'm not looking for rendered image pixel values (that is indeed quite simple), but rather for the color values at particular points on the mesh surface. $\endgroup$
    – TLousky
    Commented Feb 28, 2016 at 18:32
  • $\begingroup$ Oh, sorry. You said "prior or after render". That was actually a silly answer then :-/ $\endgroup$ Commented Feb 28, 2016 at 18:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .