Announcement

Collapse
No announcement yet.

Luoshuang's GPULightmass

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    Originally posted by Luoshuang View Post

    I believe this is more or less a bug in GPULightmass's adaptive sampler. Would you like to send me your scene (or a simplified version) for debugging?



    Ray clamping is most useful when handling glossy/specular and other 'spiky' BRDFs. For lightmap baking the scene is pure Lambertian diffuse so it is currently not used. Still, I would try it to see its effectiveness .
    Actually, it will help tremendously even with purely diffuse surface. Let's say you have a strong sun light where small streak of light reaches deep part of the environment. If the sun is really strong, then variance of samples returned from that are will be significant.

    Another very common case which can cause noise without ray clamping even in diffuse scenes are small and strong light sources very close to the surfaces.

    On top of that, while I don't know how your GPU path tracing works, generally, GPU path tracers do not do ray branching, and they also generally don't support some irradiance/light caching for secondary bounces. In that case, having ray intensity clamping will actually help you that much more!

    I have created two examples of the cases I've described above using offline renderer (Corona). All the offline renderers these days have ray clamping by default, set to some reasonable value (usually around 20, but for purpose of game engine, I think even 2 will be fine).

    Here's example of the sunlight case with ray clamping values:
    Ray clamping OFF:
    Click image for larger version  Name:	RayClamp_OFF.jpg Views:	1 Size:	169.6 KB ID:	1465989
    Ray clamping 20:
    Click image for larger version  Name:	RayClamp_20.jpg Views:	1 Size:	167.1 KB ID:	1465992
    Ray clamping 5:
    Click image for larger version  Name:	RayClamp_5.jpg Views:	1 Size:	155.9 KB ID:	1465991
    Ray clamping 2:
    Click image for larger version  Name:	RayClamp_2.jpg Views:	1 Size:	139.9 KB ID:	1465990

    And here is example of the other case, small strong light source near the surface:
    Ray clamping off:
    Click image for larger version  Name:	RC_OFF.jpg Views:	1 Size:	115.7 KB ID:	1465996
    Ray clamping 20:
    Click image for larger version  Name:	RC_20.jpg Views:	2 Size:	111.2 KB ID:	1465995
    Ray clamping 5:
    Click image for larger version  Name:	RC_5.jpg Views:	1 Size:	87.0 KB ID:	1465994
    Ray clamping 2:
    Click image for larger version  Name:	image_136082.jpg Views:	1 Size:	69.8 KB ID:	1465993

    So I definitely think it would help you a lot

    EDIT: You may want to right click and open the images in a new tab to see it better without excessive compression
    Attached Files
    https://www.artstation.com/artist/rawalanche

    Comment


      Originally posted by Rawalanche View Post

      Actually, it will help tremendously even with purely diffuse surface. Let's say you have a strong sun light where small streak of light reaches deep part of the environment. If the sun is really strong, then variance of samples returned from that are will be significant.

      Another very common case which can cause noise without ray clamping even in diffuse scenes are small and strong light sources very close to the surfaces.

      On top of that, while I don't know how your GPU path tracing works, generally, GPU path tracers do not do ray branching, and they also generally don't support some irradiance/light caching for secondary bounces. In that case, having ray intensity clamping will actually help you that much more!
      Looks VERY promising!

      I'm planning a complete rework of GPULightmass using OpenCL. This may roll out in that reworked version.

      GPULightmass is not a path tracer - it actually uses caching schemes which are very similar to light cache, otherwise it'll be much slower like a pure brute force renderer.

      Comment


        Originally posted by Luoshuang View Post

        Looks VERY promising!

        I'm planning a complete rework of GPULightmass using OpenCL. This may roll out in that reworked version.

        GPULightmass is not a path tracer - it actually uses caching schemes which are very similar to light cache, otherwise it'll be much slower like a pure brute force renderer.
        If you do have secondary GI caching, then that's very impressive Not many people managed to do that on GPU yet

        As for OpenCL, I am a bit skeptical. Pretty much every GPU rendering developer I know of considers it inferior for some reason Reminds me of: https://www.youtube.com/watch?v=qHuqD2NxE30 (turn on CC captions)
        https://www.artstation.com/artist/rawalanche

        Comment


          Originally posted by Rawalanche View Post

          As for OpenCL, I am a bit skeptical. Pretty much every GPU rendering developer I know of considers it inferior for some reason Reminds me of: https://www.youtube.com/watch?v=qHuqD2NxE30
          It is the reason why GPULightmass is CUDA currently =)

          Edit: Regarding caching I have something to say. I believe the reason why caching is easier for GPULightmass is, doing lightmap baking requires nearly all objects in the scene to have valid surface parameterization, which is very useful for cached lighting representation - if the parameterization causes problems for cached lighting, it will have definitely caused other bigger problems for lightmaps already. A problem is caching resolution, which I believe can be solved when I implement vray style retrace into GPULightmass.
          Last edited by Luoshuang; 04-24-2018, 10:33 AM.

          Comment


            Yep, retracing is usually quite important, especially to avoid light leaks. Anyway, I am looking forward for the updated version, and thank you for all the effort you've already put into it My utopian dream is to see this officially in UE4 one day and to see you working fulltime for Epic
            https://www.artstation.com/artist/rawalanche

            Comment


              Is there any chance to use this with SwarmAgent and use different PC in a network at the same time as you can do with CPU?

              Comment


                In my network baking was made by all machines with GPU.
                https://www.artstation.com/tomaszmuszynski

                Comment


                  3 Machines (every has a GPU in 1st stage are making "photons-something" (orange color) with CPU, next with GPU baking the maps ( blue color ).
                  One machine was to slow to finish photons-sth so did not even bake any map.
                  But time of whole process is the same with single machine and all machines in Swarm network. Maybe this scene is too small with maps count and size to use all machines properly.
                  I will check it with oversized lightmaps for every object in the scene (1024px) and we will see.
                  https://www.artstation.com/tomaszmuszynski

                  Comment


                    With overridden value to 1024 for most static elements in the scene my two network fellows have problems with radiosity and crashed. Only local machine computing.
                    I will try with lower value.

                    Assertion failed.
                    Error is in: rtRadiosity.h line 475
                    Expression: 0
                    Last edited by Muchasty; 04-24-2018, 02:28 PM.
                    https://www.artstation.com/tomaszmuszynski

                    Comment


                      Originally posted by Muchasty View Post
                      With overridden value to 1024 for most static elements in the scene my two network fellows have problems with radiosity and crashed. Only local machine computing.
                      I will try with lower value.
                      You can try further increasing TDR value to something like 300 to see whether there is still the issue. Also, photon-related functions should be disabled with the BaseLightmass.ini included in the installation. You may want to check your BaseLightmass.ini to see whether bUsePhotonMapping and UseRadiositySolverForXXX are set to false.

                      Comment


                        512 px works fine on all machines... Computing in progress...
                        Maybe it was not enough GPU memory to proceed 1024px maps for that big number of objects (124).
                        https://www.artstation.com/tomaszmuszynski

                        Comment


                          Ok. I set those ops to false and restarting engine and starting new bake with 512px resolution override.
                          https://www.artstation.com/tomaszmuszynski

                          Comment


                            With those options set to False CPU computation is avoided.
                            https://www.artstation.com/tomaszmuszynski

                            Comment


                              Ok. Net render finished with 512px for all 124 static meshes.
                              GTX1080+GTX970+GTX780 - Total time: 870 sec.
                              GTX1080 only - Total time: 1350 sec.


                              Conclusion: Yes, GPU net render I worth of using


                              QUESTION: Why the light-maps for calculation are distributed based on active cores of CPU ?
                              CPU has been excluded from the computation process by setting options you have mentioned.

                              Last edited by Muchasty; 04-24-2018, 03:51 PM.
                              https://www.artstation.com/tomaszmuszynski

                              Comment


                                Originally posted by Muchasty View Post
                                QUESTION: Why the light-maps for calculation are distributed based on active cores of CPU ?
                                CPU has been excluded from the computation process by setting options you have mentioned.
                                You can safely ignore that because all GPU operations are done on a single thread. Load balancing is something handled by Swarm which I cannot do much.

                                Comment

                                Working...
                                X