/noise_layering_GeneratePoint.cpp Secret
Created
October 6, 2016 15:57
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vector<float, 3> NoiseLayering::GeneratePoint( const float p_height, const float p_temp, const float p_wet ) { | |
Vector<float, 3> myColor; | |
if ( p_height < 0.3f ) { | |
SetColor( myColor, 0, 0, 255 ); // Ocean | |
} else if ( p_height < 0.32 ) { | |
SetColor( myColor, 177, 166, 29 ); // Sand | |
} else if ( p_height > 0.85f ) { | |
SetColor( myColor, 255, 255, 255 ); // Snow | |
} else if ( p_height > 0.75f ) { | |
SetColor( myColor, 132, 132, 132 ); // Rock | |
} else { | |
if ( p_wet >= 0.75 ) { | |
if ( p_temp >= 0.75f ) { | |
// Rainforest | |
SetColor( myColor, 8, 250, 54 ); | |
} else { | |
// Swamp | |
SetColor( myColor, 7, 249, 162 ); | |
} | |
} else if ( p_wet >= 0.5f ) { | |
if ( p_temp >= 0.75f ) { | |
// Seasonal forest | |
SetColor( myColor, 155, 224, 35 ); | |
} else if ( p_temp >= 0.5f ) { | |
// Forest | |
SetColor( myColor, 100, 148, 12 ); | |
} else { | |
// Taiga | |
SetColor( myColor, 5, 102, 33 ); | |
} | |
} else if ( p_wet >= 0.25f ) { | |
if ( p_temp >= 0.75f ) { | |
// Savanah | |
SetColor( myColor, 255, 255, 94 ); | |
} else if ( p_temp >= 0.5f ) { | |
// Woods | |
SetColor( myColor, 46, 177, 83 ); | |
} else { | |
// Taiga | |
SetColor( myColor, 5, 102, 33 ); | |
} | |
} else { | |
if ( p_temp >= 0.625 ) { | |
// Desert | |
SetColor( myColor, 177, 166, 29 ); | |
} else if ( p_temp >= 0.25 ) { | |
// Grass Desert | |
SetColor( myColor, 247, 193, 0 ); | |
} else { | |
// Tundra | |
SetColor( myColor, 81, 237, 250 ); | |
} | |
} | |
} | |
return myColor; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment