is it possible to change a material depending on whether it is intersecting with another object?Fake Bool operation with OSL shaderIs it possible to copy a certain property of a certain material to other materials?Material that's only visible if seen through another materialHow to find and change material for certain faces?Holdout plus glass shader problem!How to render material with alpha channel seen through material with haloHow to change edit material assignments after joining meshesHow to link a variable of a material to another material?How can i change the color of a material created with the PBR addonswap one material with another
What's the biggest difference between these two photos?
Why would an airport be depicted with symbology for runways longer than 8,069 feet even though it is reported on the sectional as 7,200 feet?
Bit floating sequence
The meaning of "offing" in "an agreement in the offing"
What makes an ending "happy"?
Schrodinger's Cat Isn't Meant To Be Taken Seriously, Right?
How strong is aircraft-grade spruce?
Are professors obligated to accept supervisory role? If not, how does it work?
How to finish my PhD?
Template default argument loses its reference type
The Green Glass Door, Revisited
How can faith be maintained in a world of living gods?
Does the word voltage exist in academic engineering?
Did "Dirty Harry" feel lucky?
Entering the US with dual citizenship but US passport is long expired?
Do you need to burn fuel between gravity assists?
Yet another calculator problem
Should I tip on the Amtrak train?
I won a car in a poker game. How is that taxed in Canada?
After a few interviews, What should I do after told to wait?
indexes are not created on localdb
Problem with ls inside bash script
How invisible hand adjusts stock prices if company is listed on multiple exchanges, under multiple currencies, and one of the currencies plunges?
Furthest distance half the diameter?
is it possible to change a material depending on whether it is intersecting with another object?
Fake Bool operation with OSL shaderIs it possible to copy a certain property of a certain material to other materials?Material that's only visible if seen through another materialHow to find and change material for certain faces?Holdout plus glass shader problem!How to render material with alpha channel seen through material with haloHow to change edit material assignments after joining meshesHow to link a variable of a material to another material?How can i change the color of a material created with the PBR addonswap one material with another
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
$begingroup$
Let's say I have a sphere, halfway intersecting with a cube(which is invisible to the camera). I want to change the material of the part of the sphere that is intersecting with the box, similar to this image:

materials geometry
$endgroup$
add a comment |
$begingroup$
Let's say I have a sphere, halfway intersecting with a cube(which is invisible to the camera). I want to change the material of the part of the sphere that is intersecting with the box, similar to this image:

materials geometry
$endgroup$
$begingroup$
With a cube, it wouldn't be necessary, but in some situations, OSL might help
$endgroup$
– Robin Betts
4 hours ago
add a comment |
$begingroup$
Let's say I have a sphere, halfway intersecting with a cube(which is invisible to the camera). I want to change the material of the part of the sphere that is intersecting with the box, similar to this image:

materials geometry
$endgroup$
Let's say I have a sphere, halfway intersecting with a cube(which is invisible to the camera). I want to change the material of the part of the sphere that is intersecting with the box, similar to this image:

materials geometry
materials geometry
asked 8 hours ago
snipers500snipers500
921 silver badge7 bronze badges
921 silver badge7 bronze badges
$begingroup$
With a cube, it wouldn't be necessary, but in some situations, OSL might help
$endgroup$
– Robin Betts
4 hours ago
add a comment |
$begingroup$
With a cube, it wouldn't be necessary, but in some situations, OSL might help
$endgroup$
– Robin Betts
4 hours ago
$begingroup$
With a cube, it wouldn't be necessary, but in some situations, OSL might help
$endgroup$
– Robin Betts
4 hours ago
$begingroup$
With a cube, it wouldn't be necessary, but in some situations, OSL might help
$endgroup$
– Robin Betts
4 hours ago
add a comment |
3 Answers
3
active
oldest
votes
$begingroup$
You could create 2 spheres on the exact same position, each with its own texture, then 1 cube. Give each sphere a Boolean modifier, one with the Difference mode, the other with the Intersect mode, and both with the cube as Object. This way, when you'll move the cube, it will both hide a sphere and reveal the other one.

