A new version of Cineversity has been launched. This legacy site and its tutorials will remain accessible for a limited transition period

Visit the New Cineversity
   
 
Shader Tiling Question
Posted: 06 September 2015 06:21 PM   [ Ignore ]  
Total Posts:  19
Joined  2014-05-01

I am trying to create the look of regular holes over a irregular low poly surface. I am using a material with transparency using a tiled 2D Circular shader. The problem is that I need control of the hole positions so that they are a little closer to each other along the X axis than along the Y axis all the while keeping the shapes circular.

I am attaching a simple scene file with a plane with the current inadequate material as well as a JPG of how I imagine the shader might tile if only I could control the tiling distribution spacing better.

By the way, I have watched the Dr. Sassi’s tutorial here at Cineverity on creating holes but it doesn’t seem to apply for this application because my surfaces are so irregular. Further, I want to keep the overall polygon count low if possible.

Just in case the attachment doesn’t show, I am including this WeTransfer link:

http://we.tl/anjk5JnlJs

File Attachments
Shader_2.zip  (File Size: 136KB - Downloads: 201)
Profile
 
 
Posted: 06 September 2015 07:07 PM   [ Ignore ]   [ # 1 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

Hi Pablum Picasso,

The simplest way would be with a single image. Just a quarter circle of two circles in each corner [centered] and then tiled and set to seamless.

I guess you have a reason for the “shader” use here, e.g., animate the size or other attributes.

To keep things flexible means sometimes that the prep-work is more complex.

I have attached a solution with the Spline Shader. I place the Circle Spline in one corner of the shader and adjusted the scale for X and Y independently. As this shader is always a square, I have first to set the XY scale correctly, then counter that in the Tile settings of the Texture Tag.
With the patter you like to have, a second Spline Shader is used for the other “corner” of the square. Same set up.

Both are combined and inverted (Colorizer) in a Layer Shader.

It might seems a little bit counter intuitive at first, but one time to get the hang out of it, it is simple. One could even set up an XPresso, with a User-Data-Slider to make the process simpler. Adjust the size, as you wish.

Either way, this works as your image showed.

All the best

File Attachments
CV2_r16_drs_15_TXxy_01.c4d.zip  (File Size: 276KB - Downloads: 182)
 Signature 

Dr. Sassi V. Sassmannshausen Ph.D.
Cinema 4D Mentor since 2004
Maxon Master Trainer, VES, DCS

Photography For C4D Artists: 200 Free Tutorials.
https://www.youtube.com/user/DrSassiLA/playlists

NEW:

NEW: Cineversity [CV4]

Profile
 
 
Posted: 06 September 2015 07:25 PM   [ Ignore ]   [ # 2 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

P.S.: Alternative adjustment—here is a version closer to your image.

Going though both, might help to see the “inner mechanic”

Note that the preview is not representing the result, use the render or the interactive render region [IRR]

You can adjust the Spline, in Ellipse mode, and then change the Tile amount.

Let me know if that works for you. I can capture a little clip about the adjustment workflow.

File Attachments
CV2_r16_drs_15_TXxy_02.c4d.zip  (File Size: 269KB - Downloads: 183)
 Signature 

Dr. Sassi V. Sassmannshausen Ph.D.
Cinema 4D Mentor since 2004
Maxon Master Trainer, VES, DCS

Photography For C4D Artists: 200 Free Tutorials.
https://www.youtube.com/user/DrSassiLA/playlists

NEW:

NEW: Cineversity [CV4]

Profile
 
 
Posted: 06 September 2015 09:43 PM   [ Ignore ]   [ # 3 ]  
Total Posts:  19
Joined  2014-05-01

Thanks Doc,
I was not familiar with spline shaders so that was very instructive in itself.

I am not sure if I am understanding your scene file correctly but I am not able to adjust one spline shader’s row position independent of the other. However, I do see that I am able to adjust one shader’s size independent of the other (slick).

To make an analogy with typography, if these 2 spline shaders rows were there own lines of style or formatted type, I would want to be able to control their respective leading (or paragraph spacing) throughout independent of one another.

Thanks again

Profile
 
 
Posted: 06 September 2015 11:20 PM   [ Ignore ]   [ # 4 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

Nice that you got already something out of it, Pablum Picasso, thanks for the feedback.

To get the idea, and I knew that is a little bit twisted, I made a little clip for you.

https://www.amazon.com/clouddrive/share/2WpMoSug64n4HEX1HfQuePHqLfA8usCbznanv6D9mzt?ref_=cd_share_link_copy

The idea to have the two lines independent from each other is the idea here, but as we have no Font that we plot here, I used the Circle-Spline to fake that. (Yes, the Spline Shader has a font option with U and V spacing, but try for yourself, it doesn’t work very well with tiles.)

So, to use the Circle in U and V tiling, they needed to sit on the corners as a quarter circle, in that way they can follow.

However, it becomes tricky when the U and V ration is not the same (=1). Then the circle becomes an Ellipse, as the result from the Spline Shader is a square! To stretch that square we use the settings in the Texture Tag. But the resulting ellipse-shapes need the adjustment in the Circle Spline.

So first care about the structure, then about the Circle shape. Sometimes it doesn’t follow exactly a math base relation, see end of the clip—no idea why, BTW.

I hope that one minute clip allows to make this useable.


All the best

 Signature 

Dr. Sassi V. Sassmannshausen Ph.D.
Cinema 4D Mentor since 2004
Maxon Master Trainer, VES, DCS

Photography For C4D Artists: 200 Free Tutorials.
https://www.youtube.com/user/DrSassiLA/playlists

NEW:

NEW: Cineversity [CV4]

Profile
 
 
Posted: 08 September 2015 11:24 PM   [ Ignore ]   [ # 5 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

P.S.: I try to keep up with all the tools useable. (... typically at least one per month over the past two+ decades) Currently: Learning Fusion this month. So, I checked only a little bit into Substance Designer based on your question.
http://www.cineversity.com/vidplaylist/substance/substance_designer_for_c4d_part_10

I certainly need more time, but this is perhaps one of the most versatile texture generators, and which is connected to Cinema4D, that I have seen so far.

I certainly believe that my few minutes diving into it—shows, i.e., there is certainly much more possible. Perhaps you check for yourself :o) Nodal compositing (hence why I mentioned “Fusion”, or NUKE or a decade a go Shake or a little bit later Conduit for that reason) is certainly part of the future. With Fusion now for free, and open source solutions popping, I have no doubts.

Enjoy.

 Signature 

Dr. Sassi V. Sassmannshausen Ph.D.
Cinema 4D Mentor since 2004
Maxon Master Trainer, VES, DCS

Photography For C4D Artists: 200 Free Tutorials.
https://www.youtube.com/user/DrSassiLA/playlists

NEW:

NEW: Cineversity [CV4]

Profile
 
 
Posted: 09 September 2015 01:26 AM   [ Ignore ]   [ # 6 ]  
Total Posts:  19
Joined  2014-05-01

Hi Doc,
Substance Designer looks very good. Over the long term, that workflow seems to make a lot of sense. I just got sucked into a great presentation on Physically Based Rendering in Substance:

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

Thank you for sharing.

Profile
 
 
Posted: 09 September 2015 01:33 AM   [ Ignore ]   [ # 7 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

You’re welcome, Pablum Picasso.

I hope there is the solution available, ...combining some nodes.

Just to stress the point, It might be the simplest version to create an tile-able image in Ps and adjust this accordingly.

All the best

 Signature 

Dr. Sassi V. Sassmannshausen Ph.D.
Cinema 4D Mentor since 2004
Maxon Master Trainer, VES, DCS

Photography For C4D Artists: 200 Free Tutorials.
https://www.youtube.com/user/DrSassiLA/playlists

NEW:

NEW: Cineversity [CV4]

Profile
 
 
Posted: 09 September 2015 01:37 AM   [ Ignore ]   [ # 8 ]  
Total Posts:  19
Joined  2014-05-01

Thanks Doc,

That is the conclusion I have come to. But I really enjoy shaking out the options. I appreciate your time and attention.

Best!

Profile
 
 
Posted: 09 September 2015 01:31 PM   [ Ignore ]   [ # 9 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

Thanks for the feedback, Pablum Picasso, yes, sometimes the simplest workflow works best—but, yes, to have two sliders to adjust this would be preferable.

Good luck with the project.

 Signature 

Dr. Sassi V. Sassmannshausen Ph.D.
Cinema 4D Mentor since 2004
Maxon Master Trainer, VES, DCS

Photography For C4D Artists: 200 Free Tutorials.
https://www.youtube.com/user/DrSassiLA/playlists

NEW:

NEW: Cineversity [CV4]

Profile
 
 
Posted: 10 September 2015 07:42 PM   [ Ignore ]   [ # 10 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

Exploration and play:

R17

Preview clip one minute:
https://www.amazon.com/clouddrive/share/vPhur0EXyIvxGESqXnaknQAF2VlXpMw4G1Yaz04JtHh?ref_=cd_share_link_copy

Just a few examples with the new Formula Shader.

I have set up a rough formula that “writes’ spheres into the space (orange layer=global; green layer=local

Just open the file in R17 and press play, switch one object to active at once to see the effect.

The formula is pretty much six times the same, for each x-y-z two instance. Done. Why two times, as I played with multiplications as well [instead of adding], so I left it in for a quick experimentation.

?((((abs(sin(x/90)))+(abs(sin(x/90)))+(abs(sin(z/90)))+(abs(sin(z/90)))+(abs(sin(y/90)))+(abs(sin(y/90))))/6)>0.9;1;0)

Perhaps you get some ideas to “write” your pattern.

File Attachments
CV2_r17_drs_15_TXfo_01.c4d.zip  (File Size: 99KB - Downloads: 162)
 Signature 

Dr. Sassi V. Sassmannshausen Ph.D.
Cinema 4D Mentor since 2004
Maxon Master Trainer, VES, DCS

Photography For C4D Artists: 200 Free Tutorials.
https://www.youtube.com/user/DrSassiLA/playlists

NEW:

NEW: Cineversity [CV4]

Profile
 
 
Posted: 13 September 2015 01:00 AM   [ Ignore ]   [ # 11 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

R17 Formula Shader

clamp(0;1;(clamp(0;1;(?(((sin(((v*90)+3.2))*0.5)*(abs(sin((u*90)+1.6))*0.5))<0.16;1;0))))*(clamp(0;1;(?(((sin(((v*90)+0))*0.5)*(abs(sin((u*90)+0))*0.5))<0.16;1;0)))))

I hope that is the pattern you are after. It is tile-able. I left the +0 in the second part, so you can easily play with it.

The part for each row starts with the clamp() function, I hope that helps to get through it. Perhaps the clamp is not needed, it is more for safety in it, as the Formula Shader can produce values way above 100%, which might “shoot back” in 32bit/float…

Again, this is a rough version. Rough means here, that I used a short-cut. The creation of circles is not done by crossing two sin() functions, as it would result in a square. To avoid that square like appearance I limited it with the ?() function.


If you press play, the scene is animated to increase the Texture Tag tile number.

Enjoy

File Attachments
CV2_r16_drs_15_TXdr_03.c4d.zip  (File Size: 154KB - Downloads: 131)
 Signature 

Dr. Sassi V. Sassmannshausen Ph.D.
Cinema 4D Mentor since 2004
Maxon Master Trainer, VES, DCS

Photography For C4D Artists: 200 Free Tutorials.
https://www.youtube.com/user/DrSassiLA/playlists

NEW:

NEW: Cineversity [CV4]

Profile
 
 
Posted: 13 September 2015 01:52 AM   [ Ignore ]   [ # 12 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

R17 Formula Shader

Off Topic

Just for the fun, and not really related to your question.

Scene File:
https://www.amazon.com/clouddrive/share/YJWLJ2uj2nlTdGJnTWVOwoti26uXMs1Fjon9HMlG6ca?ref_=cd_share_link_copy

or a collection of variations (image on the right):
https://www.amazon.com/clouddrive/share/WquRcCa0SlXnrXSMgg6LWUchSTFe37gLOnePUaRM4a1?ref_=cd_share_link_copy
Six examples of the same set up, and creating variations with just the “Blend-Mode”. Lots to explore, even without formula changes.

Enjoy

/off topic

 Signature 

Dr. Sassi V. Sassmannshausen Ph.D.
Cinema 4D Mentor since 2004
Maxon Master Trainer, VES, DCS

Photography For C4D Artists: 200 Free Tutorials.
https://www.youtube.com/user/DrSassiLA/playlists

NEW:

NEW: Cineversity [CV4]

Profile