Page 1 of 2 12 LastLast
Results 1 to 15 of 21

Thread: Normal and albedo second hit

  1. #1
    Registered User
    Join Date
    Mar 2018
    Location
    Perth, Australia
    Posts
    99

    Normal and albedo second hit

    Can Lightwave do something that Blender has as its 'denoised normal' channel? It is basically skipping the first hit on Delta textured objects on the normal channel and only return the second hit?

    See these examples explained in the Intel Image Denoiser documentation:



    Images taken fron the Intel Open Denoise manual page at: https://openimagedenoise.github.io/documentation.html

    This would really help in denoising anything behind glass. I'm not very good with the ray cast nodes but perhaps something is possible within the node editor?

    This is the same for Albedo passes by the way.

  2. #2
    obfuscated SDK hacker Lightwolf's Avatar
    Join Date
    Feb 2003
    Location
    Stuttgart, Germany
    Posts
    13,645
    Even if it could, it would only work (in one pass) if the transparencies have an index of refraction of precisely 1. Essentially, no refraction.
    I don't see how you can otherwise render this in one pass in any other renderer either.

    Cheers,
    Mike

  3. #3
    Registered User
    Join Date
    Mar 2018
    Location
    Perth, Australia
    Posts
    99
    Quote Originally Posted by Lightwolf View Post
    Even if it could, it would only work (in one pass) if the transparencies have an index of refraction of precisely 1. Essentially, no refraction.
    I don't see how you can otherwise render this in one pass in any other renderer either.

    Cheers,
    Mike
    Why would the IOR have to be 1? The ray will still be bent when it hits the surface but only be returned when it hit the surface after that. That is how it works in Blender. I can't find a good example but I saw something where there were some pencils in a beer mug with lots of refraction going on and when the 'denoiser normal' channel was displayed, you could see all the penciles' normals nicely refracted through the beer glass. The same was for reflections by the way... So in the reflections of a mirror, you could see all the normals of all the reflected objects.

  4. #4
    Super Member Kryslin's Avatar
    Join Date
    Feb 2009
    Location
    Prescott, IA
    Posts
    1,534
    Out of curiousity (not snarkiness), what purpose does it serve? What do you use something like this for? Relighting, possibly?
    --------
    My Scripts for Lightwave
    Intel Core i7 960 @3.20 Ghz, 24 GB ram, EVGA 6GB GTX980Ti "Classified" driving 2 x HP LA2405.

  5. #5
    Registered User
    Join Date
    Mar 2018
    Location
    Perth, Australia
    Posts
    99
    I found the video where you can see how it works.

    Here is a link that immediately goes to the part where you can see the refracted normals of objects behind glass as well as the normals of objects reflected off surfaces:
    https://youtu.be/fONxsfY9nO0?t=260

    Here is a still:
    Click image for larger version. 

Name:	Denoised-normals.jpg 
Views:	32 
Size:	486.5 KB 
ID:	146359

  6. #6
    Registered User
    Join Date
    Mar 2018
    Location
    Perth, Australia
    Posts
    99
    Quote Originally Posted by Kryslin View Post
    Out of curiousity (not snarkiness), what purpose does it serve? What do you use something like this for? Relighting, possibly?
    It is for (much) better denoising. The Intel Denoiser uses extra channels apart from the beauty shot to make the denoising more accurate. The extra channels are the normal channel and the raw RGB channel. But in order to be able to do this, you need to have the normals rendered. See the Intel denoising documentation. See the video to see the difference in practice.

  7. #7
    Super Member kolby's Avatar
    Join Date
    Aug 2004
    Location
    CZ, EU
    Posts
    405
    Isn't that what DP Filter/Render Buffer provide ?


    Click image for larger version. 

Name:	DPFilter.jpg 
Views:	40 
Size:	272.6 KB 
ID:	146362
    System info: CPU: Ryzen 9 3950X RAM: 32GB DDR4/3200MHz MB: Asus Prime X570-P GFX: Asus GTX 750 Ti / 2GB OS: Win10, LW2019x64

  8. #8
    Member
    Join Date
    May 2006
    Location
    France
    Posts
    4,102
    A least we would build a custom buffer for these special normal and raw color buffers,
    then we could get it in DP Filter but there's an issue yet,
    also firing a ray nodally to get it, is not obvious.

    Denis.

  9. #9
    Member
    Join Date
    May 2006
    Location
    France
    Posts
    4,102
    I did a test with this case, a central ball with 50% reflection, 50% transparency and a slight IOR,

    Click image for larger version. 

