Lighting

Improving the artwork in Warzone2100 - not for mod discussions
Post Reply
Jorzi
Regular
Regular
Posts: 2063
Joined: 11 Apr 2010, 00:14

Re: Lighting

Post by Jorzi »

I haven't yet had the chance to test this code, but I've made similar changes to example shaders in rendermonkey (some kind of shader authoring ide) and they've worked as intended, so I'm hopeful about this one.
Remove the .txt extension, I added it just to be able to upload the file as an attachement.
Attachments
tcmask.frag.txt
(1.81 KiB) Downloaded 321 times
ImageImage
-insert deep philosophical statement here-
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: Lighting

Post by Per »

I've committed the normal map loading code now, so it should be in the next master snapshot.
Jorzi
Regular
Regular
Posts: 2063
Joined: 11 Apr 2010, 00:14

Re: Lighting

Post by Jorzi »

Tried to compile myself, although I have no previous knowledge of compiling anything besides my personal java netbeans projects...

I actually came this far:

Code: Select all

C:\Users\TALI\Desktop\Görans randomkrääsä\Wz git repository>mingw32-make -f make
file.win32
Checking config...
PACKAGE_VERSION := TRUNK
MODE := debug
DEVDIR := C:/devpkg-2.2
Config seems valid.
mingw32-make[1]: Entering directory `C:/Users/TALI/Desktop/Görans randomkrääsä/W
z git repository/build_tools'
mingw32-make[2]: Entering directory `C:/Users/TALI/Desktop/Görans randomkrääsä/W
z git repository/build_tools/autorevision'
makefile.win32:25: warning: overriding commands for target `clean'
../../makerules/exe.mk:13: warning: ignoring old commands for target `clean'
g++ -I../.. -DPACKAGE=\"warzone2100\" -DPACKAGE_VERSION=\"TRUNK\" -DYY_STATIC -I
C:/devpkg-2.2/include/SDL -IC:/devpkg-2.2/include/libpng12 -IC:/devpkg-2.2/inclu
de/bfd -IC:/devpkg-2.2/include -DDEBUG -DWIN32   -g -Wall -O0  -c -o autorevisio
n.o autorevision.cpp
autorevision.cpp:758: warning: 'std::string integerOnly(const std::string&)' def
ined but not used
g++ -std=gnu99 -g -Wall -Werror-implicit-function-declaration -O0  -o autorevisi
on.exe autorevision.o -LC:/devpkg-2.2/lib  -lmingw32 -lSDLmain -lSDL -lpng12 -lp
hysfs -lz -lvorbisfile -lvorbis -logg -lpopt -lintl -lGLC -lglu32 -lopengl32 -lo
penal32 -ldbghelp -lshfolder -lwinmm -lshlwapi -lpsapi -lshell32 -lws2_32 -lbfd
-liberty -liconv -lz -lfreetype -lfontconfig -lexpat -ltheora
autorevision.exe +cstr -v ..\\.. ..\\..\\src\\autorevision.h
fatal: no tag exactly matches '0621b8a40f31b21768771b261af3f272f8a6b8aa'
fatal: ref HEAD is not a symbolic ref
Warning: could not open input file.
         This does not seem to be a revision controlled project.
Warning: could not open input file.
         This does not seem to be a revision controlled project.
mingw32-make[2]: Leaving directory `C:/Users/TALI/Desktop/Görans randomkrääsä/Wz
 git repository/build_tools/autorevision'
mingw32-make[1]: Leaving directory `C:/Users/TALI/Desktop/Görans randomkrääsä/Wz
 git repository/build_tools'
