Decorated pig

Damm acid rain. Poor pig.:wink:

...that's because you don't see the sweeter side :tongue:

great one Tonio, it has a lot of potential :icon_thumbup:

cheers,
Alessandro
 

Attachments

  • Tiramisu.jpg
    Tiramisu.jpg
    52.2 KB · Views: 1,288
  • Tiramisu.c3dmat.zip
    16.7 KB · Views: 571
Fake Glass Pig

Martin's fake glass, in case anybody missed it first time around. :icon_thumbup:
 

Attachments

  • Screen shot 2010-08-02 at 21.37.52.png
    Screen shot 2010-08-02 at 21.37.52.png
    260.1 KB · Views: 1,289
  • fake.glass.c3dmat.zip
    15.4 KB · Views: 603
Nice plating Archie. I'd love to use a similar technique for my bake but I can't use either procedural 3d space or UVs since the model is horribly complex, has no UVs, and no local coordinate spaces for its components (very frustrating actually). I ended up using voronoi (constant) instead of cellnoise because cellnoise makes it so much more obvious how bad it is.
 
The second metal plate material is good for a star ship! This is the "star-ship-pig" :)
Good work archie!
 
UV Indirection

I just realized that one of the things I've been asking Martin for (tilable bitmap samplers as per Groboto) can in fact be done using the existing material system, and in fact it represents a very powerful hybrid technique for using procedural textures in a controlled way. (It also gives me an idea for a very useful utility program for creating new tiling materials.)

The basic idea is that you use an image as a "sampler", in other words instead of the pixel you get based on a UV coordinate being the color you use in your material, it's the UV (or RG -- red green) coordinate of the sample you take from the next image in the food chain. (See diagram.)

The red/green/yellow things are "sampler" images that map an incoming UV coordinate to a new UV coordinate. The first is the "identity" -- it doesn't do anything, but it's useful for creating other samplers. The next is the one used for the metal pig. The next is a "brick" sampler.

The beauty of this technique is that it lets you grab pieces of a non-tiling image and create a tiling material. It also lets you grab portions of an image and render arbitrary pieces of them (at arbitrary scales and angles) in the final material.

And you're not limited to sampling bitmap -- you can use the same technique to sample procedural materials.
 

Attachments

  • full metal pig.jpg
    full metal pig.jpg
    70.3 KB · Views: 1,292
  • sampler diagram.jpg
    sampler diagram.jpg
    64.1 KB · Views: 1,309
  • identity sampler.jpg
    identity sampler.jpg
    30.6 KB · Views: 1,265
  • brick sampler.jpg
    brick sampler.jpg
    36.2 KB · Views: 1,276
  • Plating Sampler.jpg
    Plating Sampler.jpg
    46.7 KB · Views: 1,288
Last edited:
Here's a version of the material used — I replaced the source bitmap with a procedural node to keep the file size down. It also illustrates the idea of using a bitmap sampler image to sample a procedural node. Not all procedural nodes work this way (cellnoise for example does not).
 

Attachments

  • Plating Sampler.c3dmat.zip
    104.8 KB · Views: 600
More complex example of the same idea

Here's a considerably more complex example of the same idea, using the brick sampler (and a mask for handling the mortar).

Note that the "mortar" is a tiling sampler of the original image created by using composited red and green clouds — so it's basically grabbing continuous random samples from the source AND it tiles.
 

Attachments

  • quartz brick.jpg
    quartz brick.jpg
    91.2 KB · Views: 1,457
  • brick diagram.png
    brick diagram.png
    133.8 KB · Views: 1,454
very interesting !

i think putting a spatial gradient into a position is basically scaling.
like when you are walking in a slow train at the same speed, the velocities ad up, the speed doubles.
when you walk the other way they cancel and you stay in place related to the outside.
so when you put the state's uv into a node's position you do a scaling x2.
when you invert the uv you freeze the node, it will show the origin's pixel color all over.
i see that red means u and green v but have not yet figured out why the uv colors are always blueish like normal maps (put the uv into the diffuse of the pig material). maybe blue means height and is set to one by default ?

- archie

Screen shot 2010-08-06 at 11.26.35 AM.png


update:
now this is way better than my approach.
there are artifacts depending on the image filtering that perfectly support the metal effect :smile:
thanks tonio !

View attachment samplat2.c3dmat.zip

samplat2.jpg
 
Last edited:
The only fly in the ointment is that there seems to be a bug in the state node such that its UV1 output doesn't actually match UV1 output (you can verify this by building a simple image -> diffuse material then adding a state node and feeding its UV1 into the texture's position -- very odd.

I've reported this to Martin (it's causing the seams you can see in some of the bricks, which should not be there).

The problem doesn't affect sampling of tiling or procedural textures as badly, but it's a problem nonetheless since the whole point of this approach is to sample non-tiling bitmaps to create tiling patterns.

And yes, you get artifacts which may enhance OR detract from the quality of the material. If you use very high resolution sampling bitmaps the artifacts are pretty much negligible.

The blue part of the UV coordinates is just garbage (I guess they're actually UVW and W is always 1 or something).

i think putting a spatial gradient into a position is basically scaling.
like when you are walking in a slow train at the same speed, the velocities ad up, the speed doubles.
when you walk the other way they cancel and you stay in place related to the outside.
so when you put the state's uv into a node's position you do a scaling x2.
when you invert the uv you freeze the node, it will show the origin's pixel color all over.
i see that red means u and green v but have not yet figured out why the uv colors are always blueish like normal maps (put the uv into the diffuse of the pig material). maybe blue means height and is set to one by default ?

No, it's sampling. An RGB color is a 3d vector on [0,1]. A UV coordinate is a 2D vector on R which wraps onto [0,1] when sampling bitmaps — but C3D passes around UV coordinates as 3d vectors (UVW). So think of each pixel in the "sampling" map as a UV coordinate encoded as Red and Green — it's the location of the pixel you want from the next image map along (hence "indirection").

So the identify sampler maps uvs onto themselves. To create your own samplers, simply grab regions of the identify map and build your own collage. You can rotate them too (but don't do funky things like blur them as this will have very weird effects).

Finally — the reason for the artifacts is that when you get to a boundary in the collage you're suddenly interpolating between arbitrary coordinates instead of neighboring coordinates. (This is also why blurring, etc., tends to be a bad idea. It's not doing what you might think it's doing.)
 
Last edited:
Note: to eliminate an issue with the sampler-based shaders, set the UV scale in the sampled image / texture nodes to 0.001, 0.001.

Shown is: the fix, the problem in render, the fix in render. (Look for seams in the middle of "bricks")
 

Attachments

  • Screen shot 2010-08-15 at 10.15.49 PM.png
    Screen shot 2010-08-15 at 10.15.49 PM.png
    41.7 KB · Views: 1,309
  • problem pig.jpg
    problem pig.jpg
    95.8 KB · Views: 1,297
  • fixed pig.jpg
    fixed pig.jpg
    103.1 KB · Views: 1,297
Fractal Fever

Here's a simple one...
 

Attachments

  • Fractal Fever.jpg
    Fractal Fever.jpg
    108 KB · Views: 1,176
  • Fractal-TT.c3dmat.zip
    21.6 KB · Views: 584
Back
Top