Making a map look good (Shaders, lighting etc)

Post your questions, suggestions and experiences regarding game design, integration of external libraries here. For irrEdit, irrXML and irrKlang, see the
ambiera forums
Post Reply
rubenwardy
Posts: 91
Joined: Mon Mar 05, 2012 4:51 pm
Location: Bristol, UK
Contact:

Making a map look good (Shaders, lighting etc)

Post by rubenwardy »

I made a house in blender, and the renders look ok. When I import it into Irrlicht, it looks terrible.
For some reason, even texture cubes look shitty.

I would like some advice on how to make a map look ok.
What shaders, material techniques, effects, lighting, etc should I use to make maps look better?

I am not sure if this is the right section.

http://ubuntuone.com/678CSio3HYWwJwScxpoPIB
Left is the blender render, right is the irrlicht render.

Code: Select all

 
    <node type="mesh">
          <attributes>
             <string name="Name" value="Shop"/>
             <int name="Id" value="-1"/>
             <bool name="Visible" value="true"/>
             <vector3d name="Position" value="0, 0, 0"/>
             <vector3d name="Rotation" value="0, 0, 0"/>
             <vector3d name="Scale" value="7.7895, 5.041653, 5.81718"/>
             <enum name="AutomaticCulling" value="frustum_box"/>
             <bool name="DebugDataVisible" value="false"/>
             <bool name="IsDebugObject" value="false"/>
             <bool name="ReadOnlyMaterials" value="false"/>
             <string name="Mesh" value="mdl/Cube.irrmesh"/>
             <enum name="HardwareMappingHint" value="never"/>
             <enum name="HardwareMappingBufferType" value="vertexindex"/>
          </attributes>
          <userData>
             <attributes>
             </attributes>
          </userData>
      </node>
 
rubenwardy
Posts: 91
Joined: Mon Mar 05, 2012 4:51 pm
Location: Bristol, UK
Contact:

After some fiddling

Post by rubenwardy »

Update:

Image
Marthog
Posts: 31
Joined: Sun Oct 03, 2010 8:33 pm
Contact:

Re: Making a map look good (Shaders, lighting etc)

Post by Marthog »

You need per pixel lighting.

Oddly enough Irrlicht does not have per pixel lighting as standard material but it has more complex materials which are based on it . You may try to use the material bump map with a grey texture as heightmap, but for the best solution you should write an own shader.

For speed reasons the renderers do not calculate the light for each visible pixel but just for each single face (flat) or for each vertex and then interpolates the values (gouraud shading). Flat shading is the cheapest but it looks ugly. Gouroud shading needs a few more calculations but it is still fast enough but significantly more beautiful.


There is also another possible material which is only useful if the scene is static for lights that do not move: Lightmapping
That means lighting is calculated once before rendering the scene and just loaded. You can calculate it for complex scenes during the development process in a high quality and in the finished game it is technically just a second texture which sets the light values. A shop normally is a static scene and so this material might be the best solution, as long as you don't have "special" features like a oscillating lamp.
Rust fanboy
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: Making a map look good (Shaders, lighting etc)

Post by hendu »

Also your floor stone thingy is clearly two meshes and not one. Shadow volumes don't like that, as you can see. Use shadow maps instead.
rubenwardy
Posts: 91
Joined: Mon Mar 05, 2012 4:51 pm
Location: Bristol, UK
Contact:

Re: Making a map look good (Shaders, lighting etc)

Post by rubenwardy »

hendu wrote:Also your floor stone thingy is clearly two meshes and not one. Shadow volumes don't like that, as you can see. Use shadow maps instead.
The box on the roof is just for testing. Everything else is one model, uv mapped.

EDIT: Duplicate shadows is because of two lights.
Marthog wrote:There is also another possible material which is only useful if the scene is static for lights that do not move: Lightmapping
That means lighting is calculated once before rendering the scene and just loaded. You can calculate it for complex scenes during the development process in a high quality and in the finished game it is technically just a second texture which sets the light values. A shop normally is a static scene and so this material might be the best solution, as long as you don't have "special" features like a oscillating lamp.
I could do this to the inside of the shop, as the light will not change much, but I can not do it to the outside as there will be day/night loops.
Marthog
Posts: 31
Joined: Sun Oct 03, 2010 8:33 pm
Contact:

Re: Making a map look good (Shaders, lighting etc)

Post by Marthog »

I could do this to the inside of the shop, as the light will not change much, but I can not do it to the outside as there will be day/night loops.[/quote]

A lot of modern games like Risen and Skyrim also have a day night circle but they still use lightmapping. The have a set of precalculated maps and chosse one to render.
For swapping the lightmaps you can either just jump to the next which leads to jumping shadows or you can interpolate between both lightmaps.
Skyrim uses most of the time the static lightmaps but changes them smoothly by interpolating but I disabled the interpolation because it leads to graphic bugs on my hardware so you should use a bugfix option in your configuration files.
Rust fanboy
Post Reply