Hello! I’ve just finished working on a script for Photoshop that combines normal maps using the “detail-oriented” technique described here:
http://blog.selfshadow.com/publications/blending-in-detail/. The script takes all the visible layers from your document and combines them. It should work with 8 and 16 bit images. You can change the intensity of all the individual normal maps realtime regardless of the size
It also works with just 1 normal map if you want to increase or decrease the strength of it.
I’ve made this script because I didn’t really like the results of the usual methods of combining normal maps in Photoshop (Overlay,...). This method should also be pretty fast, it takes around 30-40ms to combine a 512x512 image (this is just the combining part, saving the layers / creating the UI takes some time as well).
I've used Ryan Clark's images to keep it all consistent (http://www.polycount.com/forum/showthread.php?p=1030480)
[ame="
http://www.youtube.com/watch?v=pfJ6NRknRoI"]Combine Normal Photoshop Script - YouTube[/ame]
You can download it here. There's also some extra information there.
You can either download the installer (Photoshop 64bit or 32bit) or download the individual files and copy them to the script folder of Photoshop (...\Program Files\Adobe\Adobe Photoshop VERSION\Presets\Scripts). The installer also installs the Visual Studio 2013 redistributables so if you download the individual files you will need to install these yourself.
Questions or comments are very welcome!
Replies
i'll give it a try thx.
Thanks!!
Error 21: undefined is not an object.
Line:5
-> var index = filePath.lastIndexOf("/");
Attempting to execute CombineNormals.exe manually gives me the error "no layers are visible".
I'm using an ancient Photoshop CS2, and using the 32bit version (installer) of your script. Maybe you have an idea?
Hey, that looks like a weird one Ive tested it briefly on CS2 and everything seemed to work, so Im not sure whats going on.
When you say youve tried to run CombineNormals.exe, you mean CombineNormals_86.exe right? (Located here: C: \Program Files (x86)\Adobe\Adobe Photoshop CS2\Presets\Scripts). Although I dont think this could cause the error but did you install the C++ 2013 redistributables? And do you have .net 4.0?
Ill have a closer look tonight when Im home!
Yeah, CombineNormals_86.exe was the one. And I installed the redistributables included in your installer. As for .Net, I have Framework 4.5.1 (as per the programs dialog in Windows settings). Oh yeah, all of this is running on windows7 64bit.
Hey cptSwing, I've fixed the bug(s)! (at least I hope so :poly122:) I've uploaded the new version on my website (1.0.1). So now you should be able to successfully launch the application using the script in Photoshop CS2, it should also no longer tell you that you don't have any visible layer when in fact you do! (This was happening because of nested layers in groups)
Thanks everyone for the comments! If you find any bugs or have any feature requests please let me know!
I've also made this video to demonstrate how the script works:
[ame="http://www.youtube.com/watch?v=pfJ6NRknRoI"]Combine Normal Photoshop Script - YouTube[/ame]
Really interesting thank you for sharing and caring.
Thanks!
Hey, I think I've fixed this now! I've uploaded the new version on my website (1.0.2). It now ignores Alpha Channels but you can still use Layer Masks of course (as shown in the video).
Thank you all for the comments!
I was wondering this as well.. pretty slick
Yes, I'm using the Photoshop COM object, so the UI is .net C# winforms. Mostly Panels with a lot of OnPaint() code :poly142:
I had some problems with the COM object though. If you reference the Photoshop CS6 COM object it won't work on Photoshop CS5 and so on. I didn't want to compile a different exe for every Photoshop version... So to fix this I used "Late Binding", this article explains it well: http://www.codeproject.com/Articles/10888/SafeCOMWrapper-Managed-Disposable-Strongly-Typed-s).
I hope this sort of answers your question. Feel free to get in touch if you have any more questions or issues!
Ah awesome. Thanks Vincentt. :thumbup:
Good job. :thumbup:
Hmm, what kind of error message do you get when it crashes?
I've never tested this on Photoshop CC, I'll download the trial and see if I can re-produce/fix it.
EDIT:
I've installed the trial, and everything seems to run fine, could you check if these files are in the right place? Combine Normals.jsx, CombineNormal_x64.dll and CombineNormals_x64.exe should be in here: \Program Files\Adobe\Adobe Photoshop CC (64 Bit)\Presets\Scripts.
If you are running CC x86 the (_x86)files should be in here: Program Files (x86)\Adobe\Adobe Photoshop CC\Presets\Scripts
All the files are in the right place in the photoshop folder.
I do have a custom photoshop folder that is in my C: root, if that makes a difference.
My destination folder is :
\Programy\Photoshop_cc\Adobe Photoshop CC (64 Bit)
Files are on the place:
\Programy\Photoshop_cc\Adobe Photoshop CC (64 Bit)\Presets\Scripts
I opened an .exe file and it gives me the same error. So imo it's not related to the photoshop but to the program itself.
Are you sure you have correctly installed the Visual C++ Redistributable Packages for Visual Studio 2013 and what version of .Net do you have? (4.0 +?)
I'll have another look tonight and add some more error handling.
I have net framework 4.0.3
I installed : http://www.microsoft.com/en-gb/download/details.aspx?id=40784 .
I had it on my computer so during an installation process I had only "repair" and "uninstall" options. So imo the problem was with proper detection of what version of Redistributable Packages I have on my PC.
So I dunno if you or Microsoft should fix it ;\
Thanks for help, I'll test the soft now.
Ah! Great news, I was just about to send you a new version which should check if you have the redistributables installed. However, if Microsoft installer didn't know you didn't actually have it, my check could probably also fail...
(Do you have Visual Studio 2013 installed?)
I've updated my website with the latest version (1.0.3)! This version should now check if you have the redistributables installed.
I had 'update' and 'unistall' options, I chose update and it fails later, because I was unable to run .exe.
You need different redistributables for different applications depending on what version of Visual Studio they were compiled with, my dll is compiled with Visual Studio 2013, so that's why you need the 2013 redistributables.
I don't understand though why the Microsoft installer was broken for you, I now check when you run the script if you have the correct redistributables installed or not.
Thank you very much, I didnt even realize this was a problem actually, but it is! I just overlayed my normal and then I saw it changed colour alot, and then I ended here after searching a bit. This is for sure the best solution I found.
Good script!
THANKS!!