View Full Version : Some suggestion for scene reality

02-13-2017, 03:21 AM
Hello everybody !
this is my first post. I'm developing an application and I create a sort of engine to create an opengl scene, representing a simple home internal with cabinets.
It's all made with glPolygon and glTexCoord...
Mainly I help myself with tutorial over the internet, I don't have school formation, only some experience at my previous work.
I attach you a sample.
What I would like to do is to make the scene more realistic, I tried to setup opengl lights but with terrible results....if somebody has suggestion is very welcome !
I develop with C++, vs2010.

02-13-2017, 03:34 AM
- find different wallpaper in google (seamless wallpaper).
- make ambient light darker - it will give you some shadows on polygons.
- find better textures with some shadows already on it.
- add more objects/meshes.
- create cubemap-background.

02-13-2017, 05:11 AM
Your primary problem is shadows. If this is a static scene where nothing moves, the answer is easy. Even if there is a small amount of animation you still may get away with baked lighting. Here's one video (https://www.youtube.com/watch?v=sB09T--_ZvU) on baked lighting with Blender. You should be able to bake lighting, shadows, and ambient occlusion down to a single texture. (Or if your scene has multiple objects with multiple textures, you can bake the lighting down to each of those textures.) The basic concept is that you let Blender do the heavy lifting with lighting and use it to create a texture that has all that info in it.

The main problem with this approach is that nothing can move after that because then the lighting would change and it can't because it's baked. But that may not be a problem. Not sure what you're using this for, but in most games there are lots of static objects that the player can't move. It's very common to have most of the objects in the scene unmovable. And if it's merely a matter of being able to open a cabinet door or something that should cause a shadow to move, you could bake two textures, one with the door closed and the other with it open, and then draw with whichever texture is most appropriate.

And I imagine you could combine this technique with other shadow techniques if you have for example an object that moves around the room. I would imagine a moving shadow on top of the baked shadows could still look realistic.

EDIT: After looking at the picture again, I noticed that the seamless wall tiles on the wall are not seamless. In order to make the baked lighting work, you're going to need at least an entire wall panel to be UV unwrapped as a single texture so that the shadows can be saved on it. It will probably solve the seam problem at the same time.

I've never baked anything as complex as this scene, but I would probably make the floor and each wall separate meshes with separate UV maps. I'd probably make them 2K (2048 by 2048), although you might get away with making all 3 walls and possibly even the floor a single map. I don't know what you plan on rendering this on, but that should be pretty doable on most PC's. Then the cabinet objects would have lighting and shadows baked into their maps as well. You probably want to create the entire scene in Blender and bake the maps into each model while they are all together under the same lighting.

Oh. And in that video he leaves out one extremely critical step: selecting "Cycles Render" from the top menu which will be off by default. You can bake without Cycles. I've done it for a few things. But Cycles looks an order of magnitude better. And it's not that difficult to use once you get the hang of it. Still, you may want to find a video that shows how to bake lighting without Cycles to start with just so that you don't have to learn Cycles to try this.

Oh, and big hint: With Cycles you want to delete all your standard lights, then create a small plane, and set it to emmisive; that will be your light source.