Announcement

Collapse
No announcement yet.

2d Texture Displacement That Works with Standalone/Cloud

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

  • 2d Texture Displacement That Works with Standalone/Cloud

    I have a bunch of objects that all have the same Material, but each texture has a unique 2D noise displacement applied to it (in UVWRandomizer the Noise rollout can be made random like the other features). So each object has a version of this texture that has been displaced uniquely in 2d space before being mapped.

    However, the Noise feature of UVWRandomizer (or Bitmap or VRayBitmap) does not work with standalone.

    Is there another tool that can displace a texture randomly at render time? Note I am talking about 2d displacement, not 3d subpolygon displacement.

    I need the displacement to be at the map/texture level because other non-displaced textures have to be applied on top of it.

    I suppose I could perhaps tile a bunch of different displaced variants into a big map and use stepped offsets to pick one per object or something like that.

    Any ideas are welcome. Is there an OSL node for that? Hmmm.

    Thanks.

  • #2
    It looks like I could use some OSL code to randomize the UVs, but how do I get the UV output from OSL into a mapping channel or mapping source I can use with VRayBitmap? Piping it into the Mapping Source does nothing. I get the feeling it is the wrong type.

    Comment


    • #3
      I ended up doing some quick OSL coding. It works well, but I do have to load the path to the texturemap to be displaced directly into my OSL rather than into Max/VRay because I am using the texture() function. This also seems to choke on 16bit data. Works with 8bit PNGs. Did not test more thoroughly

      Comment


      • #4
        Originally posted by Joelaff View Post
        in UVWRandomizer the Noise rollout can be made random like the other features. So each object has a version of this texture that has been displaced uniquely in 2d space before being mapped.
        The noise is actually not randomized, though it appears so due to the texture randomization.

        Originally posted by Joelaff View Post
        However, the Noise feature of UVWRandomizer (or Bitmap or VRayBitmap) does not work with standalone.
        You've probably seen the warning about this. The feature is not supported and the usual workaround is baking prior to STD rendering.

        Otherwise, I'm glad you found an alternative through OSL. Otherwise, baking is always an option.

        Aleksandar Hadzhiev | chaos.com
        Chaos Support Representative | contact us

        Comment


        • #5
          Oh, so the noise itself is not randomized? It looked like it was, but the textures are complex; so I could have been fooled by other things.

          Baking is prohibitive in this case due to the number of objects that would need to baked. Hence the desire for randomization.

          With my OSL I am using a noise image, randomized with UVWRandomizer as the displacement amount. Then the OSL displaces the base image by that resulting random map.

          I am using Max’s OSL node. I did find I have to save the OSL script as a linked file or I get weird errors when it is embedded in the scene. (Which makes sense technically).

          I need to actually double check that this whole setup is rendering correctly in standalone. Otherwise I may have to use the VrayOSL, which I had trouble grokking right away, but I am sure I can figure out.

          Comment


          • #6
            Serious annoyance here… the OSL works beautifully, even in standalone.

            But… Linux standalone crashes after the render is totally complete and the output is written. It segfaults. Must be something with the way OSL is unloaded or something. I will make something for support.

            I even tried the latest stable build of Linux standalone and got the same crash.

            Windows standalone works fine.

            Comment


            • #7
              hermit.crab
              Here is a sample scene with the OSL included that works fine on Windows, both in Max and Standalone, and it renders fine in Linux Standalone, but Linux Standalone crashes with a segfault on completion of the render (after writing the output file).

              Also, Max on Windows seems to crash if you have this in a Material Library loaded into Slate and that material gets preview rendered-- it crashes out of Max.

              Note: We are no longer blocking on this because I modified Deadline's code to ignore the segfault and disabled core files; so it just works.
              Attached Files
              Last edited by Joelaff; 10-11-2023, 05:42 PM.

              Comment


              • #8
                Even with a revised OSL to set the input displacement map to what I think is now the correct type (though both VRay and Max worked with the old float input...) it still causes the segfault on render end ONLY on linux.

                Although the attached zip has the same name it is a newer version of both the scene and the script.

                Are you able to reproduce and submit for resolution?
                Attached Files

                Comment


                • #9
                  Hi, we tested your scene on Linux Standalone. V-Ray renders and saves the image with no errors.
                  I also did the other test in Windows and 3ds Max. No issues there as well but I am not sure I repeat the steps correctly. Here is what I did:
                  - opened your scene and put the material to a new material library
                  - reset 3ds Max, load the material library and open the material in slate material editor
                  No crash so far. Is there anything more to the test I have to try?
                  Vladimir Krastev | chaos.com
                  Chaos Support Representative | contact us

                  Comment


                  • #10
                    All I did was render the scene and the Linux standalone node returned a segfault after rendering. It writes the file without error but crashes at shutdown and returns a non-zero exit code.

                    Any segfault should be logged in your system wide syslog. Are you seeing that?

                    Will do an another test. Was using deadline. How are you starting the render test on Linux?

                    Comment


                    • #11
                      Like I mentioned, the file is written, but the program segfaults and returns non-zero (error).

                      Here is what I see on a test system:

                      joe@vole-x$ "/usr/ChaosGroup/V-Ray/Standalone_for_centos7/bin/vray" -scenefile=/deadline/Jobb/Bug/OSLTest02.vrscene -progressUpdateFreq=2000 -display=0 -rtEngine=0 -frames=5 -numThreads=0


                      [2023/Nov/16|10:46:15] [36 MB] Reading configuration from "/usr/ChaosGroup/V-Ray/Standalone_for_centos7/bin//vrayconfig.xml"
                      [2023/Nov/16|10:46:15] [36 MB] ===============================================
                      [2023/Nov/16|10:46:15] [36 MB] V-Ray Standalone, version 6 Standalone Update 1.1 for x64
                      [2023/Nov/16|10:46:15] [36 MB] Copyright (C) 2000-2023 Chaos Software EOOD. All rights reserved.
                      [2023/Nov/16|10:46:15] [36 MB] Use -credits option for additional third-party copyright notices.
                      [2023/Nov/16|10:46:15] [36 MB]
                      [2023/Nov/16|10:46:15] [36 MB] Build 32029 from Apr 13 2023, 21:20:51
                      [2023/Nov/16|10:46:15] [36 MB] Compiled with Clang GCC-compatible compiler, version 14
                      [2023/Nov/16|10:46:15] [36 MB] Operating system is Ubuntu 22.04.3 LTS (Build: 22.04)
                      [2023/Nov/16|10:46:15] [36 MB] CPU: AMD, AMD Ryzen 9 7950X 16-Core Processor , threads: 32
                      [2023/Nov/16|10:46:15] [36 MB] ISA: SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, SSE4a, AVX, AVX2, BMI, SHA
                      [2023/Nov/16|10:46:15] [36 MB] RAM: 63440 MiB
                      [2023/Nov/16|10:46:15] [36 MB]
                      [2023/Nov/16|10:46:15] [36 MB] V-Ray core version is 6.10.07
                      [2023/Nov/16|10:46:15] [36 MB] ===============================================
                      [2023/Nov/16|10:46:15] [36 MB]
                      [2023/Nov/16|10:46:15] [40 MB] Loading plugins from "/usr/ChaosGroup/V-Ray/Standalone_for_centos7/bin/plugins/libvray_*.so"
                      [2023/Nov/16|10:46:15] [40 MB] 78 plugin(s) loaded successfully
                      [2023/Nov/16|10:46:15] [40 MB] Loading plugins from "/usr/ChaosGroup/PhoenixFD/Maya2023-x64/vray6plugins/libvray_*.so"
                      [2023/Nov/16|10:46:15] [40 MB] 1 plugin(s) loaded successfully
                      [2023/Nov/16|10:46:15] [40 MB] Finished loading plugins.
                      [2023/Nov/16|10:46:15] [40 MB] Reading scene file "OSLTest02.vrscene"

                      [2023/Nov/16|10:46:15] [40 MB] /deadline/Jobb/Bug/OSLTest02.vrscene: done [ 0h 0m 0.0s]
                      [2023/Nov/16|10:46:15] [40 MB] File version is 1.00
                      [2023/Nov/16|10:46:15] [40 MB] Scene file parsed successfully in 0.0 s.
                      [2023/Nov/16|10:46:15] [40 MB] Scene created successfully.
                      [2023/Nov/16|10:46:15] [40 MB] Objects in scene: 37
                      [2023/Nov/16|10:46:15] [40 MB] Starting render sequence.
                      [2023/Nov/16|10:46:15] [40 MB] Setting number of rendering threads to 32.
                      [2023/Nov/16|10:46:15] [40 MB] GI engines: 'Brute force' and 'Light cache'
                      [2023/Nov/16|10:46:15] [40 MB] Preparing renderer...
                      [2023/Nov/16|10:46:15] [40 MB] Using Intel Embree ray server

                      [2023/Nov/16|10:46:15] [40 MB] Tiled texture cache set to 4000 MB

                      [2023/Nov/16|10:46:15] [40 MB] Preparing scene for rendering...: done [ 0h 0m 0.0s]
                      [2023/Nov/16|10:46:15] [40 MB] Light tree is enabled with clamp coefficient 0.1 and even split coefficient 0.5.
                      [2023/Nov/16|10:46:15] [40 MB] Using normal thread priority.
                      [2023/Nov/16|10:46:15] [40 MB] Max ray intensity is enabled: rendered result may have incorrect brightness.
                      [2023/Nov/16|10:46:15] [40 MB] Consistent lighting elements are enabled.
                      [2023/Nov/16|10:46:15] [40 MB] ========================
                      [2023/Nov/16|10:46:15] [40 MB] Starting frame 5.

                      [2023/Nov/16|10:46:15] [40 MB] Preparing scene for frame...: done [ 0h 0m 0.0s]

                      [2023/Nov/16|10:46:15] [40 MB] Compiling geometry...: done [ 0h 0m 0.0s]
                      [2023/Nov/16|10:46:15] [40 MB] Using Embree ray tracing.

                      [2023/Nov/16|10:46:15] [40 MB] Building Embree static accelerator...: done [ 0h 0m 0.0s]
                      [2023/Nov/16|10:46:15] [40 MB] Building Embree static trees took 0 milliseconds, memory used 0.00 MB

                      [2023/Nov/16|10:46:15] [40 MB] Embree dynamic geometry tree contains 0 primitives.

                      [2023/Nov/16|10:46:15] [40 MB] Embree dynamic geometry tree built in 0.02 ms.

                      [2023/Nov/16|10:46:15] [40 MB] Building Embree dynamic geometry tree...: done [ 0h 0m 0.0s]
                      [2023/Nov/16|10:46:15] [40 MB] Embree dynamic geometry tree takes 0.00 MB.
                      [2023/Nov/16|10:46:15] [40 MB] Scanning scene for light plugins.
                      [2023/Nov/16|10:46:15] [40 MB] 0 lights found.
                      [2023/Nov/16|10:46:15] [40 MB] Using adaptive light evaluation with 8 lights.
                      [2023/Nov/16|10:46:15] [40 MB] Using 1.53 MB for adaptive lights buffer
                      [2023/Nov/16|10:46:15] [40 MB] Building light cache.
                      [2023/Nov/16|10:46:15] [327 MB] Tracing 1000000 image samples for light cache in 64 passes.
                      [2023/Nov/16|10:46:15] [327 MB] Using 28.23 MB for light cache preview buffer

                      [2023/Nov/16|10:46:15] [327 MB] Building light cache...: done [ 0h 0m 0.1s]

                      [snip]

                      [2023/Nov/16|10:46:16] [663 MB] Noise threshold goal set: 0.010000

                      [2023/Nov/16|10:46:17] [677 MB] Rendering image (pass 257): 71.57% [ 0h 0m 2.0s] [ 0h 0m 0.8s est] [0 MB resman] [0 MB texman]
                      [2023/Nov/16|10:46:19] [677 MB] Progressive rendering finished: specified noise level reached

                      [2023/Nov/16|10:46:19] [677 MB] Sampling level reached: 42.04 subdivs (2020 passes)

                      [2023/Nov/16|10:46:19] [677 MB] Rendering image (pass 2019): done [ 0h 0m 3.9s]

                      [2023/Nov/16|10:46:19] [677 MB] Saving raw image file: done [ 0h 0m 0.1s]
                      [2023/Nov/16|10:46:19] [677 MB] Successfully written image file "/deadline/Jobb/Bug/OSLTest/testrender.0005.vrimg"
                      [2023/Nov/16|10:46:19] [677 MB] Number of raycasts: 29172470 (31.65 per pixel)
                      [2023/Nov/16|10:46:19] [677 MB] Camera rays: 9315852 (10.11 per pixel)
                      [2023/Nov/16|10:46:19] [677 MB] Shadow rays: 0 (0.00 per pixel)
                      [2023/Nov/16|10:46:19] [677 MB] GI rays: 19856618 (21.55 per pixel)
                      [2023/Nov/16|10:46:19] [677 MB] Reflection rays: 0 (0.00 per pixel)
                      [2023/Nov/16|10:46:19] [677 MB] Refraction rays: 0 (0.00 per pixel)
                      [2023/Nov/16|10:46:19] [677 MB] Unshaded rays: 0 (0.00 per pixel)
                      [2023/Nov/16|10:46:19] [677 MB] Peak memory for frame 5: 514.55 MiB collected for 23 categories
                      [2023/Nov/16|10:46:19] [677 MB] Peak memory for "Bitmap": 0 B
                      [2023/Nov/16|10:46:19] [677 MB] Peak memory for "Bucket image sampler": 0 B
                      [2023/Nov/16|10:46:19] [677 MB] Peak memory for "Dynamic displaced geometry": 0 B
                      [2023/Nov/16|10:46:19] [677 MB] Peak memory for "Dynamic geometry": < 1 MiB
                      [2023/Nov/16|10:46:19] [677 MB] Peak memory for "Dynamic moving displaced geometry": 0 B
                      [2023/Nov/16|10:46:19] [677 MB] Peak memory for "Dynamic moving geometry": 0 B
                      [2023/Nov/16|10:46:19] [677 MB] Peak memory for "GI": 1.67 MiB
                      [2023/Nov/16|10:46:19] [677 MB] Peak memory for "Lights": 0 B
                      [2023/Nov/16|10:46:19] [677 MB] Peak memory for "Misc.": 41.82 MiB
                      [2023/Nov/16|10:46:19] [677 MB] Peak memory for "Misc. displaced geometry": 0 B
                      [2023/Nov/16|10:46:19] [677 MB] Peak memory for "Misc. geometry": < 1 MiB
                      [2023/Nov/16|10:46:19] [677 MB] Peak memory for "Misc. moving displaced geometry": 0 B
                      [2023/Nov/16|10:46:19] [677 MB] Peak memory for "Misc. moving geometry": 0 B
                      [2023/Nov/16|10:46:19] [677 MB] Peak memory for "Progressive image sampler": 442.22 MiB
                      [2023/Nov/16|10:46:19] [677 MB] Peak memory for "Scene parsing": 6.42 MiB
                      [2023/Nov/16|10:46:19] [677 MB] Peak memory for "Static displaced geometry": 0 B
                      [2023/Nov/16|10:46:19] [677 MB] Peak memory for "Static geometry": 1.22 MiB
                      [2023/Nov/16|10:46:19] [677 MB] Peak memory for "Static hair": 0 B
                      [2023/Nov/16|10:46:19] [677 MB] Peak memory for "Static moving displaced geometry": 0 B
                      [2023/Nov/16|10:46:19] [677 MB] Peak memory for "Static moving geometry": 0 B
                      [2023/Nov/16|10:46:19] [677 MB] Peak memory for "Static moving hair": 0 B
                      [2023/Nov/16|10:46:19] [677 MB] Peak memory for "Tiled bitmap": 0 B
                      [2023/Nov/16|10:46:19] [677 MB] Peak memory for "VFB": 21.15 MiB
                      [2023/Nov/16|10:46:19] [677 MB] Premultiplied light cache utilization: 0.00%
                      [2023/Nov/16|10:46:19] [677 MB] Number of light evaluations: 0 (0.00 per pixel)
                      [2023/Nov/16|10:46:19] [677 MB] Maximum memory usage for resman: 0.00 MB
                      [2023/Nov/16|10:46:19] [677 MB] Number of intersectable primitives: 32
                      [2023/Nov/16|10:46:19] [677 MB] SD triangles: 32
                      [2023/Nov/16|10:46:19] [677 MB] MB triangles: 0
                      [2023/Nov/16|10:46:19] [677 MB] Static primitives: 0
                      [2023/Nov/16|10:46:19] [677 MB] Moving primitives: 0
                      [2023/Nov/16|10:46:19] [677 MB] Infinite primitives: 0
                      [2023/Nov/16|10:46:19] [677 MB] Static hair segments: 0
                      [2023/Nov/16|10:46:19] [677 MB] Moving hair segments: 0
                      [2023/Nov/16|10:46:19] [677 MB] Frame took 4.13 s.
                      [2023/Nov/16|10:46:19] [677 MB] Maximum memory usage for texman: 0.00 MB
                      [2023/Nov/16|10:46:19] [353 MB] Maximum memory usage for attributes: 0.00 MB
                      [2023/Nov/16|10:46:19] [229 MB] Closing log - 0 error(s), 0 warning(s).
                      /usr/ChaosGroup/V-Ray/Standalone_for_centos7/bin/vray: line 3: 436725 Segmentation fault (core dumped) "/usr/ChaosGroup/V-Ray/Standalone_for_centos7/bin/vray.bin" "$@"


                      And in /var/log/syslog:

                      Nov 11 23:38:56 vole-x kernel: [187178.939525] VRay 9[171999]: segfault at 7f2b012b2020 ip 00007f2b012b2020 sp 00007f2ac0d88d18 error 14 likely on CPU 31 (core 15, socket 0)
                      Nov 11 23:38:56 vole-x kernel: [187178.939530] Code: Unable to access opcode bytes at 0x7f2b012b1ff6.
                      Nov 11 23:38:56 vole-x kernel: [187178.939542] VRay 18[172008]: segfault at 7f2b012b2020 ip 00007f2b012b2020 sp 00007f2a99cf7d18 error 14 likely on CPU 15 (core 15, socket 0)
                      Nov 11 23:38:56 vole-x kernel: [187178.939545] Code: Unable to access opcode bytes at 0x7f2b012b1ff6.


                      Comment


                      • #12
                        Note I tried it on the Nov 8 nightly as well-- same issue. And just tried the stable form Nov15 2023. Same issue.
                        Last edited by Joelaff; 16-11-2023, 10:01 AM.

                        Comment


                        • #13
                          Any segfault should be logged in your system wide syslog. Are you seeing that?
                          No errors on my test. But I was not using that many commands, only -sceneFile=​ and -imgFile=
                          I will test again with the -display=0​ and numThreads=0. Why do you need numThreads=0? This is the default state.
                          Vladimir Krastev | chaos.com
                          Chaos Support Representative | contact us

                          Comment


                          • #14
                            I had copied the command line out of deadline’s logs. It must just add that for versatility of changing the number of threads or something.

                            I’ll try again later today with the simplest command line. The machine has no display, though. SSH access only. Just like the hundreds of EC2 nodes that all exhibit the same crash.

                            Comment


                            • #15
                              So I retested without the numthreads and it still crashed. Here is the vrscene I was using (you will have to alter the paths in the file of course). OSLTest02.zip

                              Either Ubuntu Linux or Amazon's EC2 Linux. Both fail the same way.

                              Comment

                              Working...
                              X