mingw32-make[1]: Entering directory `C:/Users/TALI/Desktop/Görans randomkrääsä/W
z git repository/po'
mingw32-make[1]: Nothing to be done for `all'.
mingw32-make[1]: Leaving directory `C:/Users/TALI/Desktop/Görans randomkrääsä/Wz
 git repository/po'
mingw32-make[1]: Entering directory `C:/Users/TALI/Desktop/Görans randomkrääsä/W
z git repository/win32'
del /F warzone2100.o
Could Not Find C:\Users\TALI\Desktop\Görans randomkrääsä\Wz git repository\win32
\warzone2100.o
mingw32-make[1]: Leaving directory `C:/Users/TALI/Desktop/Görans randomkrääsä/Wz
 git repository/win32'
mingw32-make[1]: Entering directory `C:/Users/TALI/Desktop/Görans randomkrääsä/W
z git repository/3rdparty'
mingw32-make[1]: *** No targets.  Stop.
mingw32-make[1]: Leaving directory `C:/Users/TALI/Desktop/Görans randomkrääsä/Wz
 git repository/3rdparty'
mingw32-make: *** [3rdparty] Error 2

C:\Users\TALI\Desktop\Görans randomkrääsä\Wz git repository>
now it seems to have some kind of problem with the "3rdparty" folder
Edit: note that it is entirely possible that I am just making a bunch of stupid mistakes...
ImageImage
-insert deep philosophical statement here-
User avatar
Fastdeath
Trained
Trained
Posts: 115
Joined: 16 Jan 2010, 08:52

Re: Lighting

Post by Fastdeath »

Jorzi wrote:Tried to compile myself, although I have no previous knowledge of compiling anything besides my personal java netbeans projects...

I actually came this far:

Code: Select all

C:\Users\TALI\Desktop\Görans randomkrääsä\Wz git repository>mingw32-make -f make
file.win32
Checking config...
PACKAGE_VERSION := TRUNK
MODE := debug
DEVDIR := C:/devpkg-2.2
Config seems valid.
mingw32-make[1]: Entering directory `C:/Users/TALI/Desktop/Görans randomkrääsä/W
z git repository/build_tools'
mingw32-make[2]: Entering directory `C:/Users/TALI/Desktop/Görans randomkrääsä/W
z git repository/build_tools/autorevision'
makefile.win32:25: warning: overriding commands for target `clean'
../../makerules/exe.mk:13: warning: ignoring old commands for target `clean'
g++ -I../.. -DPACKAGE=\"warzone2100\" -DPACKAGE_VERSION=\"TRUNK\" -DYY_STATIC -I
C:/devpkg-2.2/include/SDL -IC:/devpkg-2.2/include/libpng12 -IC:/devpkg-2.2/inclu
de/bfd -IC:/devpkg-2.2/include -DDEBUG -DWIN32   -g -Wall -O0  -c -o autorevisio
n.o autorevision.cpp
autorevision.cpp:758: warning: 'std::string integerOnly(const std::string&)' def
ined but not used
g++ -std=gnu99 -g -Wall -Werror-implicit-function-declaration -O0  -o autorevisi
on.exe autorevision.o -LC:/devpkg-2.2/lib  -lmingw32 -lSDLmain -lSDL -lpng12 -lp
hysfs -lz -lvorbisfile -lvorbis -logg -lpopt -lintl -lGLC -lglu32 -lopengl32 -lo
penal32 -ldbghelp -lshfolder -lwinmm -lshlwapi -lpsapi -lshell32 -lws2_32 -lbfd
-liberty -liconv -lz -lfreetype -lfontconfig -lexpat -ltheora
autorevision.exe +cstr -v ..\\.. ..\\..\\src\\autorevision.h
fatal: no tag exactly matches '0621b8a40f31b21768771b261af3f272f8a6b8aa'
fatal: ref HEAD is not a symbolic ref
Warning: could not open input file.
         This does not seem to be a revision controlled project.
Warning: could not open input file.
         This does not seem to be a revision controlled project.
mingw32-make[2]: Leaving directory `C:/Users/TALI/Desktop/Görans randomkrääsä/Wz
 git repository/build_tools/autorevision'
mingw32-make[1]: Leaving directory `C:/Users/TALI/Desktop/Görans randomkrääsä/Wz
 git repository/build_tools'
mingw32-make[1]: Entering directory `C:/Users/TALI/Desktop/Görans randomkrääsä/W
z git repository/po'
mingw32-make[1]: Nothing to be done for `all'.
mingw32-make[1]: Leaving directory `C:/Users/TALI/Desktop/Görans randomkrääsä/Wz
 git repository/po'
