Sun, Oct 6, 7:32 AM CDT

Renderosity Forums / Poser - OFFICIAL



Welcome to the Poser - OFFICIAL Forum

Forum Coordinators: RedPhantom

Poser - OFFICIAL F.A.Q (Last Updated: 2024 Oct 05 8:40 pm)



Subject: Cycles - How to mask a box in two different colors?


3D-Mobster ( ) posted Thu, 12 January 2023 at 12:10 PM · edited Sun, 06 October 2024 at 7:30 AM

Does anyone know how to make it so you can colour a box with two separate colours using cycles?

So for instance, half the box is black and the other half white. Also so you can control how much of the box is black and how much is white?

Basically, a "hard edge" gradient between the colours if that makes sense. 




FVerbaas ( ) posted Thu, 12 January 2023 at 1:26 PM
Forum Coordinator

Use a position or gradient node to drive a math 'step' node that feeds into a Blender node. 

Note: The output of the position node as far as I  can remember is in 0.1 inch units. You therefore need to scale to your settings.


3D-Mobster ( ) posted Thu, 12 January 2023 at 2:04 PM

Sorry don't get that. 

I have nothing called a "position" node.

Can you show an example of how to link them together? 


VedaDalsette ( ) posted Thu, 12 January 2023 at 2:48 PM

Maybe this output?

YfoVLv1wknp80HPi2bKHXhCBoxEzEHkBa7dyitY1.png



W11,Intel i9-14900KF @ 3.20GHz, 64.0 GB RAM, 64-bit, GeForce GTX 4070 Ti SUPER, 16GB. 

Old lady hobbyist.

All visual art or fiction is "playing with dolls."


hborre ( ) posted Thu, 12 January 2023 at 3:15 PM

You might need to consider these nodes for a solution.

8q2PURAcMNqxgbkRVSW2J2p5tSHY2MqbUUlJKvlE.png


3D-Mobster ( ) posted Thu, 12 January 2023 at 3:49 PM

But how would I connect it to the colors as well?

I assume they have to go into the "Surface" node of "Cycle root", so there is Black and White there and then somehow the position or gradient node should be used to split the colors based on some value, but I don't see how one would connect it all to work like that? 


VedaDalsette ( ) posted Thu, 12 January 2023 at 3:59 PM · edited Thu, 12 January 2023 at 4:02 PM

Here's a Blender video on creating a gradient, and halfway through (at 3 minutes) it shows sharp lines. I could follow it with the Texture Coordinate, Mapping, and Separate XYZ nodes, but when it got to the color ramp node, I couldn't follow (translate to Poser Cycles), but maybe you can.

https://www.youtube.com/watch?v=ViqfL0LOwUM




W11,Intel i9-14900KF @ 3.20GHz, 64.0 GB RAM, 64-bit, GeForce GTX 4070 Ti SUPER, 16GB. 

Old lady hobbyist.

All visual art or fiction is "playing with dolls."


3D-Mobster ( ) posted Thu, 12 January 2023 at 4:17 PM

Thanks I looked through it and tried to copy it, but I don't see any "Colorramp" like the one he is using in Poser? So how would you get around that?

How anyone can make textures in cycles is beyond me :D


hborre ( ) posted Thu, 12 January 2023 at 4:38 PM

The Colorramp node does not exist in Poser.  


3D-Mobster ( ) posted Thu, 12 January 2023 at 4:52 PM

So how would you get around that? 

I am sure you can do it by mixing nodes like crazy :) But I don't really get the logic behind all these nodes, to be honest. So only use them for very specific tasks.


hborre ( ) posted Thu, 12 January 2023 at 5:01 PM · edited Thu, 12 January 2023 at 5:01 PM

Try this with a primitive cube to see if this is what you are trying to accomplish.

PVET5FGfTpJdmTxL5xKtqTTsQpLSjTn16mkFvgIi.png

This is what I am able to generate.

DjT8IKbensibIv5xAERhqs7f3uiHP5JZeImD8Wfm.png


hborre ( ) posted Thu, 12 January 2023 at 5:02 PM

Value_2 of the math node moves the edge left and right.


hborre ( ) posted Thu, 12 January 2023 at 6:22 PM

This is a better iteration.  The Math node is plugged into the Mix Color Factor thereby allowing you to control the color better.

ZIwIwoqgDqBUhHxZFmAEe25JpIkw8mvqUephOu5U.png


EVargas ( ) posted Thu, 12 January 2023 at 6:26 PM

If the cube/box geometry has that edge loop where you want to split colors, you can also assign separate materials for each side.

