Author Topic: Water & lava shader insanity (walk on water, etc...)  (Read 5839 times)

LinuxManMikeC

  • Posts: 125
  • Turrets: +0/-0
Water & lava shader insanity (walk on water, etc...)
« on: December 02, 2006, 08:08:16 pm »
I was wanting to test some of the capabilities of liquids in the Q3 engine for some map ideas I have, but when I tried using some of the premade liquid shaders in some of the maps (including non-official maps) the brush always ended up solid (they still had wave effect)!  I saw the "walk on water" bug mentioned by another noob mapper in the forum, but little help was given other than how to "roll your own" shader.  I was finally able to find a water shader to use that worked.  It was the one in Karith.  And mind you I am using it directly from the Karith pk3.  Didn't feel like making my own shader yet so I set this aside for later.  Then I started implementing a map idea that calls for lava.  I decided to use (at lest temporarily) the lava shader from Thermal, but I ended up with the same problem!  At that point I was really going nuts.  The shader works fine in Thermal, but spazes out in my maps!  What is going on here?!?!  Temporarily put the Karith water shader in place of lava and planned to make my own lava later.  Finally, this morning sweet inspiration ran me over (will post picture of the tire marks later).  The shader scripts look the same in both custom and offical trem maps.  Official works,  custom don't.  The shader effects that affect brush content are evaluated at compile time by q3map2.  Must be a compile error!  I ran a compile of my map with the Thermal lava shader and checked the build process.  Q3map2 can't find thermal.shader, but can find karith.shader!  The custom maps are downloaded to my /home/mike/.tremulous/base folder, but q3map2 didn't seem to know about the folder.  Instead it was attempting to use /home/mike/.q3a/base!!!  I looked into the source for q3map2 and it turns out that the user folder is hard coded into q3map2.  The user's game directory name is selected when you set the -game option.  My setup of GTKRadiant 1.5 (mostly default based on instructions at the wiki) tries setting "-game tremulous", but there is no "tremulous" option in the q3map2 source so it defaults to quake3.  This was no problem when Tremulous was a Q3 mod, but now that it's standalone it needs a game_tremulous.h file to be added to the q3map2 source.  Looks easy enough, so I will submit a patch when I have time.  For now I have a temporary work around (sorry, Linux/Unix only, though I don't think the problem affects Windows, because I've never seen individual user folders for Q3 based games in Windows :P  ).

Make sure you have a /home/username/.q3a directory.  Then symlink /home/username/.tremulous/base --to--> /home/username/.q3a/base

If you don't plan on ever playing Q3 then you have the option of symlinking /home/username/.tremulous --to--> /home/username/.q3a

This is needed to make any shaders work which are stored in /home/username/.tremulous and have compile-time commands.

--crap--
And fellow noobs, remember to add the shader script names to your shaderlist.txt file.
--end crap--
see below for a clearer explanation
b]Embrace your inner penguin 8)
GtkRadiant Wiki (under construction)[/b]

Survivor

  • Posts: 1660
  • Turrets: +164/-159
Water & lava shader insanity (walk on water, etc...)
« Reply #1 on: December 02, 2006, 09:20:40 pm »
Add your map to the shaderlist in the script dir
I’m busy. I’ll ignore you later.

LinuxManMikeC

  • Posts: 125
  • Turrets: +0/-0
Water & lava shader insanity (walk on water, etc...)
« Reply #2 on: December 02, 2006, 10:42:18 pm »
:eek: um... what?  why?

AFAIK the shaderlist is for shaders.  I don't have a separate shader file for my map yet (which would be the same name as my map :-) I know).  I am using shaders from other maps.  The problem was that none of the shader scripts stored in my user dir for tremulous were visible to q3map2.

If you were correcting the last statement in my first post.  Yeah, that's a better way to say it.  I really munged that one. :oops:

Therefore, one would have the files:
maps/mymap.bsp
scripts/mymap.shader

and shaderlist.txt would get this additional entry:
mymap
b]Embrace your inner penguin 8)
GtkRadiant Wiki (under construction)[/b]

Survivor

  • Posts: 1660
  • Turrets: +164/-159
Water & lava shader insanity (walk on water, etc...)
« Reply #3 on: December 02, 2006, 11:54:15 pm »
indeed :). Even so always copy the shaders you're using in your map to your own shaderfile.
I’m busy. I’ll ignore you later.

LinuxManMikeC

  • Posts: 125
  • Turrets: +0/-0
Water & lava shader insanity (walk on water, etc...)
« Reply #4 on: December 03, 2006, 12:30:55 am »
I definitely will do that.  Right now I am using those shaders as placeholders anyway.  I may find better/different textures and shaders, cusomize the premade ones I'm using, or make my own from scratch.  I will definitely have my own shader file when it comes time to release a beta.  Thanks for watching over all us noobs Survivor :D.
b]Embrace your inner penguin 8)
GtkRadiant Wiki (under construction)[/b]

KnightBear

  • Posts: 44
  • Turrets: +0/-0
Water & lava shader insanity (walk on water, etc...)
« Reply #5 on: December 03, 2006, 07:22:14 am »
in the system folder,  there should be a "cualk_water" or something to that effect.  texture your would-be water brush with that.  then, where thwe water will be visable, hold control and shift and select just the side.  only the 1 side of the brush should light up, if done correctly.  

then texture your 1 side with the water looking texture.  that will solve the walking on water thing.  same for lava, and acid.

EDIT:  whoops, sorry, apparently ther is no system texture folder for trem.  hmmm.  sorry about that
m not a Player, I just smoke alot

KnightBear

  • Posts: 44
  • Turrets: +0/-0
Water & lava shader insanity (walk on water, etc...)
« Reply #6 on: December 03, 2006, 07:52:51 am »
Quote
}

textures/system/caulk_water
{
   qer_editorimage   textures/system/caulk
   surfaceparm   nomarks
   surfaceparm   nodraw
   surfaceparm   water
   q3map_nolightmap
}


heres something i pulled from JK Jedi academy.  you might need to add in a graphic for the water, and put it in a system folder in the textures.

base/textures/system/caulk_water.jpg

this shouldnt be a regular tyexture, so make the graphic editor specific, that way you can follow the step from above.

PS.  add system to you r shaderslist.txt in the shaders folder

ill get onne for lava too if your interested.
m not a Player, I just smoke alot

LinuxManMikeC

  • Posts: 125
  • Turrets: +0/-0
Water & lava shader insanity (walk on water, etc...)
« Reply #7 on: December 04, 2006, 06:25:57 am »
Thanks, I've been using nodrawnonsolid just fine.  Though having a watercaulk or nodrawwater is more descriptive.  This really doesn't apply to the problem I had.

I just wanted to point out the likely cause of these liquid problems may not always be noobness, but the fact that q3map2 doesn't have the code for "recognizing" tremulous.  It goes looking to the .q3a user dir (on Linux).  If you have shaders in the .tremulous user dir none of those shaders will be seen by q3map2.  I probably didn't explain myself too clearly with the brain dump format above.

Most of the liquid problems like this that were mentioned involved trying to use the shaders from someone elses PK3.  Many seemed to be following instructions perfectly, but with continued failure.  If they were using Linux/Unix, they most likely had these PK3s in their .tremulous dir in their user home dir.  Therefore the shaders were invisible to q3map2 when compiling the water brushes.  The shader commands that would change the brush to a liquid were never run by the compiler because it couldn't find the shader.

Again, quick fix:
ln -s /home/username/.tremulous/base /home/username/.q3a/base

The more permanent fix would be to make a header file for q3map2 based on the one for Quake3, but edited for Tremulous.  This could then be submitted to the GtkRadiant project and/or made available as a patch from the Tremulous project.  Haven't looked at it much, but there are probably a few other spots that need code added to make this all work.  I plan on doing this today as I have nothing better to do right now :D.  Hopefully I will have something working today.

EDIT: Been working on that code.  Find it in this thread...
http://tremulous.net/phpBB2/viewtopic.php?t=2774
b]Embrace your inner penguin 8)
GtkRadiant Wiki (under construction)[/b]