Name:	bounced_normal.jpg 
Views:	32 
Size:	126.6 KB 
ID:	146382

    Adding two special Buffers, Custom but filled in a node internally,
    because afaik in the surface editor a Custom Buffer is evaluated at first bounce only,
    one Buffer for Normal second hit only, the other for ray weight (transparency and/or reflection)
    then mixed with the Normal LWBuffer (first hit) using the Mask Buffer in the Image Filter node editor,

    Click image for larger version. 

Name:	reflect+refract.jpg 
Views:	38 
Size:	137.3 KB 
ID:	146381

    That's just a prototype, ball not double-sided, may be not correct in some other case,
    more complicated to get a bounced albedo, I think.

    Denis.

  10. #10
    Registered User
    Join Date
    Mar 2018
    Location
    Perth, Australia
    Posts
    99
    Quote Originally Posted by dpont View Post
    Adding two special Buffers, Custom but filled in a node internally,
    Denis.
    So you build this in node editor? could you post the setup? I'm so bad at nodes, I never know how to even remotely start at something like this :-(

    It looks very promising! Hopefully there aren't any internal limitations to achieve the full effect (reflection/refraction and albedo).
    I wish I could be more of a help in this thing.

  11. #11
    Member
    Join Date
    May 2006
    Location
    France
    Posts
    4,102
    Quote Originally Posted by peebeearr View Post
    So you build this in node editor?
    No we can't do this with a node setup plugged in Custom Buffer, because this buffer type works only for first hit,
    so I made an experimental node, which theoretically could be added with a batch script everywhere,
    then it could be easy to add another node in DPFilter with bounced Normal and bounced Raw/Albedo,
    annoying issue is that the surface node needs to be plugged in an root input (not Custom Buffer)
    with a dummy value for being evaluated, also I have no other way actually to evaluate raw,
    than checking individually color texture or other nodal color input.

    Denis.

  12. #12
    Member
    Join Date
    May 2006
    Location
    France
    Posts
    4,102
    Added color procedural to reflected and refracted balls,

    Click image for larger version. 

Name:	refracted+reflected.jpg 
Views:	25 
Size:	174.3 KB 
ID:	146411

    Using the same node for catching second hit of albedo and similar post-process composited with Raw Buffer,

    Click image for larger version. 

Name:	bounced_albedo.jpg 
Views:	28 
Size:	149.6 KB 
ID:	146412

    Yet the second hit, takes color from main color of material,
    Standard or Principled, including envelopes, layered textures and color nodal input.

    Denis.

  13. #13
    Registered User
    Join Date
    Mar 2018
    Location
    Perth, Australia
    Posts
    99
    Quote Originally Posted by dpont View Post
    Added color procedural to reflected and refracted balls,

    Click image for larger version. 

Name:	refracted+reflected.jpg 
Views:	25 
Size:	174.3 KB 
ID:	146411

    Using the same node for catching second hit of albedo and similar post-process composited with Raw Buffer,

    Click image for larger version. 

Name:	bounced_albedo.jpg 
Views:	28 
Size:	149.6 KB 
ID:	146412

    Yet the second hit, takes color from main color of material,
    Standard or Principled, including envelopes, layered textures and color nodal input.

    Denis.
    That looks very promising! Although with the sample images it is kinda hard to see what is going on.... The second sphere is 50% reflective and 50% transparent?

  14. #14
    Member
    Join Date
    May 2006
    Location
    France
    Posts
    4,102
    Ball in the center of the screen is 50% transp/reflect,
    was my first try,
    so there are several bounces here, reflected primary ray (bounce 1),
    transparent (main is at bounce 2 because it must travel through central ball)
    and reflection of transparent ray at bounce 2+
    and in this test each new bounced ray overwrite the previous in both normal and albedo
    but there's still some problem (among some others) to filter correctly rays and blending them seperatly.

    Denis.

  15. #15
    Member jgutwin's Avatar
    Join Date
    Feb 2003
    Location
    Portland, Maine, USA
    Posts
    43
    I had an interior with some glass walls and came up with an odd solution. I ran the denoiser separately on the refraction color then added that to the raw color and ran another denoise. It seemed to work pretty well.

    Click image for larger version. 

Name:	Annotation 2019-12-16 143704.jpg 
Views:	32 
Size:	184.8 KB 
ID:	146440
    Click image for larger version. 

Name:	Ea_000.jpg 
Views:	35 
Size:	3.02 MB 
ID:	146441
    Click image for larger version. 

Name:	Annotation 2019-12-16 144730.jpg 
Views:	32 
Size:	1.20 MB 
ID:	146442

    Add my thanks to you Dennis for all your amazing plugins!
    John Gutwin
    Pepperchrome

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •