Forum

Changing underwater screen colours

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Changing underwater screen colours

Postby Nash » Sat Oct 20, 2007 12:10 am

How do I change the underwater screen colours?

(You know, the fullscreen palette shifting thing when you're inside liquids)

I think the default water blend is too murky...

Also, is it possible to add more blends beyond Quake's defaults? For example, I might want to add a new blood liquid type. How do I do this?

Thanks in advance!
User avatar
Nash
 
Posts: 95
Joined: Fri Oct 19, 2007 5:56 pm
Location: Kuala Lumpur, Malaysia

Postby jim » Sun Oct 21, 2007 2:09 am

I'd like to know this too... Would definitely be useful for some other colour liquids than clean water...

So far I've used coloured lighting to make the liquid insides appear in some colour, but then it looks like the liquid is glowing...
zbang!
User avatar
jim
 
Posts: 599
Joined: Fri Aug 05, 2005 2:35 pm
Location: In The Sun

Postby Nash » Mon Oct 22, 2007 7:32 pm

With the Darkplaces source, I found the screen blending code in view.c - in the function V_CalcViewBlend().

Should be pretty easy to figure out how to add additional CONTENT* types but I'm too tired to figure it out now.

EDIT: Well well, what do you know. I also found a console command in view.c, v_cshift. It takes four arguments... presumably R, G, B and alpha.

In that case, it's easy as pie to create custom content types in your QC and just stuffcmd(self, v_cshift) to create new liquid colours.

I need to figure out how to pass the parameters to v_cshift though... so far nothing I've tried works.

EDIT: Got it!

v_cshift 255 0 0 50

Will create a red tint with 50% opacity. Useful for that blood-like liquid I wanted to create.

I think I'll create a tutorial on how to make custom liquid types.
User avatar
Nash
 
Posts: 95
Joined: Fri Oct 19, 2007 5:56 pm
Location: Kuala Lumpur, Malaysia

Postby Sajt » Mon Oct 22, 2007 7:57 pm

While you're messing around there, you might want to check out a very fun cvar: v_idlescale (drunk mode, try a value of 100 or so)
F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe.
Sajt
 
Posts: 1215
Joined: Sat Oct 16, 2004 3:39 am

Postby xaGe » Mon Oct 22, 2007 8:35 pm

See... learn and teach.. err learn and create tutorial... 8)

Nash wrote:I think I'll create a tutorial on how to make custom liquid types.
User avatar
xaGe
 
Posts: 461
Joined: Wed Mar 01, 2006 8:29 am
Location: Upstate, New York

Postby jim » Tue Oct 23, 2007 1:02 am

Aha... I'll keep that v_cshift in mind... :)
zbang!
User avatar
jim
 
Posts: 599
Joined: Fri Aug 05, 2005 2:35 pm
Location: In The Sun

Postby Nash » Sun Oct 28, 2007 12:13 am

How disappointing. Modders have no control over the liquids because they are hard-coded into BSP compiling programs so we're essentially stuck with the Quake defaults (water, lava, slime).
User avatar
Nash
 
Posts: 95
Joined: Fri Oct 19, 2007 5:56 pm
Location: Kuala Lumpur, Malaysia

Postby Sajt » Sun Oct 28, 2007 1:51 am

What did you want to add? Urine? Jello? Rancid milk? (or a bathtub full of all three.... mmm...)
F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe.
Sajt
 
Posts: 1215
Joined: Sat Oct 16, 2004 3:39 am

Postby Dr. Shadowborg » Sun Oct 28, 2007 2:44 am

Nash wrote:How disappointing. Modders have no control over the liquids because they are hard-coded into BSP compiling programs so we're essentially stuck with the Quake defaults (water, lava, slime).


But you CAN fake it!

Please reference Extras QuakeC mod R4 here:

http://developer.chaoticbox.com/quake.php?tab=poxgoodies
User avatar
Dr. Shadowborg
InsideQC Staff
 
Posts: 1110
Joined: Sat Oct 16, 2004 3:34 pm

Postby Urre » Sun Oct 28, 2007 3:05 pm

