1
$\begingroup$

I have a text object that I want to mask behind another object. However in order to do this, I need to use render layers, where they become separate and I have to recombine them later on. Is there a way for me to mask certain objects out but still normally show the rest without using render layers?

$\endgroup$
  • 1
    $\begingroup$ Hello. Which renderer are you using ? Can you provide a picture of the text and the masking object ? $\endgroup$ – lemon Jul 31 '16 at 7:21
  • $\begingroup$ I'm using blender render. I can easily use different render layers to mask the text but I have to combine the two render layers afterwards in another program and I'm too lazy to do that. I am using a default text object and a plane. The only thing I'm doing with the text object is changing the font and the font size. The plane should not be visible in the render since It's only meant to partially block the view of the text object but not the rest of the other objects. $\endgroup$ – Bradman175 Jul 31 '16 at 8:18
  • $\begingroup$ and the final result is for rendering in Blender only or is it to export after that into another program which will have to reproduce this effect ? $\endgroup$ – lemon Jul 31 '16 at 8:25
  • $\begingroup$ It is for rendering in blender only. $\endgroup$ – Bradman175 Jul 31 '16 at 8:50
  • $\begingroup$ I have a solution but this is not with a plane. This is with nodes in which you can vary coordinates "like if" it is a plane. Can that meet your need ? $\endgroup$ – lemon Jul 31 '16 at 10:08
1
$\begingroup$

You can obtain this effect with nodes :

enter image description here

Here is the node setting (blender render) :

enter image description here

  • On the left, position and size of the faked plane (use these coordinates in place of a plane object)
  • Combine RGB node are here to create vectors from these previous coordinates
  • Just below we use the global coordinates of the text object
  • 'BetweenVector' is a node group explained below. Its aim is to test if the text coordinates are inside the fakes plane coordinates
  • Next two nodes 'substract' and 'multiply' are here to invert the previous output which comes from 0 to 1 and becomes 1 to 0
  • All this is connected to the alpha socket of the output
  • Above, the material which can be the material you want

BetweenVector node group :

enter image description here

  • Uses 'separate RGB' as if it was 'separate XYZ'
  • Position and Size are added in order to calculate the coordinate limit
  • Then each coordinate is tested to see if it is in the limits (Between node group does that, see below)
  • The two 'multiply' on the right are here to have '1' if all the coordinates are between the limits or '0' if not

Between node group :

enter image description here

  • This group tests individual values in order to see if they are in the limit
  • It determinates min and max limits
  • Then tests the input to see if is it in the limits

$\endgroup$
  • $\begingroup$ @Bradman175, yes but if we read the question, he does not want to use layers, or I did not understand well ? (I may have misunderstood, english is not native for me) $\endgroup$ – lemon Jul 31 '16 at 10:38
  • $\begingroup$ Actually you are right. I did state that I did not want to use layers because I was oblivious of the fact that compositor nodes to combine layers exist. I will mark you as correct. It actually would be useful if you got a lot of text and you don't want to use up your layers $\endgroup$ – Bradman175 Jul 31 '16 at 10:39
  • $\begingroup$ @Bradman175, ok thanks... you should give the correct answer to Selman as he learned you about the compositor. $\endgroup$ – lemon Jul 31 '16 at 10:44
  • $\begingroup$ Although I did use his method, he hasn't fully answered the question as I had to figure out the rest myself. And your way would come in handy if I ever needed to save the amount of layers I use. $\endgroup$ – Bradman175 Jul 31 '16 at 10:47
  • $\begingroup$ Hi @lemon , great job, what if we would like to another shape say triangle or circle or an animated shape? How in your opinion it could be done? $\endgroup$ – johnconnor Jun 7 at 14:49
2
$\begingroup$

My first thought was to use the compositor and render-layers (and recombine in compositor), should be easy enough? But maybe its easier to set the material of the covering object to transparent, mask, and alpha 0. Should hide the text, right?

$\endgroup$
  • $\begingroup$ What is a compositor? You should outline how to combine 3 render layers into one output. $\endgroup$ – Bradman175 Jul 31 '16 at 10:10
  • $\begingroup$ I figured it out now but you should have said something like "Go to nodes, go to composite mode, make sure your scene(first option in properties menu)>shading>alpha is set to transparent, tick use nodes, get all the render layer nodes you need, use mix nodes>set them to add and add all the render layer nodes (image to image node connectors) and output them into the compositor, then when you render you click the composite layer." $\endgroup$ – Bradman175 Jul 31 '16 at 10:22
  • $\begingroup$ So you went from not knowing what "a compositor" is to understanding that in 12 minutes, you sharp! Tried the second suggestion using materials? $\endgroup$ – Selman Jul 31 '16 at 10:29
  • $\begingroup$ Well I have used it before, I just never knew what it was called. Just add in more specific details on how to do what you said otherwise people who legitimately do not know what a compositor is will be confused. $\endgroup$ – Bradman175 Jul 31 '16 at 10:30
  • $\begingroup$ Oh whoops. Don't colour add the layers. Use alpha over. $\endgroup$ – Bradman175 Aug 1 '16 at 6:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.