Glass v1.1


 
This location is for Registered Users Only.
Perhaps you need to login or register.
Contributor: Frank Rueter
Website: www.ohufx.com
simple glass filter
Requirements:
5.0, 5.1, 5.2, 6.0, 6.1, 6.2 or later
Linux, Mac, Windows
25 May 2011
4366

1.1 adds a "smoothness" knob which smooths out the internal vectors and gets rid of artifacts.


This gizmo uses IDistort to create a simple glass light effect based on a control mask.

Glass_01

Glass_02

Glass_03

Please login in order to download these files.

Comments   

 
0 # Frank Rueter 2010-10-18 01:52
just subscribing to this feedback thread
 
 
0 # Jared Glass 2011-01-03 08:03
Is there a way to implement this to scale each pixel uniformly based on the information in a depth pass?
 
 
0 # Frank Rueter 2011-01-03 13:27
I'm not quite sure what you're after
 
 
0 # Jared Glass 2011-01-03 23:50
Basically multiply each pixel's width and height (in the rgba channels) by the corresponding depth channel's pixel's intensity value

so for each pixel: redPixel.width = redPixel.width* depth, redPixel.height = redPixel.height *depth, greenPixel.widt h = greenPixel.widt h*depth, greenPixel.heig ht = greenPixel.heig ht*depth etc

If this makes sense?
 
 
0 # Frank Rueter 2011-01-04 00:21
but a pixel doesn't have a height or width. do you mean scale their coordinates? IDistort and STMap will help you here
 
 
0 # Jared Glass 2011-01-04 02:24
this is my plight. What i want is for pixel's that are in the foreground (according to the depth map) to scale bigger than those in the background, so in my case each pixel would need to assume that it's initial width and height are 1 pixel and the coordinates are the coordinates of the specific pixel. So when the pixels are scaled the foreground pixels would scale more than those in the background as well as occlude the pixels behind them. (each pixel would scale outward from itself, like a transform node assuming each pixel is an image, and then all these scaled "pixel-images" get overlayed depending on where they are in the depth pass)
 
 
0 # Frank Rueter 2011-01-04 14:05
That is not trivial at all since you have to determine occlusions after each pixels change in size. Sounds like a job for plugin dev, but you might be able to put a gizmo together. Can't think of a clever way from the top of my head though.
 
 
0 # Jared Glass 2011-01-05 05:04
I've made a few python plugins and gizmo's but this is a little bit beyond my current capabilities. Tho I am looking to change that :-). Thanks though
 
 
0 # Andre BRIZARD 2011-07-12 07:17
I had some issues with it when it's not plugged-in. I did tweak it a bit :

this is the new gizmo :