Nash: I'll have to re-ask what Sajt asked, what was your plan? If you just want to make them look different, just change the texture. If you want them to act different too, use a compiler which supports entity liquids, like LH's bsp compiler(s). Or use Q3BSP.

That's the beauty of opensourced engines/tools :P
I was once a Quake modder
User avatar
Urre
 
Posts: 1109
Joined: Fri Nov 05, 2004 2:36 am
Location: Moon

Postby Nash » Sun Oct 28, 2007 4:30 pm

I thought it was pretty clear in my original post what I wanted to achieve, but here it is again anyway:

I specifically want to extend the available liquid types for my single player mod.

Quake comes with three built-in liquids: water, slime, and lava.

Firstly, I think the default water blend is too murky and not suitable for clean water. There is no other way to change the default water blend other than having to edit view.c in DP's source.

Secondly, I wanted to add two more liquid types: a thick mud-like liquid, and blood.

Providing textures for them is no problem: I can just create the new textures *blood, *mud, etc. However, internally, these will still be treated as the default water (in other words, it'll have that hard-coded murky blend).

The only way to add more blends beyond the default 3 (murky, green, yellow for water, slime and lava respectively) is to first modify LH's hmap2 compiler to recognize the extra liquid types. I would then have to modify the source to add more content types, thereby allowing me to define additional view blends.

In short; it's not a light modding task, it's serious, and involves modifying not only the engine, but the compile tool as well.

In conclusion: I know it's easy to add different liquid textures, but extending the view blend beyond the defaults is not.

I checked out Extras QuakeC mod R4, and while it is a nice trick, the solution is less than ideal because the underwater warping effect is disabled, and I also see lots of Z-fighting with the fake liquid polygons as I move around.
User avatar
Nash
 
Posts: 95
Joined: Fri Oct 19, 2007 5:56 pm
Location: Kuala Lumpur, Malaysia

Postby Sajt » Sun Oct 28, 2007 5:16 pm

Adding the extra content types is a bit of a task of course (it could be an extra feature of the 'mcbsp' format I was working on, which also includes custom hull sizes)...

Changing the view blend colours has nothing to do with the bsp files. It could probably be made into cvars in the DP engine.
F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe.
Sajt
 
Posts: 1215
Joined: Sat Oct 16, 2004 3:39 am

Postby Nash » Sun Oct 28, 2007 5:31 pm

Sajt wrote:Changing the view blend colours has nothing to do with the bsp files. It could probably be made into cvars in the DP engine.


Right, I could just modify view.c to get the view blend colours from cvars, but that still means modifying the engine.

What I'm getting at is, there is no mod-friendly way to achieve what I want - engine sources need to be modified and re-compiled.
User avatar
Nash
 
Posts: 95
Joined: Fri Oct 19, 2007 5:56 pm
Location: Kuala Lumpur, Malaysia

Postby Dr. Shadowborg » Sun Oct 28, 2007 8:41 pm

Nash wrote:Right, I could just modify view.c to get the view blend colours from cvars, but that still means modifying the engine.

What I'm getting at is, there is no mod-friendly way to achieve what I want - engine sources need to be modified and re-compiled.


Then quit whining about it and DO it. If you can't make something work the way you want, find a way to work around it. Doing a custom engine should be considered valid for making a mod.

Besides, if you do something cool, and have the source out there for it, you may just end up making something that may become a standard in all the other engines.

I myself am thinking about doing a little dabbling into the engine source, and I myself have whined and asked engine coders to do something (doesn't generally work) and been told to do it myself.

So, I'm gonna.

That's why the engine source is there after all, so use it already! :P
User avatar
Dr. Shadowborg
InsideQC Staff
 
Posts: 1110
Joined: Sat Oct 16, 2004 3:34 pm

Postby Sajt » Mon Oct 29, 2007 1:07 am

Well, I think you shouldn't be worrying about view tint colours until you have finished the important parts of your mod.

I spent the first bunch of years of my modding 'career' worrying about such details, and never got a mod done, or even close. Now, if I made a mod, I would focus on just working broadly first, then adding the details. Implement the important gameplay features, then worry about your view tint colours.
F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe.
Sajt
 
Posts: 1215
Joined: Sat Oct 16, 2004 3:39 am

Next

Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest