Can Unity do this? (Environment lighting/shader/trees question)

Afternoon, guys.

I’m currently working on an overworld environment for a game project, and had been showing it off over at Polycount, a game artist forum. Someone over there had taken it upon themselves to paint over a screenshot with some suggestions for making it look better, which I wholeheartedly agree with, but I’m not sure what can and can’t be done with Unity.

Here’s the original shot I’d posted:

I’ve got a simple light setup of a single Directional light attached to the sun’s position, and the ambient is a mid-range blue. Most of the props are using basic diffuse lighting, and the trees have the default materials, which I can’t seem to change.

And said paintover:

That’d be a vast improvement, yeah? I’m aware that the shadows and AO are only possible with Pro (Which I don’t have), but setting those aside, I’ve gotten some headway towards that by giving the cliff textures normal maps, and increasing the contrast of the shading by brightening the sunlight and darkening the ambient.

Mostly I’m wondering about the trees. Do you guys know if it’s possible to get them to look something like that?

Yes we can :smile:

The main difference between your image and the paintover - to my eye - is contrast. I’d be inclined to set a much darker ambient colour and crank up your light intensity.

I think it would be hard to get that shade variation in the leaves without SSAO or shadows. The image is always going to look a little flat without those two things; faking it can only take you so far. Bloom and global fog would help you get that glowing haze in the distance, but again those are only in Pro.

I don’t think you can change the tree rendering material if you’re using the terrain engine. However, you could place the trees manually as static prefabs on the terrain, and give them whatever material you want. Performance won’t be as good though, since it won’t be able to automatically billboard the trees in the distance anymore.

I don’t think you will have a problem actually even if you don’t have pro. À number of carefully placed pointlights will get you far

Also try the advanced shader pack on the asset store, its free and will get you trees that receive lightning better.

If the objects/lights are static, you can bake single lightmaps - this will give you the contrast and shadowing you’re looking for. Add extra lights (for baking only) to simulate global illumination, since that’s a Pro only feature.

I agree. Assuming it’s not being targeted at mobile devices, replacing the directional light with a number of point lights will definitely give you a lot more control of the lighting.

Fairly easy if you light the trees using a spherical volume gradient tool to bake the lighting. Trees are generally made with a mess of quads for branches/leaves that don’t work well with realtime lighting.

I would bake different lighting versions to control the levels of lighting on the trees. All of your trees, including the paintover, have the same levels on them regardless of their placement in the scene which makes the light seem directionless.

You can pre-bake the shadows and AO into a map or vertex colours, btw. I did this back in the PS2 days.

Global fog isn’t a pro-only thing? Also… you can easily fake bloom also in the free version. Here’s how:
http://forum.unity3d.com/threads/152665-Unity-Free-Bloom

There’s also the old-school way to fake “bloom” which is to stick soft additive billboards where things are expected to glow.

You could also use lightmapping; that would give you AO.

Hot damn; I’ve never received so many replies in such a short time. I’ve gotten the fake bloom and it works rather well, although it’s only affecting the sky right now, and I’ve gotten the advanced terrain shaders, but I’m not quite sure how to get it working.

Regarding the stuff about point lights and lightmapping, I actually have a day/night cycle in place, thus the directional light. Would point lights still help? If I used lightmaps, I could probably have two; One for day and one for night made with the sun/moon directly overhead, but would I be able to fade between them?

And then what RyanB said about baking the lighting information into the leaves beforehand, you mean in the 3D software, right? What would I do to get that onto the leaf bunches if they’re clusters of planes sharing a single texture?

I may be able to get my hands on Pro in the near future, as I plan to throw up a Kickstarter once I get some substantial progress, so I’ll be able to do some of this stuff eventually.

Yes, you can bake the lighting in whatever 3D software you have available.

You can use vertex colours instead of a map if you haven’t given your polygons unique UV coordinates. This would work fine with the general art direction you have already shown.

If you are using maps, you need unique UV coordinates for lightmapping.

What if I did this?

I halved the size of the leaf texture and made four quadrants of it in the image, made each successive one darker, and then assigned it to a selection of faces from the bunch.

So basically you are doing manual ambient occlusion?

Visually it works, but it’s a lot of manual effort for something you could achieve with vertex colours.