View previous topic :: View next topic |
Author |
Message |
Nash

Joined: 19 Oct 2007 Posts: 95 Location: Kuala Lumpur, Malaysia
|
Posted: Sat Oct 20, 2007 12:10 am Post subject: Changing underwater screen colours |
|
|
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! |
|
Back to top |
|
 |
jim

Joined: 05 Aug 2005 Posts: 400 Location: In The Sun
|
Posted: Sun Oct 21, 2007 2:09 am Post subject: |
|
|
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! |
|
Back to top |
|
 |
Nash

Joined: 19 Oct 2007 Posts: 95 Location: Kuala Lumpur, Malaysia
|
Posted: Mon Oct 22, 2007 7:32 pm Post subject: |
|
|
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. |
|
Back to top |
|
 |
Sajt
Joined: 16 Oct 2004 Posts: 1026
|
Posted: Mon Oct 22, 2007 7:57 pm Post subject: |
|
|
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. |
|
Back to top |
|
 |
xaGe

Joined: 01 Mar 2006 Posts: 329 Location: Upstate, New York
|
Posted: Mon Oct 22, 2007 8:35 pm Post subject: |
|
|
See... learn and teach.. err learn and create tutorial...
Nash wrote: | I think I'll create a tutorial on how to make custom liquid types. |
|
|
Back to top |
|
 |
jim

Joined: 05 Aug 2005 Posts: 400 Location: In The Sun
|
Posted: Tue Oct 23, 2007 1:02 am Post subject: |
|
|
Aha... I'll keep that v_cshift in mind...  _________________ zbang! |
|
Back to top |
|
 |
Nash

Joined: 19 Oct 2007 Posts: 95 Location: Kuala Lumpur, Malaysia
|
Posted: Sun Oct 28, 2007 12:13 am Post subject: |
|
|
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). |
|
Back to top |
|
 |
Sajt
Joined: 16 Oct 2004 Posts: 1026
|
Posted: Sun Oct 28, 2007 1:51 am Post subject: |
|
|
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. |
|
Back to top |
|
 |
Dr. Shadowborg Inside3D Staff

Joined: 16 Oct 2004 Posts: 726
|
Posted: Sun Oct 28, 2007 2:44 am Post subject: |
|
|
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 _________________ "Roboto suggests Plasma Bazooka." |
|
Back to top |
|
 |
Urre

Joined: 05 Nov 2004 Posts: 1073 Location: Sweden
|
Posted: Sun Oct 28, 2007 3:05 pm Post subject: |
|
|
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  _________________ Look out for Twigboy |
|
Back to top |
|
 |
Nash

Joined: 19 Oct 2007 Posts: 95 Location: Kuala Lumpur, Malaysia
|
Posted: Sun Oct 28, 2007 4:30 pm Post subject: |
|
|
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. |
|
Back to top |
|
 |
Sajt
Joined: 16 Oct 2004 Posts: 1026
|
Posted: Sun Oct 28, 2007 5:16 pm Post subject: |
|
|
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. |
|
Back to top |
|
 |
Nash

Joined: 19 Oct 2007 Posts: 95 Location: Kuala Lumpur, Malaysia
|
Posted: Sun Oct 28, 2007 5:31 pm Post subject: |
|
|
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. |
|
Back to top |
|
 |
Dr. Shadowborg Inside3D Staff

Joined: 16 Oct 2004 Posts: 726
|
Posted: Sun Oct 28, 2007 8:41 pm Post subject: |
|
|
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!  _________________ "Roboto suggests Plasma Bazooka." |
|
Back to top |
|
 |
Sajt
Joined: 16 Oct 2004 Posts: 1026
|
Posted: Mon Oct 29, 2007 1:07 am Post subject: |
|
|
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. |
|
Back to top |
|
 |
|