Urho3D Wiki
(Added bricks quad texture)
Tags: Visual edit apiedit
(Added note to pnoise)
Tags: Visual edit apiedit
Line 5: Line 5:
 
This article shows how to use a 4 dimensional noise in Blender to create seamless textures. This works by simulating a [https://en.wikipedia.org/wiki/Clifford_torus Clifford_torus] and is inspired by these articles:
 
This article shows how to use a 4 dimensional noise in Blender to create seamless textures. This works by simulating a [https://en.wikipedia.org/wiki/Clifford_torus Clifford_torus] and is inspired by these articles:
 
* http://www.gamedev.net/blog/33/entry-2138456-seamless-noise/
 
* http://www.gamedev.net/blog/33/entry-2138456-seamless-noise/
* http://opengameart.org/forumtopic/seamlessly-tiled-procedural-texture-generation.
+
* http://opengameart.org/forumtopic/seamlessly-tiled-procedural-texture-generation
   
 
This is done with the Cycles renderer, the node editor and the Open Shading Language (OSL) feature.
 
This is done with the Cycles renderer, the node editor and the Open Shading Language (OSL) feature.
  +
  +
'''Note:''' OSL seems to also have a "periodic" noise function called "pnoise" which should be seamless (I guess), but it doesn't seem to be working at all in Blender. It is not seamless and the input seems to be quite ignored.
   
 
You can download the Blender file here: http://files.gawag.org/Seamless_Procedural_Textures4.blend. After opening the file with Blender you should see this (it's created with Blender 1.73a):
 
You can download the Blender file here: http://files.gawag.org/Seamless_Procedural_Textures4.blend. After opening the file with Blender you should see this (it's created with Blender 1.73a):

Revision as of 03:08, 9 July 2015

This article shows how to use a 4 dimensional noise in Blender to create seamless textures. This works by simulating a Clifford_torus and is inspired by these articles:

This is done with the Cycles renderer, the node editor and the Open Shading Language (OSL) feature.

Note: OSL seems to also have a "periodic" noise function called "pnoise" which should be seamless (I guess), but it doesn't seem to be working at all in Blender. It is not seamless and the input seems to be quite ignored.

You can download the Blender file here: http://files.gawag.org/Seamless_Procedural_Textures4.blend. After opening the file with Blender you should see this (it's created with Blender 1.73a):

Blender seamless texture-0

The node editor in the lower left shows the "procedural_material" material. It uses a "seamless_noise" node group to generate a noise (this group is used twice, see the left two nodes) and then creates a normal and a diffuse map out of it. There are some node frames with short explanations to describe the different sections.

The node group consists of mainly three parts: UV to 4D special shape transformation, a 4D noise generator using OpenShadingLanguage (see text editor in the top left) and a RGB to grey converted as the noise is colored at first (which could be also useful to generate material). Node groups can be entered using tab.

There are two output nodes on the right side, the upper one is for the normal map and the lower one for the diffuse map. Currently the upper one is the active one (simply click on the one to activate) and therefore the 3D window on the right shows the diffuse map on the 4x4 field of planes. The view is automatically updated when something in the node editor is changed.

Press F12 to render the texture, it can be saved from there. There is an orthogonal camera above a single plane that is capturing the whole seamless texture.

Examples for in Blender generated diffuse and normal map with this method

Urho Blender seamless procedural material

This material in Urho3D. Diffuse and normal map:

Urho material file:

<material>
<technique name="Techniques/DiffNormal.xml"/>
<texture name="Textures/blender_diff.png" unit="diffuse"/>
<texture name="Textures/blender_norm.png" unit="normal"/>
<parameter name="MatDiffColor" value="1.0 1.0 1.0 1"/>
<parameter name="MatSpecColor" value="2.5 2.5 2.5 30"/>
</material>

Bricks

Urho Blender seamless procedural material bricks

This material in Urho3D. Diffuse, normal and specular map:

Blender seamless texture bricks

This material is made similar to the brick material made with NeoTextureEdit to see if Blender can be a full alternative: It's quite close, but there is no blur.

The Blender file can be got here: http://files.gawag.org/Seamless_Procedural_Textures_tiles3.blend

The noise node group has been modified to also export the colored noise which is used to distort the generated brick pattern. A brick pattern shader has been written to get a brick pattern with softer edges as Blender's own brick pattern has.

Urho material file:

<material>
<technique name="Techniques/DiffNormalSpec.xml"/>
<texture name="Textures/blender_bricks_diff.jpg" unit="diffuse"/>
<texture name="Textures/blender_bricks_norm.jpg" unit="normal"/> <texture name="Textures/blender_bricks_spec.jpg" unit="specular"/>
<parameter name="MatDiffColor" value="1.0 1.0 1.0 1"/>
<parameter name="MatSpecColor" value="2.5 2.5 2.5 30"/>
</material>

Bricks as a "Quad Texture"

Urho quad texture

This Blender project is similar to the one before. But the different textures are now in one big image (this makes creating the textures in Blender much more convenient):

Blender bricks quad

Diffuse, normal, specular and height map. The height map is not used yet, it could be used for parallax mapping or for height mapping. This quad material requires a special shader, see Quad Texture

The Blender file can be got here: http://files.gawag.org/Seamless_Procedural_Textures_tiles_quad3.blend