mingw32-make[1]: Entering directory `C:/Users/TALI/Desktop/Görans randomkrääsä/W
z git repository/win32'
del /F warzone2100.o
Could Not Find C:\Users\TALI\Desktop\Görans randomkrääsä\Wz git repository\win32
\warzone2100.o
mingw32-make[1]: Leaving directory `C:/Users/TALI/Desktop/Görans randomkrääsä/Wz
 git repository/win32'
mingw32-make[1]: Entering directory `C:/Users/TALI/Desktop/Görans randomkrääsä/W
z git repository/3rdparty'
mingw32-make[1]: *** No targets.  Stop.
mingw32-make[1]: Leaving directory `C:/Users/TALI/Desktop/Görans randomkrääsä/Wz
 git repository/3rdparty'
mingw32-make: *** [3rdparty] Error 2

C:\Users\TALI\Desktop\Görans randomkrääsä\Wz git repository>
now it seems to have some kind of problem with the "3rdparty" folder
Edit: note that it is entirely possible that I am just making a bunch of stupid mistakes...
Think i fixed that, can you update your clone and see if it builds?
Nightly builds available here see buildbot for more infos about them
Lobby Server: here and here
SharpFlame the new WZ Map Editor
Jorzi
Regular
Regular
Posts: 2063
Joined: 11 Apr 2010, 00:14

Re: Lighting

Post by Jorzi »

At least it goes a bit further...

Code: Select all

C:\Users\TALI\Desktop\Görans randomkrääsä\Wz git repository>mingw32-make -f make
file.win32
Checking config...
PACKAGE_VERSION := TRUNK
MODE := debug
DEVDIR := C:/devpkg-2.2
Config seems valid.
mingw32-make[1]: Entering directory `C:/Users/TALI/Desktop/Görans randomkrääsä/W
z git repository/build_tools'
mingw32-make[2]: Entering directory `C:/Users/TALI/Desktop/Görans randomkrääsä/W
z git repository/build_tools/autorevision'
makefile.win32:25: warning: overriding commands for target `clean'
../../makerules/exe.mk:13: warning: ignoring old commands for target `clean'
autorevision.exe +cstr -v ..\\.. ..\\..\\src\\autorevision.h
fatal: no tag exactly matches 'e5de5916154495741adb4222e244ba91ae04704b'
fatal: ref HEAD is not a symbolic ref
Warning: could not open input file.
         This does not seem to be a revision controlled project.
Warning: could not open input file.
         This does not seem to be a revision controlled project.
mingw32-make[2]: Leaving directory `C:/Users/TALI/Desktop/Görans randomkrääsä/Wz
 git repository/build_tools/autorevision'
mingw32-make[1]: Leaving directory `C:/Users/TALI/Desktop/Görans randomkrääsä/Wz
 git repository/build_tools'
mingw32-make[1]: Entering directory `C:/Users/TALI/Desktop/Görans randomkrääsä/W
z git repository/po'
mingw32-make[1]: Nothing to be done for `all'.
mingw32-make[1]: Leaving directory `C:/Users/TALI/Desktop/Görans randomkrääsä/Wz
 git repository/po'
mingw32-make[1]: Entering directory `C:/Users/TALI/Desktop/Görans randomkrääsä/W
z git repository/win32'
del /F warzone2100.o
Could Not Find C:\Users\TALI\Desktop\Görans randomkrääsä\Wz git repository\win32
\warzone2100.o
mingw32-make[1]: Leaving directory `C:/Users/TALI/Desktop/Görans randomkrääsä/Wz
 git repository/win32'
mingw32-make[1]: Entering directory `C:/Users/TALI/Desktop/Görans randomkrääsä/W
z git repository/3rdparty/miniupnpc'
makefile.win32:6: ../../../makerules/common.mk: No such file or directory
makefile.win32:21: ../../../makerules/lib.mk: No such file or directory
mingw32-make[1]: *** No rule to make target `../../../makerules/lib.mk'.  Stop.
mingw32-make[1]: Leaving directory `C:/Users/TALI/Desktop/Görans randomkrääsä/Wz
 git repository/3rdparty/miniupnpc'
