🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Space Game PBR shader and metal materials

Started by
7 comments, last by kburkhart84 9 years, 1 month ago

Hello. I'm messing with a spaceship in Unity 5(the new "Standard" shader). I've messed with both the metallic and the specular workflow, and I'm not getting the results I wanted. It is my fault though, see, a mostly metal material(regardless of workflow) won't be seen much regardless of lighting, unless it has something to reflect. For non-metallic things, this isn't a problem, as the albedo color let's it show the diffuse lighting, but in the case of metal, the albedo should be black(or even with the metallic workflow the albedo is no longer only albedo, rather turned into reflective color if something is metal). This is understandable, as a PBS shader is trying to mimic real life, and in real life(unlike what you see in Star Wars/Star Trek) a fully metal ship in very low lighting would actually black if there isn't much to reflect, or at least that is how I see it. And since a typical space scene skybox is mostly black/blue with some stars, nebula, etc... there isn't much to reflect.

Now, Unity let's me use my own choice of cubemap separate from the rendered skybox in order for there to be reflective lighting, so it can render the star skybox in the scene, and use something else to decide what lighting/ambient the scene will have for the PBS materials, which is great. I've tested with a few things though, and I can't get a very good result. This includes a basic cloud filter texture, an actual cloudy sky, and even solid color, and frankly it doesn't look very good for this scene. I'm sure if you were under sky on some planet, then I could get something looking right, but in outer space, what would you guys recommend? I'm sure I'm not the first one to make a game in space using PBS materials, so what works? Thanks in advance for your suggestions and help.



Advertisement

How about just make sure you always have some bright objects nearby to get a nice excuse for a brightly lit scene?

Add the following:

- A Sun (maybe two twin stars just for the kicks?)

- A near Planet with a brightish albedo so that it reflects plenty of sunlight.

- Some close galaxies bright enough to influence lighting in the scene.

That should make sure you get more light into the scene, which in turn should then make your metallic materials look more than just black. Of course, you need to make sure that either these objects are part of the skybox already, or you bake an additional cubemap if the objects are actual geometry to include them in your diffuse / spec cubemap.

A scene in deep space, outside of galaxies will always look boring if done realistically, because with almost no light present apart from some distant galaxies, you will get a very dimly lit scene. With some bright graphic Effects for the ship thrusters and ship lights, might still look good though. But that doesn't help with PBR of course.

If you are close to a sun inside a galaxy, only then things start to become better lit, still a problem because of the harsh contrast outside of a planetary atmosphere because of the low amount of ambient light.

So if you go with realistic lighting, you will always get quite dramatic, but difficult lighting going in space. Either make your lighting less realistic by ramping up the ambient lighting for objects (though how well that works when the actual diffuse lighting is not ramped up IDK), or by placing additional light sources as laid out above, and make sure these are included in the cubemaps.

EDIT:

Oh, after reading Hodgmans comment, something else came to mind: Make sure your maps are correct and assigned to the right slots. the materials can look overly shiny if either the gloss or the spec map is ignored.

I think I had to set the alpha channel to "is transparency" after combining gloss into my spec map.... just combining the two led to the problem of overly shiny surfaces.

Just something to check, might not be a problem in your case

Metal would only look black (with tiny reflections of stars) in space if it's also perfectly smooth. If you add some roughness, all those stars and nebulae will blur out into large shapes that can cover more of the surface.

If you makr your stars unrealisticly bright, they'll add a lot of lighting to rough metal.

OK guys, thanks for the suggestions. I think roughness combined with some things(like suns) in the skybox will probably work. If not, I will either go with last-gen non PBR shaders, or fake a cubemap(gray just for some lighting) to get something on the ship. I will post what worked after messing with it some more.



Proper PBR is energy conservative so metals should not be problem at all. Keep in mind that most metals has bigger total reflectance than non metals. If you can get non metals look good and you have high resolution cubemap then metals should be lot easier.

The problem I see more than anything is that a ship realistically wouldn't be metallic, it will be painted (for visual identification, etc) or covered in some kind of shielding material. That's the reason why Star Trek/ Star Wars ships look the way they do, they aren't bare metal. I actually failed to find any examples of a metallic ship in space (there are some in atmosphere) from either universes. Small metallic details could be visually interesting in compliment, but for a large number of reasons covering a ship in metal isn't a logical choice. Look at real world examples like the shuttles or any rockets we've sent up.

Even without PBR the look of metal in space should still be black, otherwise it by definition isn't metallic anymore. PBR is largely a buzz term for higher quality shaders. Dropping it will only hurt your art! I'd hate to see that happen because of fighting the tech rather than developing an understanding of it and utilizing great examples from life and fiction. Good luck!

Instead of using star fields just use those cool nebula photos that NASA has taken for your cubemaps.

It would be nice to see a screenshot.

Honestly, I don't have any screen shots. I've kind of ended up scrapping the project in this form. This is why it is a good thing to work out projects in advance like this instead of diving in with no prototyping or anything. The game design is going to be top-down, and while there are some cool things I can do if I go fully 3d rendered(especially with PBR) with it, it is also a thing of time, which I don't have much of. I can't sprite for squat, but if I pre-render some simple models I can get acceptable results if I do it right, so I think I'm better off that way. And I avoid much of the texturing, UV mapping, steps as well. I can also use the full power of Blender instead of only what can get exported directly to a 3d engine, so things like Blender's procedural textures, tons of triangles if I need it(as in I don't have to optimize for the most part the models if they get lots of tris for some reason), any of the animation features, etc... just basically, I get better and faster results that way. And even better, even the "lowly" GameMaker Studio can handle the project like this, and it is better suited to 2d games so...see where I'm going with this. I would like to get done in this lifetime, and I know me, I would spend too much time on less important things in the project. Better to have figured these things out now rather than later after getting deep into the thing.



This topic is closed to new replies.

Advertisement