Page 1 of 1

Mothers mapconv no scanlines fixed! DOWNLOAD MAPCONV HERE

Posted: 03 Feb 2009, 14:06
by Beherith
As you may know, Ive had real trouble using users mapconv, getting very inconsistent results, and even when it succeeded, I got scan lines on it.
So I checked out the old version of mapconv from svn to try and and see where the trouble was. It turns out that mapconv uses an outdated set of parameters for nvdxt, that were hard coded. Unfortunately I was not able to recompile it from the svn source, as several files were missing and it required some funky old boost lib I counldnt get :(

So I tried the next closest thing; I wrote a tiny program that masquerades as nvdxt, and forwards the call to it from mapconv, with setable parameters.

My bit of code is named nvdxt.exe, and I renamed the real nvdxt.exe to nvdxt2.exe. This way, i can forward this call: nvdxt2.exe -file temp\*.bmp -nmips 5 -dxt1 -box -fadeamount 0 . Which results in a complete lack of scanlines. Beware, this is the default line and is set to high quailty, so it will be slower than previous compilings.

Also included is the latest version of nvdia's nvdxt.

Usage:
Download it here from jobjol:

http://spring.jobjol.nl/show_file.php?id=1745

To install, unzip the contents to the dir where you use mapconv.
Then just run your compilation .bat file as normal.
To change nvdxt options, create an nvargs.txt file next to nvdxt, and add the line you want it to use for compiling.

Re: Mothers mapconv no scanlines fixed!

Posted: 10 Feb 2009, 12:31
by BaNa
Gj man, im kind of miffed noone replied to this yet >_>

I may recompile some of my older maps if i can find the sources

Re: Mothers mapconv no scanlines fixed!

Posted: 01 Mar 2009, 11:39
by Beherith
Here is the source code for the wrapper:

Code: Select all

#include "stdafx.h"
#include <stdio.h>
#include <stdlib.h>
#include <cstring> 

int main(int argc, char* argv[])
{
	//printf("Opening file nvargs.txt");
	bool minimap=false;
	char * buff;
	buff="nvdxt2.exe -file temp\\*.bmp -nmips 5 -dxt1 -box -fadeamount 0";
	if (argc>3) {
		if (strcmp(argv[2],"mini.bmp")==0) minimap=true;
		else{
			FILE * f=fopen("nvargs.txt","r");
			if (f!=NULL) {
				printf("Opened file nvargs.txt, using options set theirin\n");
				buff = new char[255];
				fgets(buff, 250,f);
				fclose(f);
			}
			else{
				printf("Failed to open NVARGS.TXT, using default arguments:\nnvdxt2.exe -file temp\\*.bmp -nmips 5 -dxt1 -box -fadeamount 0\n ");
			
			}
		}
	}else{
		printf("Usage:\n  Rename original nvdxt.exe to nvdxt2.exe and add your nvdxt command line to nvargs.txt \n Default nvargs are:\n  nvdxt2.exe -file temp\*.bmp -nmips 5 -dxt1 -box -fadeamount 0\n");
		return 0;
	}
	printf("Executing:");
	if (minimap== false){
		printf("%s \n",buff);
		system(buff);
	}
	else{ 
		printf("nvdxt2.exe -file mini.bmp -dxt1a");
		system("nvdxt2.exe -file mini.bmp -dxt1a");
	}
	return 0;
}


Re: Mothers mapconv no scanlines fixed!

Posted: 01 Mar 2009, 11:43
by Hoi
This need to be a sticky.

Re: Mothers mapconv no scanlines fixed!

Posted: 23 Mar 2009, 09:57
by SwiftSpear
ASDFASASEF

Frigging awesome!

Re: Mothers mapconv no scanlines fixed!

Posted: 07 Apr 2009, 22:12
by MidKnight
Image
(clickity)

Ahem?

I compiled this with your wrapper, but I still have scanlines. Why? :(

Re: Mothers mapconv no scanlines fixed!

Posted: 08 Apr 2009, 00:00
by Beherith
Thats quite odd...
Are you sure you overwrote your old nvdxt.exe with mine?
You can check if its compiling with mine in the output of mapconv.

Try deleting nvargs.txt too.

Re: Mothers mapconv no scanlines fixed!

Posted: 21 Apr 2009, 16:50
by Beherith
Ah found the cause of your lines, high compression causes it. Set mapconv compression to <0.5

Re: Mothers mapconv no scanlines fixed!

Posted: 22 Apr 2009, 00:35
by lurker
How is that possible? The compression setting shouldn't affect the DDS building, right?

Re: Mothers mapconv no scanlines fixed!

Posted: 22 Apr 2009, 05:29
by prodigy
I don't know what causes the scanlines. But I have never seen them when using my mapconv.

Perhaps you could try my mapdeconv, which decompiles SMF/SMT files, and see if the resulting texture.bmp contains the scanlines for your SMF/SMT.

http://code.google.com/p/mapc/

Re: Mothers mapconv no scanlines fixed!

Posted: 22 Apr 2009, 10:40
by Kloot
prodigy wrote:I don't know what causes the scanlines.
They are an artefact of nvdxt itself; Linux builds of the old mother/user mapconv (which by default use mother's own texcompress tool to build the DDS textures) never showed them either, nor did versions of mapconv + texcompress cross-compiled from Linux to Windows. (Whether the lines are due to the parameters passed to nvdxt or a bug is open for debate though.)

Re: Mothers mapconv no scanlines fixed!

Posted: 22 Apr 2009, 11:10
by Beherith
I think they are an artifact of NVDXT, but can be easily fixed by passing a different set of parameters.

Re: Mothers mapconv no scanlines fixed!

Posted: 22 Apr 2009, 12:20
by prodigy
Kloot wrote:
prodigy wrote:I don't know what causes the scanlines.
They are an artefact of nvdxt itself; Linux builds of the old mother/user mapconv (which by default use mother's own texcompress tool to build the DDS textures) never showed them either, nor did versions of mapconv + texcompress cross-compiled from Linux to Windows. (Whether the lines are due to the parameters passed to nvdxt or a bug is open for debate though.)
OK that would explain why I have never seen the lines with my mapconv which I modified to use libsquish instead of nvdxt/texcompress.

Thanks for the info.

edit: Just found this blog entry by the guy who made the nvidia-texture-tools. What is interesting, perhaps not relevant in this case but something to consider:
NVIDIA used to perform the DXT1 interpolation in 16 bits, and in some hardware, to compensate for the quantization artifacts, introduced some dithering patterns that in some cases even worsened the results.

Modern NVIDIA hardware does not have these problems, but it still doesnÔÇÖt implement the palette evaluation using the exact formula.

Re: Mothers mapconv no scanlines fixed!

Posted: 04 Jun 2009, 01:28
by smoth
bump.

Re: Mothers mapconv no scanlines fixed!

Posted: 23 Jun 2009, 02:09
by hunterw
add this to OP:

http://springrts.com/wiki/Maps:Compiling

i got asked 23523523 questions today bout making your .bat file and compiling and how you cant rename your map wtihout it being pink

Re: Mothers mapconv no scanlines fixed!

Posted: 23 Jun 2009, 03:37
by Beherith
Fixed wiki page to show working link to mapconv.