For example using the "Grouping Tool" / new, draw/marquee the faces, then choose "assign material" and name the new material. Repeat for the other side, or just use the existing one / default, then choose your colors.


EVargas.Art


hborre ( ) posted Thu, 12 January 2023 at 6:44 PM

Yes, that can work also.  In reality, everything hinges on UV mapping and how the sides are laid out.  This is very simplistic and uses procedurals to drive the colors.  It would be a different process if you were to include actual texture maps for the surfaces.


3D-Mobster ( ) posted Thu, 12 January 2023 at 6:45 PM

That seems to do what I need, will try to see if I can make it work. Thanks :)


hborre ( ) posted Thu, 12 January 2023 at 6:55 PM

BTW, which Poser version do you own?


3D-Mobster ( ) posted Thu, 12 January 2023 at 7:58 PM

Poser 11 will that cause issues?


hborre ( ) posted Thu, 12 January 2023 at 8:07 PM

Poser 11 does not have a PrincipledBsdf node, it was introduced into P12.  However, it won't have any problems when you plug it directly into the CyclesSurface node.  Let us know if everything works as it should.


EVargas ( ) posted Fri, 13 January 2023 at 4:49 AM · edited Fri, 13 January 2023 at 4:49 AM

Out of curiosity, thinking about backwards compatibility, what other Cycles/Shaders are missing on P11 when compared to P12? Here is P12:

SAbONuwOlbHPVSj634wz86HE2bE0C0l2N3KX0GYP.jpg


EVargas.Art


Y-Phil ( ) posted Fri, 13 January 2023 at 7:15 AM · edited Fri, 13 January 2023 at 7:15 AM
Online Now!

Tried this mat setup on Poser's hi-res sphere and this happened:

Vjzd07wXndlsexkPGSynR2rQiv9o7bXgFyhIgzAg.jpg

𝒫𝒽𝓎𝓁


(っ◔◡◔)っ

👿 Win11 on i9-13900K@5GHz, 64GB, RoG Strix B760F Gamng, Asus Tuf Gaming RTX 4070 OC Edition, 1 TB SSD, 6+4+8TB HD
👿 Mac Mini M2, Sonoma 14.6.1, 16GB, 500GB SSD
👿 Nas 10TB
👿 Poser 13 and soon 14 ❤️


hborre ( ) posted Fri, 13 January 2023 at 9:12 AM

Yep, that's why I mentioned that it is UV dependent and needs closer manipulation in the Material Room.


Y-Phil ( ) posted Fri, 13 January 2023 at 3:16 PM
Online Now!

hborre posted at 9:12 AM Fri, 13 January 2023 - #4453816

Yep, that's why I mentioned that it is UV dependent and needs closer manipulation in the Material Room.

Ok rs53NDTDIHpmBqKb0inf07kkMXJ4azm0LRW1vKHm.png

𝒫𝒽𝓎𝓁


(っ◔◡◔)っ

👿 Win11 on i9-13900K@5GHz, 64GB, RoG Strix B760F Gamng, Asus Tuf Gaming RTX 4070 OC Edition, 1 TB SSD, 6+4+8TB HD
👿 Mac Mini M2, Sonoma 14.6.1, 16GB, 500GB SSD
👿 Nas 10TB
👿 Poser 13 and soon 14 ❤️


Richard60 ( ) posted Sat, 14 January 2023 at 7:17 PM

For the Color Ramp that is missing in Poser you can go over to ShareGC dot com and look for the following  /v/96818/view/11/Poser/Poser-P11-Cycles-3-Color-Color-Ramp.  That has a shader made for Poser 11 up that will give you a 3 input color ramp.  Need more than 3 inputs then daisy chain them together.  The output of 1 into the input of the other one and then you will have 5 inputs.  The reason Poser does not have a color ramp like Blender is that Poser cannot handle variable number of inputs on a node. 

iz92j9cv1MCvFknrF6suGjV8YUNQJJ7oXH6XkfP0.png  

Above is a daisy chained Color Ramp.  You plug the Blue One (since that is the color showing) into the lowest color input on the Green One.  The reason to do that is the Input Factor of the Color Ramp is a value between 0 and 1.  So, for the input values of the Green One I have 0 to .3 Low .3 to .8 Mid and .8 to 1 for High. for the Blue One the values are 0 .1 and .2.  Now when the input value (coming from the MathFunctions Node) is between 0 and <.3 then the Green Node will show what is on the lowest color input in this case the color output of the Blue Node.  And when the input value is between 0 and <.1 then you get Red, between .1 and <.2 White and >=.2 Blue. And when the value goes above .3 the Green Node then selects either Mid or High and the Output of the Blue Node is unimportant since it no longer is being used.  And in this manner you can have a Blender Style Color Ramp so all those shaders that require a color ramp you can now do.

