View Full Version : Screen layer effect of Photoshop
JValencia
09-11-2010, 04:36 PM
How can I do the Screen layer effect of Photoshop in the Material Editor? I have two nodes I need to combine, but I need to set my top node to screen over my bottom node.
Any ideas on how to recreate the screen effect?
Thanks!
haiddasalami
09-11-2010, 04:56 PM
Lerp which takes the inputs of your two nodes or textures and a constant one vector with a value of 0.5 should do the trick. You can modify the constant one vector for how much you want to screen A value of 1 means that A is now 100% transparent/opaque and a value of 0 is B 100% opaque.
glynnsmith
09-11-2010, 05:10 PM
I thought screen layer mode in PS was basically an Add node?
JValencia
09-11-2010, 05:19 PM
haiddasalami: nope, that just blended my inputs. Lerp is very useful though for vertex blending :)
glynnsmith: Isn't Add, Overlay in PS?
glynnsmith
09-11-2010, 05:28 PM
No. Add isn't overlay. If 0.5 is halfway between white and black, Overlay seems to take everything over 0.5 and adds it, and anything below 0.5 and subtracts it.
The way the math nodes work is with basic math :P You add a pixel of 0.15 brightness to another with 0.35, you end up with a mid-grey pixel of 0.5.
Multiply, subtract and divide nodes work in similar ways, as expected.
Photoshop's multiply doesn't work like that because of it's inability to go above a brightness of 1.
Might help:
http://www.cgtextures.com/content.php?action=tutorial&name=blendmodes
haiddasalami
09-11-2010, 06:08 PM
O my bad. Wow yeah lerp would just blend the two inputs. Trying something based on what glynn posted.
haiddasalami
09-11-2010, 06:16 PM
Ok from what I read up on, screen is the inverse of multiply. so formula would go something like
Constant 1 - A * Constant 1 - B
Tried this in UDK and it did work though I dont have photoshop installed to ensure it works correctly.
EDIT: Installing photoshop and will report back if its correct.
EDIT2: Nope :( Still going think Im getting somewhere..
EDIT3: Tell me if this works, seems like Im replicating what GIMP is showing
1 - ( (1 - A) * (1 - B) )
Yup that should work
http://dl.dropbox.com/u/391285/screenfilter.png
What I was supposed to get - (Stole the images off some tutorial as I had 0 knowledge of working in gimp and photoshop didnt want to install)
http://www.phong.com/tutorials/screen/3.jpg
Pretty simple math, just took some time reading what it is actually doing :)
JValencia
09-11-2010, 09:03 PM
haiddasalami: Thanks! I will try that. Will post back with the results. I looked up Screen on google, but I couldn't find any explanations on it.
glynnsmith: Thanks! I'll read up on that
Trying to create a stereoscopic material =p
EDIT:
It worked! I got the screening effect. Thanks!
McGreed
09-12-2010, 07:12 AM
Some of the notes I made for the nodes just to refer to them in a photoshop-ish way for me to understand :)
Add = Screen
Multiply = Multiply (doh)
OneMinus = Invert
Power = Contrast
Clamp = Limit Dark/Light Min/Max value
glynnsmith
09-12-2010, 07:16 AM
I use UDK's constant clamp in situations where I'd normally us PS's levels. It's not quite as tuneable, but it works great when all I want to do is nudge blacks up into dark greys, or whites down to light greys.
Also very handy for when you want to make sure your values are between a certain range, or to get rid of unwanted bloom.
Ben Apuna
09-12-2010, 07:30 AM
Xoliul (http://www.polycount.com/forum/member.php?u=22648) wrote a cool article about color math which you guys might be interested in.
http://www.laurenscorijn.com/articles/colormath-basics
It also links to some other pages with more photoshop math.
EDIT:
juanitudev1 (http://www.polycount.com/forum/member.php?u=32233) you might be interested in the
How do I make my work stereoscopic? (http://www.polycount.com/forum/showthread.php?t=75300) thread.
haiddasalami
09-12-2010, 08:09 AM
Xoliul (http://www.polycount.com/forum/member.php?u=22648) wrote a cool article about color math which you guys might be interested in.
http://www.laurenscorijn.com/articles/colormath-basics
It also links to some other pages with more photoshop math.
EDIT:
juanitudev1 (http://www.polycount.com/forum/member.php?u=32233) you might be interested in the
How do I make my work stereoscopic? (http://www.polycount.com/forum/showthread.php?t=75300) thread.
wish you showed me that page haha Ben. Also yeah still working on my stereoscopic post process though went a different route which reminds me I should get to work on finishing that.
JValencia
09-12-2010, 01:26 PM
Thanks for watching out Ben, glynnsmith and McGreed!
Helpful stuff =)
I'll post my Stereoscopic Mat if I get it working :0
vBulletin® v3.8.4, Copyright ©2000-2013, Jelsoft Enterprises Ltd.