$endgroup$
$begingroup$
Thanks, I ended up using this method, (which also happened to be the way I made the reference image, so I'm just dumb)
$endgroup$
– snipers500
7 hours ago
1
$begingroup$
Could work with only one cube, I think. using intersection and difference.
$endgroup$
– lemon
6 hours ago
$begingroup$
oh yes of course, I'm going to correct
$endgroup$
– moonboots
6 hours ago
add a comment |
$begingroup$
An update, thanks to moonboots comments:
It is possible using Cycles:

The shader simply tests if the transparent depth is at least 1 as the cube is transparent but also we don't want more than one (as if not the cube shape may appear in non ortho views):


$endgroup$
$begingroup$
I thought you had the solution but actually what you propose is to display another texture through the cube transparency, which is not exactly what he's looking for, at least it's what I understand
$endgroup$
– moonboots
6 hours ago
$begingroup$
@moonboots, don't get what you mean
$endgroup$
– lemon
6 hours ago
$begingroup$
Could you please share your file?
$endgroup$
– moonboots
6 hours ago
$begingroup$
@moonboots, sure: updated above
$endgroup$
– lemon
6 hours ago
1
$begingroup$
so yes, that's what I thought, actually the new texture is not displayed at the objects intersection but where the transparency happens, which is not the same... On the left what is supposed to happen, on the right what happens with your method: zupimages.net/up/19/36/tl1c.jpg
$endgroup$
– moonboots
6 hours ago
|
show 2 more comments
$begingroup$
"Dynamic paint" could be the way to go. Check YouTube for a tutorial on that. For example: https://www.youtube.com/watch?v=PcWXFtnh2bk
$endgroup$
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "502"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fblender.stackexchange.com%2fquestions%2f151049%2fis-it-possible-to-change-a-material-depending-on-whether-it-is-intersecting-with%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
You could create 2 spheres on the exact same position, each with its own texture, then 1 cube. Give each sphere a Boolean modifier, one with the Difference mode, the other with the Intersect mode, and both with the cube as Object. This way, when you'll move the cube, it will both hide a sphere and reveal the other one.

$endgroup$
$begingroup$
Thanks, I ended up using this method, (which also happened to be the way I made the reference image, so I'm just dumb)
$endgroup$
– snipers500
7 hours ago
1
$begingroup$
Could work with only one cube, I think. using intersection and difference.
$endgroup$
– lemon
6 hours ago
$begingroup$
oh yes of course, I'm going to correct
$endgroup$
– moonboots
6 hours ago
add a comment |
$begingroup$
You could create 2 spheres on the exact same position, each with its own texture, then 1 cube. Give each sphere a Boolean modifier, one with the Difference mode, the other with the Intersect mode, and both with the cube as Object. This way, when you'll move the cube, it will both hide a sphere and reveal the other one.

$endgroup$
$begingroup$
Thanks, I ended up using this method, (which also happened to be the way I made the reference image, so I'm just dumb)
$endgroup$
– snipers500
7 hours ago
1
$begingroup$
Could work with only one cube, I think. using intersection and difference.
$endgroup$
– lemon
6 hours ago
$begingroup$
oh yes of course, I'm going to correct
$endgroup$
– moonboots
6 hours ago
add a comment |
$begingroup$
You could create 2 spheres on the exact same position, each with its own texture, then 1 cube. Give each sphere a Boolean modifier, one with the Difference mode, the other with the Intersect mode, and both with the cube as Object. This way, when you'll move the cube, it will both hide a sphere and reveal the other one.

$endgroup$
You could create 2 spheres on the exact same position, each with its own texture, then 1 cube. Give each sphere a Boolean modifier, one with the Difference mode, the other with the Intersect mode, and both with the cube as Object. This way, when you'll move the cube, it will both hide a sphere and reveal the other one.

edited 6 hours ago
answered 7 hours ago
moonbootsmoonboots
21.2k2 gold badges15 silver badges32 bronze badges
21.2k2 gold badges15 silver badges32 bronze badges
$begingroup$
Thanks, I ended up using this method, (which also happened to be the way I made the reference image, so I'm just dumb)
$endgroup$
– snipers500
7 hours ago
1
$begingroup$
Could work with only one cube, I think. using intersection and difference.
$endgroup$
– lemon
6 hours ago
$begingroup$
oh yes of course, I'm going to correct
$endgroup$
– moonboots
6 hours ago
add a comment |
$begingroup$
Thanks, I ended up using this method, (which also happened to be the way I made the reference image, so I'm just dumb)
$endgroup$
– snipers500
7 hours ago
1
$begingroup$
Could work with only one cube, I think. using intersection and difference.
$endgroup$
– lemon
6 hours ago
$begingroup$
oh yes of course, I'm going to correct
$endgroup$
– moonboots
6 hours ago
$begingroup$
Thanks, I ended up using this method, (which also happened to be the way I made the reference image, so I'm just dumb)
$endgroup$
– snipers500
7 hours ago
$begingroup$
Thanks, I ended up using this method, (which also happened to be the way I made the reference image, so I'm just dumb)
$endgroup$
– snipers500
7 hours ago
1
1
$begingroup$
Could work with only one cube, I think. using intersection and difference.
$endgroup$
– lemon
6 hours ago
$begingroup$
Could work with only one cube, I think. using intersection and difference.
$endgroup$
– lemon
6 hours ago
$begingroup$
oh yes of course, I'm going to correct
$endgroup$
– moonboots
6 hours ago
$begingroup$
oh yes of course, I'm going to correct
$endgroup$
– moonboots
6 hours ago
add a comment |
$begingroup$
An update, thanks to moonboots comments:
It is possible using Cycles:

The shader simply tests if the transparent depth is at least 1 as the cube is transparent but also we don't want more than one (as if not the cube shape may appear in non ortho views):


$endgroup$
$begingroup$
I thought you had the solution but actually what you propose is to display another texture through the cube transparency, which is not exactly what he's looking for, at least it's what I understand
$endgroup$
– moonboots
6 hours ago
$begingroup$
@moonboots, don't get what you mean
$endgroup$
– lemon
6 hours ago
$begingroup$
Could you please share your file?
$endgroup$
– moonboots
6 hours ago
$begingroup$
@moonboots, sure: updated above
$endgroup$
– lemon
6 hours ago
1
$begingroup$
so yes, that's what I thought, actually the new texture is not displayed at the objects intersection but where the transparency happens, which is not the same... On the left what is supposed to happen, on the right what happens with your method: zupimages.net/up/19/36/tl1c.jpg
$endgroup$
– moonboots
6 hours ago
|
show 2 more comments
$begingroup$
An update, thanks to moonboots comments:
It is possible using Cycles:

The shader simply tests if the transparent depth is at least 1 as the cube is transparent but also we don't want more than one (as if not the cube shape may appear in non ortho views):


$endgroup$
$begingroup$
I thought you had the solution but actually what you propose is to display another texture through the cube transparency, which is not exactly what he's looking for, at least it's what I understand
$endgroup$
– moonboots
6 hours ago
$begingroup$
@moonboots, don't get what you mean
$endgroup$
– lemon
6 hours ago
$begingroup$
Could you please share your file?
$endgroup$
– moonboots
6 hours ago
$begingroup$
@moonboots, sure: updated above
$endgroup$
– lemon
6 hours ago
1
$begingroup$
so yes, that's what I thought, actually the new texture is not displayed at the objects intersection but where the transparency happens, which is not the same... On the left what is supposed to happen, on the right what happens with your method: zupimages.net/up/19/36/tl1c.jpg
$endgroup$
– moonboots
6 hours ago
|
show 2 more comments
$begingroup$
An update, thanks to moonboots comments:
It is possible using Cycles:

The shader simply tests if the transparent depth is at least 1 as the cube is transparent but also we don't want more than one (as if not the cube shape may appear in non ortho views):


$endgroup$
An update, thanks to moonboots comments:
It is possible using Cycles:

The shader simply tests if the transparent depth is at least 1 as the cube is transparent but also we don't want more than one (as if not the cube shape may appear in non ortho views):


edited 5 hours ago
answered 7 hours ago
lemonlemon
21.7k1 gold badge19 silver badges55 bronze badges
21.7k1 gold badge19 silver badges55 bronze badges
$begingroup$
I thought you had the solution but actually what you propose is to display another texture through the cube transparency, which is not exactly what he's looking for, at least it's what I understand
$endgroup$
– moonboots
6 hours ago
$begingroup$
@moonboots, don't get what you mean
$endgroup$
– lemon
6 hours ago
$begingroup$
Could you please share your file?
$endgroup$
– moonboots
6 hours ago
$begingroup$
@moonboots, sure: updated above
$endgroup$
– lemon
6 hours ago
1
$begingroup$
so yes, that's what I thought, actually the new texture is not displayed at the objects intersection but where the transparency happens, which is not the same... On the left what is supposed to happen, on the right what happens with your method: zupimages.net/up/19/36/tl1c.jpg
$endgroup$
– moonboots
6 hours ago
|
show 2 more comments
$begingroup$
I thought you had the solution but actually what you propose is to display another texture through the cube transparency, which is not exactly what he's looking for, at least it's what I understand
$endgroup$
– moonboots
6 hours ago
$begingroup$
@moonboots, don't get what you mean
$endgroup$
– lemon
6 hours ago
$begingroup$
Could you please share your file?
$endgroup$
– moonboots
6 hours ago
$begingroup$
@moonboots, sure: updated above
$endgroup$
– lemon
6 hours ago
1
$begingroup$
so yes, that's what I thought, actually the new texture is not displayed at the objects intersection but where the transparency happens, which is not the same... On the left what is supposed to happen, on the right what happens with your method: zupimages.net/up/19/36/tl1c.jpg
$endgroup$
– moonboots
6 hours ago
$begingroup$
I thought you had the solution but actually what you propose is to display another texture through the cube transparency, which is not exactly what he's looking for, at least it's what I understand
$endgroup$
– moonboots
6 hours ago
$begingroup$
I thought you had the solution but actually what you propose is to display another texture through the cube transparency, which is not exactly what he's looking for, at least it's what I understand
$endgroup$
– moonboots
6 hours ago
$begingroup$
@moonboots, don't get what you mean
$endgroup$
– lemon
6 hours ago
$begingroup$
@moonboots, don't get what you mean
$endgroup$
– lemon
6 hours ago
$begingroup$
Could you please share your file?
$endgroup$
– moonboots
6 hours ago
$begingroup$
Could you please share your file?
$endgroup$
– moonboots
6 hours ago
$begingroup$
@moonboots, sure: updated above
$endgroup$
– lemon
6 hours ago
$begingroup$
@moonboots, sure: updated above
$endgroup$
– lemon
6 hours ago
1
1
$begingroup$
so yes, that's what I thought, actually the new texture is not displayed at the objects intersection but where the transparency happens, which is not the same... On the left what is supposed to happen, on the right what happens with your method: zupimages.net/up/19/36/tl1c.jpg
$endgroup$
– moonboots
6 hours ago
$begingroup$
so yes, that's what I thought, actually the new texture is not displayed at the objects intersection but where the transparency happens, which is not the same... On the left what is supposed to happen, on the right what happens with your method: zupimages.net/up/19/36/tl1c.jpg
$endgroup$
– moonboots
6 hours ago
|
show 2 more comments
$begingroup$
"Dynamic paint" could be the way to go. Check YouTube for a tutorial on that. For example: https://www.youtube.com/watch?v=PcWXFtnh2bk
$endgroup$
add a comment |
$begingroup$
"Dynamic paint" could be the way to go. Check YouTube for a tutorial on that. For example: https://www.youtube.com/watch?v=PcWXFtnh2bk
$endgroup$
add a comment |
$begingroup$
"Dynamic paint" could be the way to go. Check YouTube for a tutorial on that. For example: https://www.youtube.com/watch?v=PcWXFtnh2bk
$endgroup$
"Dynamic paint" could be the way to go. Check YouTube for a tutorial on that. For example: https://www.youtube.com/watch?v=PcWXFtnh2bk
answered 8 hours ago
mccmcc
4141 silver badge10 bronze badges
4141 silver badge10 bronze badges
add a comment |
add a comment |
Thanks for contributing an answer to Blender Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fblender.stackexchange.com%2fquestions%2f151049%2fis-it-possible-to-change-a-material-depending-on-whether-it-is-intersecting-with%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
$begingroup$
With a cube, it wouldn't be necessary, but in some situations, OSL might help
$endgroup$
– Robin Betts
4 hours ago