Poser 5, 6, 7, 8, Poser Pro 9 (2012), 10 (2014), 11, 12, 13


Richard60 ( ) posted Sat, 14 January 2023 at 7:21 PM

I added the Standard Poser Version of the Color Ramp they have as a comparison.  With the 3 input Color Ramp you can have a sharp cut as the input value gets to a specific value or like Blender you can have it blend between the two colors.  Also the 3 input allwos you to change the point where a color value comes into play.

Poser 5, 6, 7, 8, Poser Pro 9 (2012), 10 (2014), 11, 12, 13


hborre ( ) posted Sat, 14 January 2023 at 8:28 PM

I checked this arrangement and everything seems to agree with your comment except the arranged values between 0.1 and <0.2 will not give you White, it still shows Blue.


Richard60 ( ) posted Sat, 14 January 2023 at 10:50 PM

OK there seems to be a bug in the shader.  Change the White from 255,255,255 to 254,255,255 and it works.  Must be something about Pure White that the logic inside that node arrangement does not like.  

Poser 5, 6, 7, 8, Poser Pro 9 (2012), 10 (2014), 11, 12, 13


Richard60 ( ) posted Sat, 14 January 2023 at 11:13 PM

Lets amend that in that you cannot have a perfect shade of Gray.  So the RGB values cannot all be the same.  Make one channel diferent by 1 and it works.  All the same and it does not.  I recall that there are other areas that the 3 values cannot be the same. 

Poser 5, 6, 7, 8, Poser Pro 9 (2012), 10 (2014), 11, 12, 13


odf ( ) posted Sun, 15 January 2023 at 3:35 AM · edited Sun, 15 January 2023 at 3:38 AM
Online Now!

You could also simulate a color ramp by creating a gradient in another application, saving it as an image, and using it like so:

IGI0JFZh8kmpNnSboWPWQOfEc96teDNfqIwTAEuD.png

-- I'm not mad at you, just Westphalian.


hborre ( ) posted Sun, 15 January 2023 at 5:40 AM

But the illustration you're showing is not using the gradient image at all.  You're driving your gradient strictly from the TextureCoordinate node.


odf ( ) posted Sun, 15 January 2023 at 6:30 AM
Online Now!
hborre posted at 5:40 AM Sun, 15 January 2023 - #4453950

But the illustration you're showing is not using the gradient image at all.  You're driving your gradient strictly from the TextureCoordinate node.

Look again! The two ImageTexture nodes use the same gradient image. I added the bottom one which is not connected to anything in order to show what the raw gradient looks like. The preview of the top one shows the gradient applied to the incoming value from the Voronoi node.


-- I'm not mad at you, just Westphalian.


hborre ( ) posted Sun, 15 January 2023 at 6:55 AM

My bad.  I just looked again before refreshing the screen.  Yep, you're right.  It's early in the morning here.  

The problem is you have no control over the positioning of the gradient unless you include a Mapping node to modulate its location.


NikKelly ( ) posted Sun, 15 January 2023 at 11:23 AM

Have you a UV map for the object ?? Also solves issues around unsightly edges that do not 'tile'...


odf ( ) posted Sun, 15 January 2023 at 1:54 PM
Online Now!
hborre posted at 6:55 AM Sun, 15 January 2023 - #4453955

My bad.  I just looked again before refreshing the screen.  Yep, you're right.  It's early in the morning here.  

The problem is you have no control over the positioning of the gradient unless you include a Mapping node to modulate its location.

You’d use it the same way as a color ramp node in Blender. A value between 0 and 1 goes in, a color comes out. All the modulating happens beforehand. The main problem is that because the gradient would have to be produced in a different program, there’s even less direct feedback on what the final texture will look like. But honestly, if one wanted a decent user experience making procedural textures, one would simply do it in Blender and bake the textures for use with Poser.


-- I'm not mad at you, just Westphalian.


Richard60 ( ) posted Sun, 15 January 2023 at 6:00 PM