mingw32-make: *** [3rdparty/miniupnpc] Error 2
ImageImage
-insert deep philosophical statement here-
Jorzi
Regular
Regular
Posts: 2063
Joined: 11 Apr 2010, 00:14

Re: Lighting

Post by Jorzi »

I edited the makefile in miniupnpc and changed the top_srcdir from ../../.. to ../.., and now it gives me this instead...

Code: Select all

C:\Users\TALI\Desktop\Görans randomkrääsä\Wz git repository>mingw32-make -f make
file.win32
Checking config...
PACKAGE_VERSION := TRUNK
MODE := debug
DEVDIR := C:/devpkg-2.2
Config seems valid.
mingw32-make[1]: Entering directory `C:/Users/TALI/Desktop/Görans randomkrääsä/W
z git repository/build_tools'
mingw32-make[2]: Entering directory `C:/Users/TALI/Desktop/Görans randomkrääsä/W
z git repository/build_tools/autorevision'
makefile.win32:25: warning: overriding commands for target `clean'
../../makerules/exe.mk:13: warning: ignoring old commands for target `clean'
autorevision.exe +cstr -v ..\\.. ..\\..\\src\\autorevision.h
fatal: no tag exactly matches 'e5de5916154495741adb4222e244ba91ae04704b'
fatal: ref HEAD is not a symbolic ref
Warning: could not open input file.
         This does not seem to be a revision controlled project.
Warning: could not open input file.
         This does not seem to be a revision controlled project.
mingw32-make[2]: Leaving directory `C:/Users/TALI/Desktop/Görans randomkrääsä/Wz
 git repository/build_tools/autorevision'
mingw32-make[1]: Leaving directory `C:/Users/TALI/Desktop/Görans randomkrääsä/Wz
 git repository/build_tools'
