PDA

View Full Version : Blur Node?



wellsichris
06-19-2006, 11:44 AM
quick question. is there a blur node? basically I'm trying to do a crumple texture or any texture but want it softer. not so sharp edges. so if I could just pipe it through a blur node and then pipe it in that would be perfect.

so is there one and I just can find it. and if not how would this be done?

thanks
chris

Lightwolf
06-19-2006, 12:12 PM
No, there isn't. And you won't find one too soon, since the current system won't handle it. Basically because the shading system only evaluates one spot on the surface at any one time (which goes for procedurals as well).
To blur it would need to be able to look at the surrounding spots, which isn't possible.

I guess baking the procedural and then applying a blur in the image editor is your best bet.

Cheers,
Mike

Thomas M.
06-19-2006, 12:38 PM
I guess it shouldn't be a problem to do something like that, or? Can't you just average a view spots around the point you are looking for (Procedural textures)? I guess a blur node would be great. Something I wanted from time to time, too. Are the math functions an alternative to smoothen out the highlights and shadows of a procedural texture? Didn't manage to get an idea by now how they work.

Cheers
Thomas

Lightwolf
06-19-2006, 01:01 PM
Can't you just average a view spots around the point you are looking for (Procedural textures)?
Not with the currenty system. Even then, how many samples would you need (yes you could use some random sampling here)?

The current system works a lot like a shader, there is one spot being evaluated only, you can't tell the node graph to evaluate another spot from a node.
It might work with a node graph embedded in a custom "blurring" node. The custom node would take the current point to be samples, and depending on the blur settings, sample a number of points around it.

Cheers,
Mike - darn, you made me think about something new again ;)

wellsichris
06-19-2006, 01:55 PM
I guess it needs to be a feature request, because it could be very handy.

Like always,

thanks for the info Mike,

Chris

RedBull
06-19-2006, 02:01 PM
Yes this would help stop the dot crawl, pixel crawel problem that LWers complain about often when using procedurals.

A Blur Node would of been a good idea.

Bog
06-19-2006, 02:54 PM
Hmmm... it still is a good idea.

*thinky*

Could that be a way to get really fast blurred reflections, one wonders?

Lightwolf
06-19-2006, 03:44 PM
Could that be a way to get really fast blurred reflections, one wonders?
Well, the slowest thing about blurred reflections are the actual ray beeing traced. To the contrary, the more code between the raytracer and the code cause them to "blur", the slower...

In the case of the blur node it would be dog slow in most cases... Let's assume that the shading uses up 5% of the total render time per image pixel ... and every extra blur sample adds another 3-4%, this can quickly add up. At least for larger blurs and loads of samples.
Image based blurs (in compositing) are programmed a lot smarter than just: "look at the current pixel and the surrounding ones and average them". Otherwise they'd be a magnitude slower as well. Unfortunately, the optimizations you can use for plain images won't work in a shading system.

Cheers,
Mike

LightFreeze
06-19-2006, 04:01 PM
maybe you could use a similar algorithm as the fake SSS, if you knew how that works that is :stumped:

Pavlov
06-19-2006, 04:48 PM
by now you can blur procedural this way:

- apply an UVmap to the surface and apply a pure-white texture to it. This texture's resolution will matter, the larger the more precise the result.
- Into Image Editor/processing apply a "textured filter" and choose the prcedural texture you like.
- Then apply a Full precision blur.

Voilą, blurred procedurals.
And this way you can also easily drive them on UV; on the negative side, you will get tiles.
Not exactly what you asked but it works.

Paolo

wellsichris
06-20-2006, 09:30 AM
pavlov,

just tried your technique and it works. thanks for the help/tip.

Chris

duke
06-20-2006, 10:13 AM
I think that nodalideas plugin VisualTexture had a blur node (I remember the forum thread about it, and they put it in 1.3 or something), so it is possible, but I'm not sure how they went about it.

BazC
06-20-2006, 10:53 AM
by now you can blur procedural this way:

- apply an UVmap to the surface and apply a pure-white texture to it. This texture's resolution will matter, the larger the more precise the result.
- Into Image Editor/processing apply a "textured filter" and choose the prcedural texture you like.
- Then apply a Full precision blur.

Voilą, blurred procedurals.
And this way you can also easily drive them on UV; on the negative side, you will get tiles.
Not exactly what you asked but it works.

Paolo

That's amazing, I would never have guessed that would work! Thanks Paolo! It ought to be possible to create a blur node in that case surely?

Lightwolf
06-20-2006, 12:01 PM
It ought to be possible to create a blur node in that case surely?
Nope. This trick is like baking a procedural and then blurring it... but not a procedural is blurred during shading, but an image (generated from a procedural) is blurred prior to shading.

A blur node should, for example, be able to change the blur per shaded pixel.

Cheers,
Mike

BazC
06-20-2006, 12:10 PM
Nope. This trick is like baking a procedural and then blurring it... but not a procedural is blurred during shading, but an image (generated from a procedural) is blurred prior to shading.

A blur node should, for example, be able to change the blur per shaded pixel.

Cheers,
Mike

Thanks for the info Mike, I'll take your word for it since I don't really understand this stuff! :D Wouldn't it be possible to create a node that fakes it using a similar trick though?