#! /apps/thefoundr y/Nuke6.2v2/Nuk e6.2 -nx
version 6.2 v2
Gizmo {
inputs 2
addUserKnob {20 "" l Glass}
addUserKnob {7 displace l Displace R 0 20}
displace 5
addUserKnob {7 abberation l Abberation}
addUserKnob {26 "" l Defocus}
addUserKnob {6 useDef l "Apply Defocus" -STARTLINE}
addUserKnob {41 size T ZBlur1.size}
addUserKnob {41 max_size l maximum T ZBlur1.max_size }
addUserKnob {41 shape l "filter shape" T ZBlur1.shape}
}
Input {
inputs 0
name img
xpos -289
ypos 81
}
set N7d93400 [stack 0]
Dot {
name Dot1
xpos -255
ypos 634
}
Input {
inputs 0
name control
xpos -64
ypos -426
number 1
}
set N7d99020 [stack 0]
push $N7d99020
Copy {
inputs 2
from0 rgba.alpha
to0 rgba.alpha
name Copy6
xpos -64
ypos -355
disable {{"![exists parent.input1]" }}
}
set N7d9bd30 [stack 0]
Dot {
name Dot2
xpos 94
ypos -343
}
set N7dad360 [stack 0]
Transform {
translate {0 -1}
center {320 240}
name down
xpos 60
ypos -140
}
push $N7d9bd30
Dot {
name Dot3
xpos -122
ypos -343
}
Dot {
name Dot4
xpos -207
ypos -343
}
Transform {
translate {0 1}
center {320 240}
name up
xpos -241
ypos -180
}
push $N7dad360
Dot {
name Dot5
xpos 176
ypos -343
}
Transform {
translate {1 0}
center {320 240}
name right
xpos 142
ypos -221
}
push $N7d9bd30
Shuffle {
in alpha
green black
blue black
out rgb
name Shuffle1
xpos -64
ypos -311
}
Transform {
translate {-1 0}
center {320 240}
name left
xpos -64
ypos -285
}
Copy {
inputs 2
from0 rgba.alpha
to0 rgba.green
name Copy2
xpos -64
ypos -228
}
Copy {
inputs 2
from0 rgba.alpha
to0 rgba.blue
name Copy3
xpos -64
ypos -187
}
Copy {
inputs 2
from0 rgba.alpha
to0 rgba.alpha
name Copy4
xpos -64
ypos -147
}
Expression {
temp_name0 l
temp_expr0 red
temp_name1 r
temp_expr1 green
temp_name2 u
temp_expr2 blue
temp_name3 d
temp_expr3 alpha
channel0 {forward.u -forward.v -backward.u none}
expr0 (l-r)*width
channel1 {-forward.u forward.v -backward.u none}
expr1 (d-u)*width
channel2 depth
expr2 (abs(l-r)+abs(d -u))*width/2
name Expression1
xpos -64
ypos -3
}
set N7df8cc0 [stack 0]
Dot {
name Dot6
xpos 89
ypos 1
}
Dot {
name Dot7
xpos 89
ypos 193
}
push $N7df8cc0
push $N7d93400
Copy {
inputs 2
from0 -rgba.alpha
to0 -rgba.alpha
channels forward
name Copy1
xpos -64
ypos 67
}
Copy {
inputs 2
from0 -rgba.alpha
to0 -rgba.alpha
channels depth
name Copy8
xpos -64
ypos 175
}
ZBlur {
channels rgba
math -linear
shape 1
name ZBlur1
xpos -64
ypos 252
disable {{!parent.useDe f}}
}
set N7e16300 [stack 0]
IDistort {
channels {rgba.red rgba.green rgba.blue rgba.alpha}
uv forward
uv_scale {{parent.displa ce i}}
name IDistort4
xpos 101
ypos 491
}
push $N7e16300
IDistort {
channels {-rgba.red -rgba.green rgba.blue rgba.alpha}
uv forward
uv_scale {{parent.displa ce/(1+parent.abberation/10)}}
name IDistort3
xpos 66
ypos 314
}
push $N7e16300
IDistort {
channels {rgba.red -rgba.green -rgba.blue rgba.alpha}
uv forward
uv_scale {{parent.displa ce/(1-parent.abberation/10)}}
name IDistort1
xpos -188
ypos 309
}
push $N7e16300
IDistort {
channels {-rgba.red rgba.green -rgba.blue rgba.alpha}
uv forward
uv_scale {{parent.displa ce i}}
name IDistort2
xpos -64
ypos 311
}
Copy {
inputs 2
from0 rgba.red
to0 rgba.red
name Copy9
xpos -64
ypos 372
}
Copy {
inputs 2
from0 rgba.blue
to0 rgba.blue
name Copy10
xpos -64
ypos 412
}
Switch {
inputs 2
which {{parent.abbera tion==0 i}}
name Switch1
xpos -64
ypos 491
addUserKnob {20 "" l Weta}
addUserKnob {32 knob l "update input order" t "changes the input order according to the input nodes' horizontal order (left most node becomes input 0)" -STARTLINE T " reconnectInputs "}
}
Copy {
inputs 2
from0 -rgba.alpha
to0 -rgba.alpha
channels depth
name Copy5
xpos -64
ypos 616
}
Output {
name Output1
xpos -64
ypos 744
}
end_group
 
 
0 # martin constable 2011-08-01 04:22
A very useful little Gizmo. Thanks. I tried making something similar with iDistort but this is waaaay easier.
 
 
0 # hemanth chowda 2011-09-09 01:46
thank you
 
 
0 # Tiago Silva 2017-08-17 09:32
Great little gizmo, thank you :-)
 
 
0 # ryan ophelan 2018-09-20 00:59
I'm using Nuke 11.1v1 and added this gizmo to my comp.
Later, when opening the script, it errored, and actually wouldn't open, until I removed the node via a text editor.

Error is:
Glass1.inputs: unexpected "i" in 2inputs"
Glass1.2inputs: no such knob
Glass1.2: no such knob
 
 
0 # Frank Rueter 2018-09-20 02:13
This is a very old gizmo that I haven't touched in a while, so I'm not entirely surprised.
I will have a look later to see what's going on...
 
 
0 # Dmitriy Patrushev 2019-02-05 17:01
Very cool! thank 8)
 
 
0 # Mats Nyman 2024-01-02 18:21
Does this work best with both negative and positive values in the Alpha or does it not matter?
 

You have no rights to post comments

We have 3150 guests and 88 members online