mingw32-make[1]: Entering directory `C:/Users/TALI/Desktop/Görans randomkrääsä/W
z git repository/po'
mingw32-make[1]: Nothing to be done for `all'.
mingw32-make[1]: Leaving directory `C:/Users/TALI/Desktop/Görans randomkrääsä/Wz
 git repository/po'
mingw32-make[1]: Entering directory `C:/Users/TALI/Desktop/Görans randomkrääsä/W
z git repository/win32'
del /F warzone2100.o
Could Not Find C:\Users\TALI\Desktop\Görans randomkrääsä\Wz git repository\win32
\warzone2100.o
mingw32-make[1]: Leaving directory `C:/Users/TALI/Desktop/Görans randomkrääsä/Wz
 git repository/win32'
mingw32-make[1]: Entering directory `C:/Users/TALI/Desktop/Görans randomkrääsä/W
z git repository/3rdparty/miniupnpc'
gcc -I../.. -DSTATICLIB -DPACKAGE=\"warzone2100\" -DPACKAGE_VERSION=\"TRUNK\" -D
YY_STATIC -IC:/devpkg-2.2/include/SDL -IC:/devpkg-2.2/include/libpng12 -IC:/devp
kg-2.2/include/bfd -IC:/devpkg-2.2/include -DDEBUG -DWIN32  -std=gnu99 -g -Wall
-Werror-implicit-function-declaration -O0  -c -o miniwget.o miniwget.c
miniwget.c: In function 'miniwget3':
miniwget.c:316: error: implicit declaration of function 'getnameinfo'
mingw32-make[1]: *** [miniwget.o] Error 1
mingw32-make[1]: Leaving directory `C:/Users/TALI/Desktop/Görans randomkrääsä/Wz
 git repository/3rdparty/miniupnpc'
mingw32-make: *** [3rdparty/miniupnpc] Error 2
ImageImage
-insert deep philosophical statement here-
User avatar
Buginator
Professional
Professional
Posts: 3285
Joined: 04 Nov 2007, 02:20

Re: Lighting

Post by Buginator »

Jorzi wrote:...
Jorzi, if it is easier, there are nightly builds available here: http://wzhost.pc-dummy.net/~buildbot/

Oh, and the above message looks like it is building a shared lib, not static.
and it ends here.
Jorzi
Regular
Regular
Posts: 2063
Joined: 11 Apr 2010, 00:14

Re: Lighting

Post by Jorzi »

Thanks for the link, looks really useful. However, I'd like to be able to build it myself in order to include my modified GLSL shaders, so that I can try them out, or maybe this can be done by modding? How do you make a mod anyway?
ImageImage
-insert deep philosophical statement here-
Safety0ff
Trained
Trained
Posts: 397
Joined: 18 Jul 2009, 23:23

Re: Lighting

Post by Safety0ff »

For the error, I think it just needs to define: _WIN32_WINNT=0x501
Jorzi wrote:in order to include my modified GLSL shaders, so that I can try them out, or maybe this can be done by modding? How do you make a mod anyway?
If there's no code changes, there is a way to run the game without the data being in archives, which should allow to you to modify it easily.

As for modding you could just put your shaders in the mods directory:
For example (it should be something similar to this, I haven't tested):
/My Documents/Warzone2100 master/mods/myshaders/shaders/tcmask.{vert|frag}

Then when launching the game use the mod option: --mod myshaders
To send it off you'd zip the myshaders directory and change the extension to .wz.
Jorzi
Regular
Regular
Posts: 2063
Joined: 11 Apr 2010, 00:14

Re: Lighting

Post by Jorzi »

Excellent :)
Thank you for all the help :) now I have all the things I need to test out new shaders in warzone. (I tried messing with the teamcolor blending and my tanks are now lime green :D which means it works)
(still didn't get the source to compile but that is no longer such an important thing)
Now I just need a .pie model with an object space normal map...
ImageImage
-insert deep philosophical statement here-
Jorzi
Regular
Regular
Posts: 2063
Joined: 11 Apr 2010, 00:14

Re: Lighting

Post by Jorzi »

Using WMIT i finally managed to export my new transport model into the game (although the connector seems to be a bit screwed up since the hmg is above the model)
Anyway, how do I enable the normal map for the model? Should I change something in the "TYPE" or what?
Where does the shader get the value for "uniform int normalmap"?
I already added the files page-60-mediumtransport.png as well as page-60_tcmask.png and page-60_normalmap.png to the texpages?

Also, it would be a good thing to be able to specify the type of normal map so that, for example, normalmap = 1 would be object space, while normalmap=2 would be tangent space
Attachments
newtransport.jpg
ImageImage
-insert deep philosophical statement here-
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: Lighting

Post by Per »

Add a line in the PIE file, before the 'LEVELS' line, that says 'NORMALMAP 0 mynormalmap.png'. (The zero is just a filler value. It has no meaning.)
Safety0ff
Trained
Trained
Posts: 397
Joined: 18 Jul 2009, 23:23

Re: Lighting

Post by Safety0ff »

Jorzi wrote:Using WMIT i finally managed to export my new transport model into the game (although the connector seems to be a bit screwed up since the hmg is above the model)
I don't think it even exports connectors, check that it didn't simply remove it.

EDIT: On second thought, there's some code that flips the connectors depending on the type of unit, this might be the cause.
Jorzi
Regular
Regular
Posts: 2063
Joined: 11 Apr 2010, 00:14

Re: Lighting

Post by Jorzi »

Ok, cool :)
It uses my normalmap but my coordinate transformation is wrong, anyway now I can fix it through trial-and-error.

How do I re-enable the specularity, btw?

@SafetyOff, I added the connector manually
ImageImage
-insert deep philosophical statement here-
Jorzi
Regular
Regular
Posts: 2063
Joined: 11 Apr 2010, 00:14

Re: Lighting

Post by Jorzi »

Ok so the normal map code is working correctly now, I only had to swap the y and z coordinates, since in blender z is considered up.
I have one more feature request, however:
Since the left and right propulsions use separate models, this means that, unless I make a separate normal map for the right and the left side, one side will have a flipped x-axis. Now this could be solved in three ways:
1. I make separate normal maps, which requires extra graphics memory(works right now)
2. make warzone use the same model for both sides, flipping the x-axis for the second wheel/track. I find this solution nice as it reuses models and the normal maps work automatically.
3. make a way to define in the .pie that the x axis is flipped in the normal map (requires a few lines extra in the fragment shader but takes only a minute to code)
ImageImage
-insert deep philosophical statement here-
Post Reply