SpiderPig Posted April 14, 2014 Share Posted April 14, 2014 Steam Edition v3.1 converts images to the .tex format with loss of quality and various other defects. Attached is some images of the problem. Thread : http://www.leadwerks.com/werkspace/topic/9440-loosing-quality-through-drawimage/#entry71425 Data.zip Link to comment Share on other sites More sharing options...
Josh Posted April 14, 2014 Share Posted April 14, 2014 I'm not sure what I'm looking for here, but the sample textures are using mipmapping...this will cause the converter to resize the image to the closest power-of-two dimensions, which will cause the results to look different. When I disabled mipmapping the converted image looks identical to the original. My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted April 14, 2014 Share Posted April 14, 2014 If you open the shader "Shaders/Drawing/drawimage.shader" and replace the vertex source with this, you may see a small improvement in image quality: #version 400 uniform mat4 projectionmatrix; uniform mat4 drawmatrix; uniform vec2 offset; uniform vec2 position[4]; uniform vec2 texcoords[4]; // ADD THIS: -------------------------------- uniform vec2 buffersize; //-------------------------------------------------- in vec3 vertex_position; in vec2 vertex_texcoords0; out vec2 vTexCoords0; void main(void) { gl_Position = projectionmatrix * (drawmatrix * vec4(position[gl_VertexID]+offset, 0.0, 1.0)); // AND THIS ------------------------ gl_Position += vec4(0.5/buffersize.x,0.5/buffersize.y,0.0,0.0); //----------------------------------------- vTexCoords0 = texcoords[gl_VertexID]; } My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
SpiderPig Posted April 14, 2014 Author Share Posted April 14, 2014 The new shader solved the problem perfectly, thanks! In future when I update my project, will the shader convert to the old one or will you update that too? Link to comment Share on other sites More sharing options...
Josh Posted April 14, 2014 Share Posted April 14, 2014 I think it's safe for me to go ahead and include this since it is a tiny change most people won't notice. 7 My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
SpiderPig Posted April 15, 2014 Author Share Posted April 15, 2014 Cool video Link to comment Share on other sites More sharing options...
Josh Posted May 10, 2014 Share Posted May 10, 2014 Note the shader above will cause the terrain editor to not work correctly. My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Recommended Posts