therealryan / minedroid

Automatically exported from code.google.com/p/minedroid
0 stars 0 forks source link

Simple graphics update #22

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Here a tip for better graphics with little/none performance loss:
I'm writing a windows minecraft clone myself (mineworld on googlecode) and I 
found that the graphics will look better if you render all sides of the cube 
with diffrent ligtning:

Multiply lightness factor on top of the cube with 0.8
Bottom: 0.2
North: 0.6
East: 0.6
South 0.4
West: 0.4

This will create a more "minecrafty" feel. (At least in my PC version)
It looks less flat.
In my case this value is added in the lightning engine at the part where the 
blocklist is converted to a vertexlist

if(faceDir==Facedirection.YIncrasing)
{
//coordinate crap snipped
Vertex.Shader.Lightfactor=Block.Lightfactor*0.8
}

Original issue reported on code.google.com by pizzamar...@gmail.com on 3 May 2011 at 7:33

GoogleCodeExporter commented 9 years ago
I've looked through the sourcecode and I think this is the part that should be 
changed for this: (i'm a C# programmer, not java)
GeometryGenerator.java:80-96
if( b == null || !b.opaque )
{
        addFace( c, b, xi - 1, yi, zi, Face.South, Colour.packFloat( light*0.4, light*0.4, light*0.4, 1 ),
                        opaqueVBOBuilder, transVBOBuilder );
        addFace( c, b, xi + 1, yi, zi, Face.North, Colour.packFloat( light*0.6, light*0.6, light*0.6, 1 ),
                        opaqueVBOBuilder, transVBOBuilder );
        addFace( c, b, xi, yi, zi - 1, Face.West, Colour.packFloat( light*0.4, light*0.4, light*0.4, 1 ),
                        opaqueVBOBuilder, transVBOBuilder );
        addFace( c, b, xi, yi, zi + 1, Face.East, Colour.packFloat( light*0.6, light*0.6, light*0.6, 1 ),
                        opaqueVBOBuilder, transVBOBuilder );
        addFace( c, b, xi, yi + 1, zi, Face.Bottom, Colour.packFloat( light*0.2, light*0.2, light*0.2, 1 ),
                        opaqueVBOBuilder, transVBOBuilder );
        addFace( c, b, xi, yi - 1, zi, Face.Top, Colour.packFloat( light*0.8, light*0.8, light*0.8, 1 ),
                        opaqueVBOBuilder, transVBOBuilder );
}

Original comment by pizzamar...@gmail.com on 4 May 2011 at 10:30

GoogleCodeExporter commented 9 years ago

Original comment by therealryan on 2 Jun 2011 at 10:03

GoogleCodeExporter commented 9 years ago
I have tested it, and get only an Error at compiling :(

But the Idea is good! :D

Original comment by freestyl...@googlemail.com on 14 Jul 2012 at 12:07