Pages: [1]
|
 |
|
|
Author
|
Topic: RGB matte with 50 surfaces? (Read 2017 times)
|
marc Hermitte
Pixlet
Offline
Posts: 1
|
Hello! I'm trying to use shadermeister to output a color matte for architectural rendering. How can I have the color randomly asigned to my surfaces without 2 similar colors" touching" each other in my image? (not limited to 3 RGB colors either) Is there a way to setup lots of surfaces without having to set up each surface manualy? And how can I connect more than 3 nodes (RGB) in the color override input?
Thank you!
Marc
|
|
|
|
|
Logged
|
|
|
|
|
lightwolf
|
Hello! I'm trying to use shadermeister to output a color matte for architectural rendering. How can I have the color randomly asigned to my surfaces without 2 similar colors" touching" each other in my image? (not limited to 3 RGB colors either) Is there a way to setup lots of surfaces without having to set up each surface manualy? And how can I connect more than 3 nodes (RGB) in the color override input?
Thank you! Marc Hi Marc. This is suprisingly tricky. The point of RGB mattes in general is to have three complete separate channels with antialiasing at the edges. This is the main difference to using the surfaceID (which would be possible as well) as that doesn't provide any AA. A pixel then either belongs to a surface or not. I can't think of a simple way at the moment, especially not one that automatically avoids the touching... unless you end up using 50 different colours in the end (but then again, that's like using the surfaceIDs). Some even use RGB mattes with negative values... so you either have 1.0 or -1.0 for the blue channel (as an example) which at least allows you to encode 6 different "colours" in a simple RGB image - but you then need a compositing tool that can extract them properly. Unfortunately you also can't connect more than RGB to the RGB override, however, you might able to write to the other buffers. I'll check this out and do some other small tests tomorrow and will get back to you. Cheers, Mike
|
|
|
|
|
Logged
|
|
|
|
|
lightwolf
|
Hi Marc, I've just coded a small node for you (which will be a part of the free db&w Tools V1.5).
Shoot me a mail with your platform and I'll send you a copy to try out.
Cheers, Mike
|
|
|
|
|
Logged
|
|
|
|
|
lightwolf
|
Sneak preview...
[ Attachment: You are not allowed to view attachments ]
Cheers, Mike
|
|
|
|
|
Logged
|
|
|
|
MrWyatt
Kilo Pixel Renderer

Offline
Posts: 94
infiniMap User
|
looks like a node that cycles through r,g and b but getting darker witch each iteration. is that about right ? if so can it be scaled in a way that we can have values greater than 1 so it would cycle like 1 red, 1 green, 1 blue, 2 red, 2 green, 2 blue, ...etc? that would be pretty handy. although one would have to clamp the values in comp to retain the mask needed and don't know how well the contours would hold up. I guess AA would go out the window, but this could prove really useful nonetheless. btw. can I have it ? intel mac flavour please.
|
|
|
|
|
Logged
|
|
|
|
|
lightwolf
|
looks like a node that cycles through r,g and b but getting darker witch each iteration. is that about right ?
Close. Basically: It starts off with 0.5 as the initial number It takes the index number, looks at the lowest bit. If the bit is odd it adds 0.25 to the number If the bit is even then it subtracts 0.25 The index is shifted by one bit, and the value to be added/subtracted is halved. This loops until the index is 0 The only exception is the object ID 0, this is when it returns 1.0. 0 is never returned. A sequence would thus be: 1.0, 0.5, 0.75, 0.25, 0.125, 0.675, 0.375 and so on... (more or less). The more id's there are, the smaller the difference between the output values. But they never overlap (within the floating point limits that is). For the RGB output the ID is divided by three first, and the remainder determines which of the three channels it's writing into. Basically it's a variant of the Hammersley Sequence that is used in quasi-monte carlo sampling. And you'll get your copy as well, I'll be doing some backlog OS X work tomorrow anyhow. Cheers, Mike
|
|
|
|
|
Logged
|
|
|
|
|
lightwolf
|
I forgot to mention the AA. I haven't actually tested it yet. But is basically has the same downsides as a straight ObjectID pass and will certainly not AA as nicely as a proper RGB matte does. However (and this needs testing) I can imagine it to be a little better as plain object ID pass.
It's certainly not as easy to extract the masks though, I guess a colour key needs to be used.
Cheers, Mike
|
|
|
|
|
Logged
|
|
|
|
MrWyatt
Kilo Pixel Renderer

Offline
Posts: 94
infiniMap User
|
I played around trying to do the same with a couple of modulus nodes and a few logic nodes, but only got to the point where my objects got randomly colored red, green or blue. didn't figure out how to be able to tone them down with each iteration. let alone that trying to do that by hand in the node editor would need far too many nodes to be comfortable. having all of that in a single node will be really cool. btw. what does the scalar output do? and is this Obj Number output on the extended spot info node also new, as the one I have doesn't have such an output?
|
|
|
|
|
Logged
|
|
|
|
|
lightwolf
|
I played around trying to do the same with a couple of modulus nodes and a few logic nodes, but only got to the point where my objects got randomly colored red, green or blue. didn't figure out how to be able to tone them down with each iteration. let alone that trying to do that by hand in the node editor would need far too many nodes to be comfortable. having all of that in a single node will be really cool. You need to be able to loop. btw. what does the scalar output do? The same thing, but without the division by three to spread it into three channels. I.e. it could be fed into a gradient node that maps the range from 0.0 to 1.0 to... whatever. and is this Obj Number output on the extended spot info node also new, as the one I have doesn't have such an output?
Yes, that on is new. It's basically the same as the ID, but masked so that it starts from 0 (internally, object IDs have a hex 100000000 or something like that added to distinguish them, basically, some flags in the upper end of the number to distinguish between lights, cameras, items and bones). I just want to double check the cache node for effectiveness before it goes public, but you'll get a beta before that. Cheers, Mike
|
|
|
|
|
Logged
|
|
|
|
|
Pages: [1]
|
|
|
 |