[SOLVED] How do you correctly make a UI shadow? [Blender 3.4]

ChiliBeef
Posts: 492
Joined: 27 Mar 2022 18:34

[SOLVED] How do you correctly make a UI shadow? [Blender 3.4]

#1 Post by ChiliBeef » 30 Dec 2022 21:36

I cannot find any helpful guides or tutorials with making a UI shadow. There's two videos on YouTube that are outdated and not helpful and then there's this thread which is also not helpful and lacks a lot of specifics; I either get a blank bake or my bake has only little, solid, black rectangles where the tires sit and nothing else.

Would someone be able to give me some user-friendly (newcomer) help on how to create UI shadows? I'd rather not use the vanilla ones and try to manipulate them just to get them to look right. And, I use Photoshop when it comes to image editing, not GIMP or Paint.net.
Last edited by ChiliBeef on 31 Dec 2022 18:48, edited 1 time in total.
You can write almost any way you want, and you might make yourself understood.
But, if you don't use standard English properly, you would also help people understand that you aren't well educated.
User avatar
xXCARL1992Xx
Posts: 16524
Joined: 17 Aug 2016 12:18
Contact:

Re: How do you correctly make a UI shadow? [Blender 3.4]

#2 Post by xXCARL1992Xx » 30 Dec 2022 22:32

what Dotec wrote is already pretty much straight forward, but i wouldnt use dxtbmp but do it directly in GIMP that i use to edit the rendered image

the first thing you have to do is disable all parts from rendering that you do not want on the final texture, or that are not necessary at all for the UI shadow

in my example i did new textures for my 8x4 chassis for the WS 49X month back because i didnt want to fuss about with the existing ones

so, create a plane that has the same dimensions as your shadow_x_crn (from Blender 0 point to shadow_x_crn and then "mirror" it on X and Y axis to get the proper size) and place it directly under your wheels and give it a simple dif.spec material

next you drag out a new window in Blender so it is split vertically and then you split the new window horizontally, top is UV editor, bottom is Shader Editor (do however you prefer it), you can drag them out by clicking on the rounded corner of the window
[ external image ]

if you did it it should look like this

[ external image ]

in the shader editor you should see the node tree for your shadow plane you created with a dif.spec material, if not click A inside the Shader editor and then , on the numpad to center to it, click on the basetex node (orange) to highlight it white and create a new texture (button between the shield and folder icon), my texture is 512x2048

[ external image ]

next are the settings, with how much render paths you render it is up to you, try out until you are satisfied with the result, what we use here is ambient occlusion, this is the simplest method, i never got it working with the shadow option

[ external image ]

then mark the shadow plane and bake, sometimes blender behaves like a total moron and your image is just black, save your work and restart Blender, this fixes it for me most of the time, if the render was successful you get this

[ external image ]

save the image and now open it in any editor you want, i assume Photoshop will have the same option but under different names but the principles should still apply, i use GIMP to make the final edits because Paint.net is to limited for this

first operation i do is Color to Alpha, here i select white to be removed from the image, when options are available play around until the result is good for you

[ external image ]

after that i apply some contrast to it

[ external image ]

if the texture looks to your liking save it as a .tga and apply it to the shader in blender

[ external image ]

now you can use it for the UI fakeshadow and for the world shadow that is projected onto the ground (simple .tobj that is linked in your chassis .sii file)

that is the way how i did it back then when i looked for a way to make my own UI shadows and this method was the one with the biggest success for me so far, with my limited knowledge on image editing and the bit i know about Blender
| !!!NO SUPPORT OR REQUESTS OF ANY SORT VIA PM!!! | Screenshot Thread | Steam Workshop | World of Trucks Profil |
[ external image ]
ChiliBeef
Posts: 492
Joined: 27 Mar 2022 18:34

Re: How do you correctly make a UI shadow? [Blender 3.4]

#3 Post by ChiliBeef » 30 Dec 2022 23:14

