Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

PS Filter: Sculptie Mosaic

Abu Nasu
Code Monkey
Join date: 17 Jun 2006
Posts: 476
03-22-2008 07:39
So, like an idiot, I did a sculptie shader for 3DS Max. Since then, something about the shader has been vexing me. That thing being that the shader doesn't really care one bit about vertexes in a manner meaningful to sculpties. I did eventually manage to get precise sculpties out of 3DS Max, but it's a very long and ugly hack. Different way to get some precision out of Max and into a sculptie? I hope so.

After a great deal of messing around and confusing myself to no end, I came up with an algorithym that I think works.

The only problem I have is that my time in SL is very limited. OpenGL keeps crashing and I don't want to risk loosing the other work I have going on in the background. Hopefully in a few days I can hack our LAN and get some serious testing done. The only testing that I've done is with type Plane and it looks good me thinks. I really can't wait to see how friendly it is with other sculptie types.

So, let's say you create a plane primitive in Max using 33x33 and mangle it into something. Then you use the shader method to get the sculptie map out. Let's say that the rendered sculptie map is 512x512. You know, big just in case.

Load that into Photoshop and hit Filter > Tech Slop > Sculptie Mosaic. Hopefully you will end up with a bunch of squares. But if you look a bit closer at the edges, you will notice something a bit different.

Assuming the map is 512x512, try this:
- set grid to 16 and turn it on (or is it 8?)
- Pencil tool with Square 8 brush
- make sure Snap is turned on

You should now be able to precisely place 'vertices' with the Pencil tool.

Hopefully.

I'm not entirely positive, but the method used in Sculptie Mosaic should be similiarly friendly with the other sculptie types. And should also be friendly with the flip and invert technique for mirroring.

But it's still going to be awhile before I can give it a real work-out.

Even if you don't use 3DS Max or Photoshop, you can still play with it if you have a compatible host that can load Photoshop plug-ins.

Quick note: Sculptie Mosaic is beta and has no real error checking. If you feed it with powers of two, it should work. I did test 128x128, 256x256, and 512x512. If you get funky with the dimensions, it might get funky right back at you.

I have to disappear for awhile, but I'll be listening just in case someone feels the need.
Abu Nasu
Code Monkey
Join date: 17 Jun 2006
Posts: 476
03-24-2008 02:24
Seriously, this rocks. It all makes perfect sense now.

Vert count like this:
v0, v1, v2... v30, v31, v32

Let's say you are making a sculpt map that is 128 wide. That gives little boxs of verts that are 4 verts wide.

So, the columns of verts are grouped like this:
v0,v1,v2,v4 ... v5,v6,v7,v8 ..... v29,v30,v32,v32

Notice that the vert count goes from 0 to 32. This gives a total of 33 verts in each xy direction. You know, 32-0+1=33. Something like that.

The problem is the stitching on the right side for spheres, cylinders, and toruses. To fix this, I've seen people adjusting the pattern on the right like this:

v24,v25,v26,v26 ... v28,v29,v30,v31 ... v32,v33

That is, the last column is split in half and the left is copied over to the last half column.

It's a fine hack, but can cause a problem with the seams when doing the invert + flip hack. That pattern and some sculptie hacks just don't play nice. This is especially true when trying to do the mirror hack on a very precise sculpt map that relies on the stitching.

What happens when you mirror hack a precise sculpt map that relies on the stitching? This happens on the left:

v0,v1 ... v2,v3,v4,v5 ... v6,v7,v8,v9...

And that throws off the whole thing. It offsets or shifts everything and your precise seam is in the wrong place.

Meh!

So I left all of that behind and decided to think like a 3d program. If this is my mesh and this is my uv map, where are the verts?

That question is what led me to Sculptie Mosaic and a pattern that is 'proper'.

Rather than split the last column - split the first column, split the last column, and shift everything over by half of a block. The pattern is now:

v0,v1 ... v2,v3,v4,5 ...... v28,v29,v30,v31 ... v32,v33

That gives 33 columns that are symmetrical. There is a half column on each side and 31 columns in the middle.

Because it's symmetrical, the mirror hack holds up. And it's consistant with how uv maps are sampled.

(I might have to clarify the uv thing later and get into how stitching works.)

With this epiphany, I've been playing with hacking Sculptie Mosiac. I now have a perfect methodology, model, process or whatever for making some seriously cool parametric-ish filters for Photoshop. Imagine being able to make a perfectly precise sculptie table with your own parameters with naught but a filter host. "Oh, I want the top to be this thick and the legs to be this thin. And place the legs this far from the table top edges."

It's been a good day.
Aki Shichiroji
pixel pusher
Join date: 22 Jul 2006
Posts: 246
03-25-2008 14:28
From your enthusiasm and description, I'd love to try and get this working, but honestly have no clue how to do so. Your .zip file includes an .8bf file... where should this go (on both Mac or PC) and how might one go about activating it in Photoshop? Is this exclusive to CS3? or can users of CS and CS2 use it as well?

Would it be possible also to provide some visual reference for what you are describing?
_____________________

Also See: Blog | Flickr | Illustration
Abu Nasu
Code Monkey
Join date: 17 Jun 2006
Posts: 476
03-26-2008 02:17
Sorry. Sometimes I assume too much and forget to recap certain particulars.

TS_sculptiemosaic.8bf is in the zip. The *.8bf extension means that is a Adobe Photoshop plug-in filter. Put it in your filter directory and start Photohsop. With an appropriate sculptie map open, hit Filter > Tech Slop > Sculptie Mosaic and it should do it's magic.

The filter folder for Photoshop is usually something like:
C:\Program Files\Adobe\CS2\Plug-Ins\Filters

PC only
RGB 8-bit
Should work with nearly every program that can load *.8bf files.


I've got a rather extensive background when using Photoshop do to particular things. It took me just over 2 years to write some of the most extensive tutorials on a certain subject. This subject is actually very similiar to how sculpties work. As such, I'm used to working and thinking in 'sculptie'. That is, my old bag of tricks certainly apply.

When sculpties first appeared, I did say that I would write up some good tutorial stuff, but I've been holding back on that. Why? Because there were still some technical things that I didn't quite understand. When I did Sculptie Mosaic, the final piece fell into place and I am now ready to start writing some uber sculptie tutorials. I really don't like writing in-depth and extensive tutorials until I totally understand things in a fundamental, nuts-n-bolts kind of way.

I'm about half way done with my Scuptie Table A filter. Once I get this done to my satisfaction, then I'll start actually writing tutorials.
Infiniview Merit
The 100 Trillionth Cell
Join date: 27 Apr 2006
Posts: 845
03-26-2008 03:17
Wow!

I do know how to install plugins and I do still think I know how to make sculpties.
But this is over my head hate to admit, yet fascinating and impressive nonetheless.
I am pretty sure it is the numbers, I am a bit alergic to certain kinds sometimes I can wrap
my head around them with long periods of medititive concentration..seriously. :)

Nice work Abu, I am intimidated yet strangely drawn to it, hehe. I will def keep my eye
out for those tutorials.

I know Amonom Marvin does some really cool sculpts purely from PS, yet this sounds like more than that.