[Fuse] Grade

ArtemHlezin
Posts: 2
Joined: Wed Mar 28, 2018 3:33 pm
Been thanked: 4 times

[Fuse] Grade

#1

Post by ArtemHlezin » Wed Mar 28, 2018 4:10 pm

Hi friends. I am not huge fan of mixing workflows/ideologies from different softwares, but for fun I wrote Grade fuse. Please note that gamma works not like in nuke. Be careful with combinations of negative gamma slider/pixel values (because of NaNs, INFs etc.).

http://artemhlezin.com/2018/03/28/grade-fuse.html


Tags:

User avatar
JUNE
Fusioneer
Posts: 154
Joined: Wed Aug 06, 2014 5:45 am
Been thanked: 13 times
Contact:

Re: [Fuse] Grade

#2

Post by JUNE » Wed Mar 28, 2018 6:30 pm

great! thanks!!

User avatar
SirEdric
Fusionista
Posts: 902
Joined: Tue Aug 05, 2014 10:04 am
Been thanked: 62 times
Contact:

Re: [Fuse] Grade

#3

Post by SirEdric » Wed Mar 28, 2018 9:34 pm

Now that's a worthy submission for Reactor!
Well done! Thanks a lot.

User avatar
Dunn
Moderator
Posts: 458
Joined: Mon Aug 04, 2014 4:27 am
Location: Hamburg, Germany
Been thanked: 13 times
Contact:

Re: [Fuse] Grade

#4

Post by Dunn » Thu Mar 29, 2018 3:01 am

Nice entrance, first post with an awesome tool ! Welcome to the forum Artem!
;-)

User avatar
Chad
Fusionator
Posts: 1262
Joined: Fri Aug 08, 2014 1:11 pm
Been thanked: 20 times

Re: [Fuse] Grade

#5

Post by Chad » Thu Mar 29, 2018 10:36 am

WSL is attracting some really quality first posts.

Regarding the NANs, in Lua you can test that by comparing to itself like

Code: Select all

if (p ~= p) then
and if false then set the value to (+/-) math.huge or some other suitably large value.

I'd love to try this out with CustomShader3D though... I have a tool in the ColorBundle3D but I was never happy with the GUI. You don't use the color wheels, but you have sliders that seem to make a lot of sense, especially for animation.

ArtemHlezin
Posts: 2
Joined: Wed Mar 28, 2018 3:33 pm
Been thanked: 4 times

Re: [Fuse] Grade

#6

Post by ArtemHlezin » Thu Mar 29, 2018 11:18 pm

Thank you guys!
I am new to fusion and lua, so maybe some parts of code are not designed well. The biggest problem for me is the lack of online documentation.
If you have some issues, please let me know.

Chad, thanks for advise. It is really useful. Yours CustomShader3D is awesome - I have already bought it.

User avatar
SecondMan
Site Admin
Posts: 2565
Joined: Thu Jul 31, 2014 5:31 pm
Location: Vancouver, Canada
Been thanked: 86 times
Contact:

Re: [Fuse] Grade

#7

Post by SecondMan » Thu Mar 29, 2018 11:28 pm

Terrific first post - welcome to the forum, @ArtemHlezin! :)

And great tip, too, Chad - thanks!

User avatar
Chad
Fusionator
Posts: 1262
Joined: Fri Aug 08, 2014 1:11 pm
Been thanked: 20 times

Re: [Fuse] Grade

#8

Post by Chad » Fri Mar 30, 2018 8:45 am

You can make a general purpose "NaN Flag" ViewShader with
  1.         f.Color.rgba = isnan(f.Color.rgba) ? float4(65532.0, 0.0, 65532.0, 1.0) : f.Color.rgba ;
  2.         f.Color.rgba = isinf(f.Color.rgba) ? float4(0.0, 65532.0, 65532.0, 1.0) : f.Color.rgba ;
SpoilerShow
  1. --[[  
  2.       NaN Flag Viewshader
  3.       v1.01
  4.       Sep 3 2009
  5. --]]   
  6.  
  7. --[[
  8.  
  9.  Written by Chad Capeland (ccapeland[REMOVE-ME]@anatomicaltravel.com)
  10.  Copyright (c) 2009 Anatomical Travelogue LLC
  11.  (http://www.anatomicaltravel.com/research)
  12.  
  13.  The authors hereby grant permission to use, copy, and distribute this
  14.  software and its documentation for any purpose, provided that existing
  15.  copyright notices are retained in all copies and that this notice is
  16.  included verbatim in any distributions. Additionally, the authors grant
  17.  permission to modify this software and its documentation for any
  18.  purpose, provided that such modifications are not distributed without
  19.  the explicit consent of the authors and that existing copyright notices
  20.  are retained in all copies.
  21.  
  22.  IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY FOR
  23.  DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING
  24.  OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY DERIVATIVES
  25.  THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE POSSIBILITY OF
  26.  SUCH DAMAGE.
  27.  
  28.  THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES,
  29.  INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  30.  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
  31.  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND
  32.  DISTRIBUTORS HAVE NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT,
  33.  UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  34.  
  35. --]]
  36.  
  37. shader =
  38. [[
  39. struct NaNFlagVSFuse : ViewShader
  40. {
  41.     ViewShader source;                                  // need this line
  42.  
  43.     void ShadePixel(inout FuPixel f)
  44.     {
  45.         source.ShadePixel(f);                           // get source pixel
  46.        
  47.         f.Color.rgba = isnan(f.Color.rgba) ? float4(65532.0, 0.0, 65532.0, 1.0) : f.Color.rgba ;
  48.         f.Color.rgba = isinf(f.Color.rgba) ? float4(0.0, 65532.0, 65532.0, 1.0) : f.Color.rgba ;
  49.     }
  50. };
  51. ]]
  52.  
  53. -- regnode
  54. FuRegisterClass("NanFlagVSFuse", CT_ViewLUTPlugin, {        -- ID must be unique
  55.     REGS_Name = "NaN Flag ViewShader",
  56.     })
  57.    
  58. -- Called on creation. Add any controls here.
  59. function Create()
  60. end
  61.  
  62. -- This is called when the shader is created
  63. -- img may be nil
  64. function SetupShader(req, img)
  65.     local vs = ViewShader("NaNFlagVSFuse", shader); -- pass struct name and shader string
  66.     return vs;
  67. end
  68.  
  69. -- This is called every display refresh
  70. -- img may be nil
  71. function SetupParams(req, vs, img)
  72.     return true;
  73. end
  74.  
  75.  
EDIT: The Gain/Gamma sliders in the viewer process after the ViewShaders do, which is... interesting. In this case it lets you distinguish between "cyan" which might be in your image normally and "supercyan" which almost never is.