sketchucation logo sketchucation
    • Login
    πŸ€‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    .png + shadow casting

    Scheduled Pinned Locked Moved SketchUp Discussions
    sketchup
    8 Posts 5 Posters 5.0k Views 5 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M Offline
      mirjman
      last edited by

      Anyone have any luck getting a surface with a .png texture to receive shadows? I am trying to use a .png as a ground plane image but my building shadows will not show up on it. If I switch to .jpg the shadows appear.

      Any info appreciated, thanks!

      1 Reply Last reply Reply Quote 0
      • thomthomT Offline
        thomthom
        last edited by

        Is taht with any shadow quality, even best?

        Thomas Thomassen β€” SketchUp Monkey & Coding addict
        List of my plugins and link to the CookieWare fund

        1 Reply Last reply Reply Quote 0
        • M Offline
          mirjman
          last edited by

          taff- thanks, its acting just as you said, but it defeats the purpose of using a .png if you aren't using transparency =D

          thomthom - did you mean transparency quality? i tried faster/nicer and it did not make a difference. any way to adjust shadow quality?


          Untitled.jpg

          1 Reply Last reply Reply Quote 0
          • thomthomT Offline
            thomthom
            last edited by

            Sorry, meant transparency quality.

            Thomas Thomassen β€” SketchUp Monkey & Coding addict
            List of my plugins and link to the CookieWare fund

            1 Reply Last reply Reply Quote 0
            • TaffGochT Offline
              TaffGoch
              last edited by

              mirjman,

              I've found that png-textured faces will cast (and receive) shadows just fine, EXCEPT...
              ...when they have transparency defined in the png.

              This example uses two png textures, one with transparency, one without. Your described problem is demonstrated by the larger square face, textured with a png having transparent areas. It will not receive shadows, and casts a shadow which ignores the transparent areas (known deficiency, for which a 'fix' has been requested by many.) The other png-textured face casts and receives shadows properly.

              I don't know whether the next version of SketchUp can address the issue, since (I suspect that) it may be a characteristic of OpenGL, not SketchUp.

              Regards,
              Taff


              PNG shadows.png


              PNG shadows.skp

              "Information is not knowledge." -- Albert Einstein

              1 Reply Last reply Reply Quote 0
              • M Offline
                mbhawker
                last edited by

                I just found this thread facing the same problem - i have png textured meshes for vegetation that include alpha channel transparency that were not receiving shadows.

                What I found though (and forgive me if this has been specified elsewhere) is that by turning off transparency in styles>edit>face they would in fact receive shadows and alpha channel transparency was still retained! However, as a result of turning off transparency the antialiasing around the edge of the alpha channel, where the image file has partial degrees of transparency, reverts to white (grey in my case where it mixes with the antialiasing of my black edges). I did find that by turning off "Use Anti-Aliased Textures" in Model Info>Rendering greatly reduced the noticeability of this making it sufficient for my current project although I am luckily not using any Sketchup-based material transparency. I think if I have enough time I will edit my textures in Photoshop to ensure I have no antialiasing around the edges of the alpha channel.

                Solution: turn off transparency and do not use antialiasing when making alpha channel edges.

                1 Reply Last reply Reply Quote 0
                • M Offline
                  mbhawker
                  last edited by

                  My technique on how I cast shadows from the (aliased!) edges of alpha transparency rather than doing it manually by drawing and deleting faces due to it not being not feasible, requires greater accuracy or is a 3D mesh:

                  In Photoshop I make paths of the edges of the alpha (make path from selection), export paths to Illustrator, then in Illustrator I export to .dwg. Depending on the level of detail needed I might simplify paths in Illustrator to keep the resultant Sketchup model as simple as possible.

                  Its then a matter of resizing to fit and dropping this onto the imported .png and deleting the faces that are to be transparent (you might have to fix the odd edge to close a face - initially importing the .dwg file at a really large size seems to minimise this). I use the drape tool with the imported .dwg if I have a mesh that isn't 2D, then 'eye dropper' the associated and same-sized .png file and then paint bucket that onto the mesh (i use parallel projection to orientate/resize: the mesh, .dwg and .png as you usually would for the drape tool).

                  This technique is probably a workaround if you can't use alpha transparency at all, i.e. want to receive shadows but can't turn off transparency due to transparent materials in a model. I still use the transparent .pngs as it means I can keep a detailed edge to the transparency and have a less intricate imported .dwg file to minimise the work required as throwing shadows doesn't need extremely accurate edges. However you want to make sure that the .dwg file edges are accurate enough not to truncate non-transparent parts of the texture when you're deleting faces (I import the .png into Illustrator, lock it just for a reference and scale/move/edit the paths to ensure they're all in areas of transparency).

                  1 Reply Last reply Reply Quote 0
                  • R Offline
                    Roger
                    last edited by

                    This is slightly off topic and a bit confused, but I was making some bump maps using a sharp-edged black map and it actually punched through the image (jpg) and of I remember right the resulting image cast shadows. When I have a moment I will redo the experiment and post the results if , indeed, that is what happened.

                    http://www.azcreative.com

                    1 Reply Last reply Reply Quote 0
                    • 1 / 1
                    • First post
                      Last post
                    Buy SketchPlus
                    Buy SUbD
                    Buy WrapR
                    Buy eBook
                    Buy Modelur
                    Buy Vertex Tools
                    Buy SketchCuisine
                    Buy FormFonts

                    Advertisement