Weepul
06-20-2006, 03:44 PM
It seems to me like it ought to be possible, at least in the form of a layer node. I've not actually used this plugin, but from time to time I've drooled over the procedural bump blurring capabilities of Evasion3D's HyperSmooth (http://www.evs3d.com/hs_lw_intro.html), which, I belive, works at least in part by averaging multiple evaluations of the procedural texture, each shifted in space slightly. This is currently possible to set up by hand in plain LW, but requires a significant number of copies of the texture for a smooth effect, making it prohibitively complicated to set up. It needs an automatic method to be practical.

The question is, can a node to that to procedurals that are hooked into it? (The layer node format would potentially make it easier since the node ought to be able to do stuff to the layers it contains, as opposed to having to communicate backward through a node linkage.)

Pavlov
06-20-2006, 03:48 PM
Yes i thought about it; it would require a slight animation on all axes, REpeat as End behavior or the procedural will move all around, and MB active - but you have REALLY no control this way.
Kinda an interpretation of Spinning light concept.

Paolo

wacom
06-20-2006, 05:03 PM
Could a blur node be combined with occlusion? Render the reflection, make an image, render the occlusion, use it's values to control the level of blur to the image, then re-apply it to the surface?

PS- this is another reason I want that RAY-Type node!

Lightwolf
06-20-2006, 06:04 PM
Could a blur node be combined with occlusion? Render the reflection, make an image, render the occlusion, use it's values to control the level of blur to the image, then re-apply it to the surface?

In a surfacing network it wouldn't work like that. You (and others) are thinking too much along the lines of compositing.
As far as the nodal flow of shading data is concerned, there is no such thing as an "image" to be passed around.

The nodal equivalent could be:
occlusion->occ_value
occ_value->blur_node[which contains: reflection sampler]

The sample would just trace one reflection ray. The Blur node would repeat what is inside the [] (in this case trace one reflection ray) as often as needed to achieve the desired blur. More likely would be a min/max setting for the number of samples that relate to occ_value going from 0 to 1.

This could of course be done with a soft reflection node that could take any number of samples as an input.

Cheers,
Mike

Lightwolf
06-20-2006, 06:08 PM
It seems to me like it ought to be possible, at least in the form of a layer node.
...
which, I belive, works at least in part by averaging multiple evaluations of the procedural texture, each shifted in space slightly.
Yup, that's pretty much it. If you run a complete shading tree through a monster like that it would be extremely slow in no time though. For a single procedural layer it would make more sense.

Basically two extra input parameters: spread and number of samples -> how far, and how many.

Cheers,
Mike

kmaas
06-20-2006, 08:33 PM
Well, the slowest thing about blurred reflections are the actual ray beeing traced. To the contrary, the more code between the raytracer and the code cause them to "blur", the slower...

Not necessarily. If you could have fewer raytraces to generate a regular blurred image, then blur the image, you wouldn't have to do as many raytraces. And, if you used a faster blurring algorithm like a box filter instead of a gaussian, it would go pretty quick. Granted, it wouldn't be nearly as accurate, but it would certainly have its uses.

kmaas
06-20-2006, 08:34 PM
But then, you're right Lightwolf, it'd be pretty much impossible to do in nodal (from what I understand of it).

CourtJester
06-22-2006, 03:49 PM
by now you can blur procedural this way:

- apply an UVmap to the surface and apply a pure-white texture to it. This texture's resolution will matter, the larger the more precise the result.
- Into Image Editor/processing apply a "textured filter" and choose the prcedural texture you like.
- Then apply a Full precision blur.

Voilą, blurred procedurals.
And this way you can also easily drive them on UV; on the negative side, you will get tiles.
Not exactly what you asked but it works.

Paolo

That's the "texture into image space" solution, one of my favorite hacks. There's lots of neat things you can do in here; for instance, you can apply one image to another, then animate it -- rotating, scrolling, zooming. ("Animate Filter" needs to be on for it to show up though). I once mapped a still of raindrops onto a dummy image, and then animated them in image Y to make them run down the pane; I then applied the result to geometry which I UVmapped to ensure that the droplets flowed "down" with gravity as the angle of the surface dictates.

Also, since this hack works in image space, you can use gradients to "sculpt" bumps in a more intuitive fashion (AFAIK we still can't really do this in node editor, but I've not set up the 9 beta just yet.)

Note: not only is the resolution limited to that of the dummy image, but so is the pixel depth. Use high-dynamic range to avoid posterization noise, especially for bumps.

Captain Obvious
06-22-2006, 04:16 PM
FWIW: Pixels 3D's Shadermaker Pro has a "blur" node, which I once tried to use for blurred reflections. It was REALLY REALLY REALLY SLOW...

Lightwolf
06-22-2006, 04:27 PM
If you could have fewer raytraces to generate a regular blurred image, then blur the image, you wouldn't have to do as many raytraces.
This is called reflection mapping ;)
Mind you, I'd still like to see render time reflection mapping (-> where the reflection image gets rendered per frame), even in this day and age where everyone seems to pump out radiosity imagery all the time...

Cheers,
Mike

Captain Obvious
06-22-2006, 04:48 PM
You can also do interpolated blurred reflections. Kray does this. It can use the final gather rays to accelerate the whole thing. Like irradiance caching, it's speed at the expense of accuracy.

kmaas
06-22-2006, 08:57 PM
This is called reflection mapping ;)
Mind you, I'd still like to see render time reflection mapping (-> where the reflection image gets rendered per frame), even in this day and age where everyone seems to pump out radiosity imagery all the time...

Cheers,
Mike

Boy, that'd be nice, wouldn't it? There's a feature request I'd say pretty much everyone couuld agree on. :D