Announcement

Collapse
No announcement yet.

Interior mapping shader

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

  • #31
    It could probably, at least it's possible with OSL, but this setup ignores any UV coordinates and instead works with XYZ object/local space coordinates. Like a 3D procedural noise map would.

    So basically the room size in units would be the same for a large or a small box (if it's not scaled), the large one would just have more rooms.
    Rens Heeren
    Generalist
    WEBSITE - IMDB - LINKEDIN - OSL SHADERS

    Comment


    • #32
      Sweet! Nice work Rens!
      Patrick Macdonald
      Lighting TD : http://reformstudios.com Developer of "Mission Control", the spreadsheet editor for 3ds Max http://reformstudios.com/mission-control-for-3ds-max/



      Comment


      • #33
        Hey Patrick! Yeah this would've been nice on Star Trek. : )
        Rens Heeren
        Generalist
        WEBSITE - IMDB - LINKEDIN - OSL SHADERS

        Comment


        • #34
          ah ok, I see, but in that case, it would be superusefull to have a roomsize setting or something per axis.
          right now, it's either rather hard or undoable (it could be me) to get the amount of rooms you would want/expect
          the default size of the room appears to be 1.50mx1.50mx1.50m while the atlas takes a different size (a roomcount of 1x1x3 looks like it's near the ok point of how the room looks.

          for a shader like this, I guess a UV related approach would work better ?

          other then that, really way cool that you're picking this up, this will be a real timesaver for rendering archviz exteriours with visible interiors

          Comment


          • #35
            Good points, I'll see if something like that could be built in. Glad it helps!
            Rens Heeren
            Generalist
            WEBSITE - IMDB - LINKEDIN - OSL SHADERS

            Comment


            • #36
              I'm used to create a plane (or dup the back side of glass) and map that with a UV Map to face, and have a multi sub object with different interior maps.
              I can really easily have a bunch of different variety on the bld.

              Haven't tried yet, but the whole point of this OSL shader is to blend between maps depending on the viewing angle isn't it?

              Stan
              3LP Team

              Comment


              • #37
                Originally posted by 3LP View Post
                Haven't tried yet, but the whole point of this OSL shader is to blend between maps depending on the viewing angle isn't it?

                Stan
                Hey Stan,

                No, the point is to simulate depth (rooms) where there is none. So moving around a cube it would appear as though there are rooms in there, moving with correct parallax and perspective, even though there are only six polys. Though it does switch maps depending on which side you look at it as well.

                I hope to have some time soon to update the shader.
                Rens Heeren
                Generalist
                WEBSITE - IMDB - LINKEDIN - OSL SHADERS

                Comment


                • #38
                  Hey Rens,

                  I understand the concept of what it should look like visually, I was wondering if the technical part was about blending between different maps depending on the angle of view to simulate what we have inside.

                  For exemple, this is one of our many interior we build to simulate viewing angle :


                  we cropped this image into 6 different materials piped into a multisub mtl.
                  We then adjust the planes behind the glass for each lvl of the bld the mtl ID to get the best angle of view for the interiors.
                  let say you have your cam on the ground floor, then the first 3 lvl of the bld will have ID 3, from lvl 4-6, id 2 and lvl 7-10 id 1

                  It's something I build 4 years ago and we use it in nearly all our jobs since as this work incredibly well.
                  The down part is that we still need to manually assign the ID on the planes behind the glass.
                  I was wondering if your script could take care of that manual ID assignment.
                  Does this make sense?

                  Cheers
                  Stan
                  3LP Team

                  Comment


                  • #39
                    Please excuse my reopening an older thread. But I'm curious if this OSL tex will work in Maya and what kind of changes I may need to make to the OSL?

                    The most obvious, I guess is that Max uses Z+ instead of Y+ for up.

                    I am attempting to pipe the OSL file through a VRayTexOSL node, into a VRayLightMtl node. I am getting black renders of the geometry (I have attempted a cube and a plane).

                    ================================================== ================================================== ========

                    I made a minor change to the OSL to adjust the Z to Y issue. It appears to work.

                    When set the Color Output to Col_Out I actually see the textures as expected, however, it looks like some rooms walls may be random (is this in the OSL, I'm not sure where that's determined?)

                    I'll post screenshots if it'll help.
                    Last edited by EToth; 16-09-2016, 06:44 PM.

                    Comment


                    • #40
                      Hey! Yeah, they're randomly picked from the four walls in the image that comes with it, if you want I could add that as an option as well as an option for Z or Y up. Thanks for finding a solution for that!
                      Rens Heeren
                      Generalist
                      WEBSITE - IMDB - LINKEDIN - OSL SHADERS

                      Comment


                      • #41
                        Originally posted by Rens View Post
                        Hey! Yeah, they're randomly picked from the four walls in the image that comes with it, if you want I could add that as an option as well as an option for Z or Y up. Thanks for finding a solution for that!

                        Yes, Rens. Please add this Z or Y up option. Thanks!
                        always curious...

                        Comment


                        • #42
                          Hello again! Happy Monday!

                          After the weekend break I've jumped back into this and while I've added some features I'll most likely need, I have created/discovered some issues along with them.

                          Below are some of the issues along with a slightly modified version of Ren's code (I sincerely hope you don't mind my hacking and slashing at this...)
                          1. Outside Walls
                            Click image for larger version

Name:	outsideWalls1.JPG
Views:	1
Size:	53.1 KB
ID:	863551

                            The outside walls show an interior; this is an obvious problem as we should be seeing straight through them to the outside world. I don't even a little know how to address this.


                          2. Inverted Floors
                            Click image for larger version

Name:	invertedFloor1.JPG
Views:	1
Size:	60.8 KB
ID:	863552
                            Click image for larger version

Name:	atlasMap_v003.JPG
Views:	1
Size:	34.0 KB
ID:	863553

                            The floor texture renders inverted. All other textures are facing the correct way, including the ceiling. Again, I am unsure how to address this.


                          3. Uneven Floor Number
                            Click image for larger version

Name:	offsetUnevenFloors.JPG
Views:	1
Size:	59.8 KB
ID:	863554

                            If the user provides an odd number to the number of floors the rendered geometry is offset in a way that puts it under sea level and all sorts of uneven. I attempted a fix by changing fScale to a vector vScale and scaling the geo only in that direction. Sadly, this did not work as expected. The scale is applied from the center of the geometry and is always offset in that respect. I suspect any odd number of floors would never render correctly.

                            However, I believe this can be fixed by modifying the intersection location up and down with an offset parameter. The existing vOffset only seems to shift the wall textures around?


                          4. Atlas Rows?
                            Click image for larger version

Name:	atlas2Rows.JPG
Views:	1
Size:	58.4 KB
ID:	863555

                            I know that you haven't addressed this as of yet, I'm curious if another AtlasMap needs to be provided for "lights off" textures? Is this what the AtlasRows parameter should be addressing? I created the above image and increased AtlasRows to 2, but nothing happened.


                          5. Color Out vs Result
                            When I render Result, I simply get black geometry; the only working render is Col Out which currently doesn't support emission or lights on/off?


                          6. User settings (Y up vs Z up)
                            Well, I thought I'd fixed the Y up issue by changing the
                            Code:
                            #define X 0
                            #define Y 1
                            #define Z 2
                            to
                            Code:
                            #define X 0
                            #define Y 2
                            #define Z 1
                            While that did correct the orientation of the room textures, it did not correct the user settings. The Room Count, Offset, and my added vector Scale attributes still function as Z is the up vector.


                          If anyone can and wants to help address these, I'd be very grateful; I'm a bit out of my element with OSL though I do know my way around scripting (python, tcl, etc).

                          Here is the script as I have edited it: http://pasteall.org/80399

                          Comment


                          • #43
                            Wow, nice! Great stuff to work with.
                            We just moved, however things are settling down again, which will put me back on track for OSL again. I have some other updates for the int shader, but I'll definitely look at your suggestions.
                            Rens Heeren
                            Generalist
                            WEBSITE - IMDB - LINKEDIN - OSL SHADERS

                            Comment


                            • #44
                              Awesome, I just found this as well. I too would love to be able to, or to know how to have a random assortment of different bitmaps so each floor isn't the same, it's not immediately obvious how to do that right now...seems like I've been having to make more and more buildings and cities recently and this would be really handy to have in my toolkit.

                              Comment


                              • #45
                                I've tried for a bit but can't wrap my head around the code enough to get it right.

                                I actually want a simplification of the shader. I'm looking to generate a single room instead of a 20x20x20 structure. One room per plane would be the idea.

                                Comment

                                Working...
                                X