Traced Textures: A method for vector based resolution independent continously rasterized textures

Yeah, all the best ideas are the simple ones, this is great!

I just started looking at OSL so Im off to experiment now…

thanks again.

1 Like

Thank you all!

Please, experiment with it and help improve the technique!

2 Likes

this is a godsend. Thank you so much for making this and sharing it <3

1 Like

Thank you! I still owe you the perspective and shading chapter. Pretty busy last year.

whenever you find the time. I’d love to learn more about it.

I have not yet looked into the ray portal node from Blender 4.2 but when I first heard about it, I wondered if I could use it for something similar to your guide. Am I wrong in that regard, or could it maybe simplify the setup for you?

With the Ray Portal you trace a portion of your scene into a material, acting in a similar way as the OSL trace script does, and this could be a basic setup:


Swap the OSL script with a Ray Portal BSDF and you now trace wathever is in your scene (the mini-scene workflow still applies here) onto your object surface.
The main advantages are: you can render with GPU in Cycles (no OSL here) and you can get rid of the object flat-color routine (just assign textures and materials to your objects and they will be rendered into the final surface).
And the “continuous rasterize” effect works: textures animated in-scene and you can zoom in as you like without loosing detail.

BUT

Ray Portal BSDF, as its name tells, outputs a Closure. No color, no mask (at least at this moment). A final material. You cannot use your design to mix different materials into a final shader.
Here is an example using Traced Textures with an OSL script:


The can background and the text are in different mini-scenes and they are traced independently each generating its own mask, this way the background can be metallic and the text diffuse (like printed with different inks) via a masked MixShader node.

Also, while the Ray Portal effectively shades your objects, you will have to be careful with shadows and reflections.

There is no better method here, just use what fits better (OSL or Ray Portal) in each given scenario. Id suggest Ray Portal for its original purpose (portals and CCTV cameras) and OSL Traced Textures for Graphic elements and design compositions.

Also why not try to combine them? Shade your objects with Ray Portal and mask them with OSL. Just an idea.

Keep playing.

4 Likes

Excellent work, mate. I am guessing this can only work for simple scenes due to the fact you can’t place the vector textures far away from the object?
What about tiling textures?

Thank you!
I guess the rounding errors come from the traced objects being far from the origin, so theres no limit for the scene complexity, just keep the traced originals close to (0,0,0) and the rendered textured object wherever you want.

The explanation is some posts up in this thread, for seamless patterns, just create seamless geometry between the traced boundaries (usually a 1 unit square).

1 Like

Actually that’s a great idea, Thanks for the suggestion.
I have always wondered about resolution independent textures in Blender. Thanks for continuing research on its possibilities.

Wished there was gpu support for osl textures in Blender tbh.

1 Like

I am learning so much!