As always, @xXCARL1992Xx, you come to the rescue. Well, you say straight forward, but that's because you and he are well versed with doing this task. I am not. The problem I found with what Dotec wrote is that he left some specifics out, such as the Sampling Samples, Noise and Denoise settings, and also mentioning to make sure that Ambient Occlusion was selected in the Bake type (I kept getting a blank texture constantly because Diffuse was originally set) and I didn't realize that until I looked closer at the right side of the picture. Also, him mentioning to use a Diffuse BSDF made me not give it a second thought; y'know, Diffuse BSDF, Diffuse Bake type, a newbie to UI shadows (like myself) might not realize right away that it's to be baked as an AO.

I myself prefer to read instructions and quickly glance at any pictures, so if what's written and what's shown in pictures don't coincide, I'm probably going to overlook a small detail in a picture initially.

I do have some questions:
  • Does it matter what color I set the new image to be? Usually, I default to white.
  • What about the shadow_x_ori locator? I know it sits higher (according to Blender for the vanilla Peterbilt 389, it's 0", -17.24", 36.81" with a rotation of -90°, 0°, -180°) but I'm guessing it doesn't really play a part in creating a ui_shadow on the ground.
  • I've also noticed that the shadow_x_crn locator sits well below the 0 Z-axis (-74.36", 203.82", -18.35" and 0° on all rotations). I don't need to worry about the height and just keep the plane at 0 on the Z-axis, correct? Or, do I need to have the plane sit just under where the bottom of the tires are? This is how everything sits right now:

[ external image ]
xXCARL1992Xx wrote: 30 Dec 2022 22:32 sometimes blender behaves like a total moron and your image is just black
Okay, I just spat out my drink reading that. :lol:
You can write almost any way you want, and you might make yourself understood.
But, if you don't use standard English properly, you would also help people understand that you aren't well educated.
User avatar
xXCARL1992Xx
Posts: 16524
Joined: 17 Aug 2016 12:18
Contact:

Re: How do you correctly make a UI shadow? [Blender 3.4]

#4 Post by xXCARL1992Xx » 31 Dec 2022 00:13

Color doesn't matter, if clear images is set blender will delete it an bake, otherwise it will over write it with white and black for occluded (is this even a Word?) areas

the ori locator is the Center of the shadow box if you look from the side and connect it with the crn locator and then mirror it in X and Y you get a box, the fakeshadow plain you place then tells the game everything in this box AND underneth the fakeshadow plain will be rendered darker ingame to simulate occlusion

For the shadow_x_crn Z hight, it doesnt matter for what we are doing, place the plain directly under the wheels, only the X and Y coordinates are relevant for us, I use it as reference to know how big I have to make the shadow plin for the UI shadow
| !!!NO SUPPORT OR REQUESTS OF ANY SORT VIA PM!!! | Screenshot Thread | Steam Workshop | World of Trucks Profil |
[ external image ]
ChiliBeef
Posts: 492
Joined: 27 Mar 2022 18:34

Re: How do you correctly make a UI shadow? [Blender 3.4]

#5 Post by ChiliBeef » 31 Dec 2022 00:50

@xXCARL1992Xx I have found a limitation of Photoshop: it cannot really do the same effect as GIMP's Color to Alpha ability. There are workarounds, but they either do not produce the same result or require a longer and more tedious process of which I cannot be bothered. So, I'm going to go the easy and simple route and use GIMP for this ability.
xXCARL1992Xx wrote: 31 Dec 2022 00:13 for occluded (is this even a Word?) areas
Yes, it is a word. :mrgreen: However, in this reply you wrote "plain" instead of "plane".


One thing that was making me pull my hair out was that my newly exported image (I really hate how they don't call it saving like every other sane program out there) was not showing up transparent. That's when I noticed that you didn't mention how the diff.spec shader must also have the decal and over effects applied; it was only when I looked at one of your pictures and squinted really hard that I noticed why it wasn't working.

However, I'm having a problem with the shadow area still having a noticeable border around the truck. Also, I've found that adjusting the brightness and contrast does absolutely nothing for me.
[ external image ]

EDIT: Oh, I see. I pulled in one of the vanilla ui_shadow files and saw they do the same thing, for the most part. So, I'm guessing that's normal? However, my attempt still looks like crap compared to the vanilla ones.
You can write almost any way you want, and you might make yourself understood.
But, if you don't use standard English properly, you would also help people understand that you aren't well educated.
User avatar
xXCARL1992Xx
Posts: 16524
Joined: 17 Aug 2016 12:18
Contact:

Re: How do you correctly make a UI shadow? [Blender 3.4]

#6 Post by xXCARL1992Xx » 31 Dec 2022 09:03

in the color to alpha settings i play with the options so it removes more of the color and prevent this bleed to the edge, i had this problem also when i did my first bakes, and after i found what is good for me i saved it as a preset
| !!!NO SUPPORT OR REQUESTS OF ANY SORT VIA PM!!! | Screenshot Thread | Steam Workshop | World of Trucks Profil |
[ external image ]
ChiliBeef
Posts: 492
Joined: 27 Mar 2022 18:34

Re: How do you correctly make a UI shadow? [Blender 3.4]

#7 Post by ChiliBeef » 31 Dec 2022 12:55

@xXCARL1992Xx I'm wondering if it's something to do with my model and it not being able to "cast" a shadow as effectively as, let's say, yours? Because the Color to Alpha settings at max was the best they could do to produce the result that you see.
You can write almost any way you want, and you might make yourself understood.
But, if you don't use standard English properly, you would also help people understand that you aren't well educated.
User avatar
xXCARL1992Xx
Posts: 16524
Joined: 17 Aug 2016 12:18
Contact:

Re: How do you correctly make a UI shadow? [Blender 3.4]

#8 Post by xXCARL1992Xx » 31 Dec 2022 12:58

well, geometry dictates how the shadow looks like, it is casted by raytracing, what i also do is set the margin size of the bake small, 16px is default and could cause this
| !!!NO SUPPORT OR REQUESTS OF ANY SORT VIA PM!!! | Screenshot Thread | Steam Workshop | World of Trucks Profil |
[ external image ]
User avatar
Etrusan
Posts: 649
Joined: 04 Sep 2014 15:29
Location: Brno, Czech Republic
Contact:

Re: How do you correctly make a UI shadow? [Blender 3.4]

#9 Post by Etrusan » 31 Dec 2022 13:09

Just add another layer mask and remove the edge with L tool (no clue how it's called, but that's the shortcut in 2.8 version). You're gonna have a nice fade.
Seasonic SSR-650TD; Intel Core i5-6700K; Gainward GTX 1060 6GB Phoenix GS; 2x Kingston HyperX Fury 8GB; 2x Crucial MX500 2TB; 3x Seagate IronWolf Pro; Corsair Force MP510 960GB; 2x 24" AOC I2481FXH; Windows 10

www.etrusan.net
ChiliBeef
Posts: 492
Joined: 27 Mar 2022 18:34

Re: How do you correctly make a UI shadow? [Blender 3.4]

#10 Post by ChiliBeef » 31 Dec 2022 14:12

xXCARL1992Xx wrote: 31 Dec 2022 12:58 well, geometry dictates how the shadow looks like, it is casted by raytracing, what i also do is set the margin size of the bake small, 16px is default and could cause this
Yes, Adjacent Faces and 16 px are what my Margin settings are currently set as. What would you suggest?
You can write almost any way you want, and you might make yourself understood.
But, if you don't use standard English properly, you would also help people understand that you aren't well educated.
Post Reply

Return to “Blender Tools”

Who is online

Users browsing this forum: No registered users and 8 guests