.png + shadow casting
-
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!
-
Is taht with any shadow quality, even best?
-
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?
-
Sorry, meant transparency quality.
-
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
-
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.
-
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).
-
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.
Advertisement