For anyone who may find this there is a simple fix to the 3 Color Color Ramp that you can find at ShareCG.  In the material room have the shader loaded and click the Little White Arrow into the open topped box third icon from the right.  This will expand the collapsed Nodes.  You are looking for the 8 nodes that are Cycles Color Math 6 of them start with IF in their name and the other 2 are "Low-Mid Color Mix" and "Mid-High Color Mix".  For all 8 of them change the Blend Type from Color to Mix and then click the Dark Arrow leaving the box upper left corner of the editing area.  Select just that Node and in the library for materials click the + button give it a new name and make sure it says Single Material and check the Selected nodes Only. Now you have a material that can use any of the True Gray scale colors and not have it have errors when being used.  The poser manual does not really say what or how the Blend Type of Color is supposed to be used.  I testing if it is Zero input then color input 1 is used only after that they blend and using a value of 1 does not make the color 1 disappear using color but it does if you use Mix.  

Poser 5, 6, 7, 8, Poser Pro 9 (2012), 10 (2014), 11, 12, 13


hborre ( ) posted Sun, 15 January 2023 at 6:47 PM

Excellent!  That explains and fixes that problem.  Thanks.


Y-Phil ( ) posted Mon, 16 January 2023 at 2:28 PM
Online Now!

This looks interesting but I definitely cannot do anything in this compound node: some nodes are probably hiding behind the Moon while others are probably  traveling near Alpha Centauri (hint: 4.7 light years away)
Impossible to move.
I had seen long time ago that there was somewhere a script to reorganize the nodes. I just checked with nodetidier but all it does is to delete the compound node.

Does anybody a solution that I haven't seen?

𝒫𝒽𝓎𝓁


(っ◔◡◔)っ

👿 Win11 on i9-13900K@5GHz, 64GB, RoG Strix B760F Gamng, Asus Tuf Gaming RTX 4070 OC Edition, 1 TB SSD, 6+4+8TB HD
👿 Mac Mini M2, Sonoma 14.6.1, 16GB, 500GB SSD
👿 Nas 10TB
👿 Poser 13 and soon 14 ❤️


hborre ( ) posted Mon, 16 January 2023 at 2:53 PM · edited Mon, 16 January 2023 at 2:53 PM

None of those node tidiers will work within a compound node.  From my experience with this particular compound node, when you enter the node the first set of subnodes you see will be the nodes to modify.  Just grasp the banners on the nodes and move them around; just clicking on the banner will bring the back nodes forward.  Don't try to scroll the page.  At worst, undock the Material Room Panel, and make it bigger for better access.


Y-Phil ( ) posted Tue, 17 January 2023 at 2:47 PM
Online Now!

Ok, I got it: when entering the compound node, for whatever reason, the node that exposes the outputs is located at a completely random location: something like (81, -2147483648)

I wrote this thingie to reset at a decent location  both the Input and the output.
Seems to work with P11 and P12. It simply rearrange any compound node's Input and Output nodes.

x = y = 10
mat = poser.Scene().CurrentMaterial()
for node in mat.ShaderTree().Nodes():
    compound_data = node.CompoundData()
    if not compound_data: continue
    for item in compound_data.ExposedOutputs():
        compound_data.SetExposedInputsLocation(x+1000, y)
        compound_data.SetExposedOutputsLocation(x, y)

𝒫𝒽𝓎𝓁


(っ◔◡◔)っ

👿 Win11 on i9-13900K@5GHz, 64GB, RoG Strix B760F Gamng, Asus Tuf Gaming RTX 4070 OC Edition, 1 TB SSD, 6+4+8TB HD
👿 Mac Mini M2, Sonoma 14.6.1, 16GB, 500GB SSD
👿 Nas 10TB
👿 Poser 13 and soon 14 ❤️


hborre ( ) posted Tue, 17 January 2023 at 3:31 PM

YAY!  IT WORKS.


Y-Phil ( ) posted Tue, 17 January 2023 at 3:42 PM · edited Tue, 17 January 2023 at 3:42 PM
Online Now!

nJnd8fU8LR8mRSLj6jzcXTstqlkwLiw7wZ8tWzGX.png 

.

𝒫𝒽𝓎𝓁


(っ◔◡◔)っ

👿 Win11 on i9-13900K@5GHz, 64GB, RoG Strix B760F Gamng, Asus Tuf Gaming RTX 4070 OC Edition, 1 TB SSD, 6+4+8TB HD
👿 Mac Mini M2, Sonoma 14.6.1, 16GB, 500GB SSD
👿 Nas 10TB
👿 Poser 13 and soon 14 ❤️


Privacy Notice

This site uses cookies to deliver the best experience. Our own cookies make user accounts and other features possible. Third-party cookies are used to display relevant ads and to analyze how Renderosity is used. By using our site, you acknowledge that you have read and understood our Terms of Service, including our Cookie Policy and our Privacy Policy.