Image output for Cycles, how to do it?

I’m trying to “substance design” Blender, I’m creating a library of procedural materials and I would like to use them to create tillable textures. As you may know procedural cycles textures (like the noise one) are not tillable.

It is possible to create a tillable texture using bake and a torus geometry like in this tutorial:

Also this image can be illustrative:

I have been testing with different torus “proportions” and still not found the right one, but technically it works.

Now that we have real-time preview of cycles textures in the view port (2.78) I was wondering if its possible to output that color information directly an a image (image editor) and then save the image or apply it to a object.

You could ask why? well I think that could be faster than bake and may be it have the possibility to extract several channels like diffuse normal roughness etc… at once. Also you can re-use that same image in another material all at the same time.

It is possible to create costume nodes in cycles but I’m not sure if its possible to create output nodes with just python or you need to touch blender hardcore code.

Here a fake screenshot of the idea:

May be all this is already planed for 2.8, and it will be a waste of time to do it for 2.7x series… not sure about that?

Any help or comment about that would be great.

@doublebishop Thanks man, But I already know how to bake textures I’m thinking to extract this information in another way more like “substance designer” does.

Create a simple plane, simple unwrap so it takes up the entire uv space, bake that.

@doublebishop thanks man but that will not create a tillable texture.

So, here are the test I have been doing trying to find the “perfect torus”, I started with a cylinder that have the right proportions so when you uv-unwrap it have a uv that are a perfect square, so when you bake that you have a perfect tillable texture in one axis. From that one I have been trying to create a perfect torus bending it. But not rally happy with the result, textures are tillable but the deformation is too bad. May be someone with better geometry understanding can give it a try?

Blend file:

images of the process:

pd: image 4 is a torus with 0 internal radius, not a sphere.

I think this may help.

@erdinc Really interesting, thanks for that, but I want to reproduce the tillable effect in 3D first, to better understand it. May be I can try to make the cylinder efect in nodes, that one already works in one axis.

The last one looks okay in my eyes. If you want to bake to a square image you can always premultiply everything that deals with the y axis to scale it. Keep in mind BI may have some better nodes that can be used, but I haven’t done this myself in BI only in Cycles and only as testing. I would try to limit use of tiled textures on connected surfaces only (sphere, torus, cylinder etc) where it is absolutely crucial if you can’t just hide the seam, and try to find other means for large planes etc because tilings here are easily visible. I will tile, but I will make effort to hide the fact.

Can I remind you that we have a series of support forums where you are able to post support questions !

Moved from ‘General Forums / Blender and CG Discussion’ to ‘Support / Materials and Textures’

Here is an idea.
Maybe you can use opengl render
But first you need to use this script. (After unwrapping the uvs of the torus, and happy with your procedural texture alignment.)
This script will flatten the torus. (It will be similar to the existing uv map, so how you unwrap the uvs is very important.)
Then, create an ortographic camera and align it to the top. (You can play with camera’s ortographic scale to exactly match the flattened torus)
Also, set the render resolution to a square ratio.
Switch to the ortho cam.
And, you can render with the opengl with lightning speed :slight_smile: and hopefully the result will be tileable .

@erdinc that’s super cool I will try that, I couldn’t find the perfect torus proportion yet but that could be the solution once I have it and actually I can try it already.

Looks like its impossible to get rid of the distortion:
may be if I apply the same distortion but inverted will fix that an will work for any torus geometry… but no idea how to do that in nodes… there is no UV distortion node as far as I know.

Also I was trying to generate the cylinder (that unfolds in a perfect square) projection so at least could work on the tilling in on direction but it doesn’t quite work yet.

Here is my last try. I got rid of the distortion (sort of) but now there is the mirroring effect.

Ehm, no. Mirroring is to be considered a last resort hack. Basically: Currently without 4D inputs you can’t obtain seamless simple textures without distortion (torus) or variable density (the mixing curves linked above which I have also explored). For busy textures you can sometimes get away with torus radius 1 and 0.25 re-mapped back with 4:1 scale, but it’s probably project specific what you can get away with and wouldn’t work nicely with a simple voronoi. So I wouldn’t use this to “build a library” (I kind of missed that).

With 3D inputs you can achieve nice blending, but so far I’ve only achieved one axis, and it will have density change (offset sawtooth and sawtooth mixing). Using 4D in the past in other sw, I believe iirc I could get x-axis tiling without density change (but density would always be constant doubled, which is ok in most cases), or tiling in both directions with density change so would work ok with normal noise but not so much for a simple voronoi.

4D inputs (for noise, voronoi etc) is something I greatly desire. Used regularly, animating the 4th input with time, it would mean a cut object wouldn’t have the pattern “moving” through it spatially, it would simply be evolving gradually. Repeat switches would also be more than welcome.

All that being said, why on earth would you use Blender in the first place to create such an image based texture library? With it’s lacking tools, it’s just not a good choice - stick to substance designer :slight_smile: Or ask devs for changes needed to do so. As now it’s quirky and often not satisfactory.

@erdinc Good idea, I have some similar results always with mirroring :S

@CarlG I haev been creating this library in different project using Cycles,substance is great I have used in other projects, I think that if i find a good way to do that could be very useful for the community, but seams to be quite complicated.