1
0
Fork 0
This commit is contained in:
May B. 2020-07-11 22:10:21 +02:00
parent 91e8c1a619
commit ca0fae3d83
4 changed files with 42 additions and 14 deletions

25
TODO.md
View File

@ -7,17 +7,38 @@
- [ ] Serialize
- [ ] In memory RLE
- [ ] Edition
- [ ] Entity
- [ ] Planet
- [ ] Galaxy
- [ ] Biomes
- https://imgur.com/kM8b5Zq
- https://imgur.com/a/bh2iy
- https://speciesdevblog.files.wordpress.com/2012/11/biomemap.png
- [ ] Leak test
- https://www.deleaker.com
- https://www.parasoft.com
- Valgrind
- Gprof /pprof
- [ ] ZeroMQ
- [ ] Server
## Rendering
- [x] Render triangle
- [x] Avoid texture noise
- [x] Better cheap planar
- [x] MipMap LOD
- [x] Fog
- [ ] SRGB
- [x] Multi Samples
- [x] SRGB
- [ ] HDR
- https://www.youtube.com/watch?v=iikdcAA7cww
- Toon shading
- Eye adaptation
- [ ] Post processing
- https://learnopengl.com/Advanced-OpenGL/Anti-Aliasing
- [ ] Skybox
- [ ] Better cheap planar
- [ ] Cascaded shadow maps
- [ ] RayCast
## Contouring
- [x] Box contouring

View File

@ -98,15 +98,15 @@ void main() {
#ifdef PBR
// Material properties
vec3 MaterialDiffuseColor = tex;
vec3 MaterialAmbientColor = vec3(.2) * MaterialDiffuseColor * texHOS.y;
vec3 MaterialSpecularColor = vec3(.3) * texHOS.z;
vec3 MaterialAmbientColor = vec3(.1) * MaterialDiffuseColor * texHOS.y;
vec3 MaterialSpecularColor = vec3(.8) * texHOS.z;
vec3 Normal_cameraspace = normalize((View * vec4(worldNormal,0)).xyz);
// Light emission properties
// You probably want to put them as uniforms
vec3 LightColor = vec3(1,1,1);
float LightPower = 1.5f;
vec3 LightColor = vec3(1, 0.9, 0.9);
float LightPower = 1.f;
// Distance to the light
float distance = 1.0f;//length( LightPosition_worldspace - Position_worldspace );
@ -146,6 +146,7 @@ void main() {
#endif
#if FOG
float ratio = exp(vs.Depth * 0.69)-1;
color = mix(color, FogColor, clamp(ratio, 0, 1));
color = mix(color, pow(FogColor, vec3(2.2)), clamp(ratio, 0, 1));
#endif
color = pow(color, vec3(1.0 / 2.2));
}

View File

@ -172,13 +172,13 @@ GLuint loadDDS(const std::string& imagepath, bool linear){
switch(fourCC)
{
case FOURCC_DXT1:
format = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT;
format = GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;
break;
case FOURCC_DXT3:
format = GL_COMPRESSED_RGBA_S3TC_DXT3_EXT;
format = GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;
break;
case FOURCC_DXT5:
format = GL_COMPRESSED_RGBA_S3TC_DXT5_EXT;
format = GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT;
break;
default:
free(buffer);
@ -193,7 +193,7 @@ GLuint loadDDS(const std::string& imagepath, bool linear){
glBindTexture(GL_TEXTURE_2D, textureID);
glPixelStorei(GL_UNPACK_ALIGNMENT,1);
unsigned int blockSize = (format == GL_COMPRESSED_RGBA_S3TC_DXT1_EXT) ? 8 : 16;
unsigned int blockSize = (format == GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT) ? 8 : 16;
unsigned int offset = 0;
/* load the mipmaps */
@ -262,13 +262,13 @@ GLuint loadDDSArray(const std::vector<std::string>& imagepaths, float mipMapLOD)
switch (mainFourCC)
{
case FOURCC_DXT1:
mainFormat = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT;
mainFormat = GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;
break;
case FOURCC_DXT3:
mainFormat = GL_COMPRESSED_RGBA_S3TC_DXT3_EXT;
mainFormat = GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;
break;
case FOURCC_DXT5:
mainFormat = GL_COMPRESSED_RGBA_S3TC_DXT5_EXT;
mainFormat = GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT;
break;
default:
return 0;

View File

@ -77,5 +77,11 @@ GLFWwindow* createWindow(int samples) {
glEnable(GL_CULL_FACE);
glCullFace(GL_BACK);
GLint smp;
glGetIntegerv(GL_SAMPLES, &smp);
if(smp > 0) {
glEnable(GL_MULTISAMPLE);
}
return window;
}