Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Free PS 1.1 Water Shader

Author
Message
Spotaru
18
Years of Service
User Offline
Joined: 3rd Dec 2006
Location: Over the next rise.
Posted: 6th Jun 2007 20:21
Here is a free PS 1.1 water shader. All media and a working DBP demo are included in download. This is my own OPEN SOURCE code. Anyone is free to use it however they please. It is also a work in progress, so any improvemants I make will be updated here. Refraction/Reflection is nearly impossible in a 1.1 shader so forget it. It's not going to happen! I am currently working on making the water more transparent.

Enjoy!

Attachments

Login to view attachments
Agent Dink
21
Years of Service
User Offline
Joined: 30th Mar 2004
Location:
Posted: 7th Jun 2007 00:04
No offence intended, but what exactly is this shader supposed to do? Using a regular transparent texture would look better. It seems when I rotate and move the camera it seems to stretch and smear the water texture.

Free music, textures, models, and tutorials.
Silver Dawn
Indecom
18
Years of Service
User Offline
Joined: 23rd May 2007
Location:
Posted: 7th Jun 2007 00:27
If this works okay i may use it instead of the regular mirror effect that i am now, which looks like turd by the way.
Freddix
AGK Developer
22
Years of Service
User Offline
Joined: 19th Sep 2002
Location: France
Posted: 7th Jun 2007 00:57
do you allow me to include it in the free: Ultimate Shader Pack ?
I'll host a new build of the pack @ www.odyssey-creators.com website

Gandalf said: "All we have to decide is what to do with the time that is given to us"
Odyssey-Creators - X-Quad Editor - 3DMapEditor
Indecom
18
Years of Service
User Offline
Joined: 23rd May 2007
Location:
Posted: 7th Jun 2007 11:19
can you post a screen shot of what it is supposed to look like, cause i just get a black plane, although my card supports shader model 1.3.
Spotaru
18
Years of Service
User Offline
Joined: 3rd Dec 2006
Location: Over the next rise.
Posted: 11th Jun 2007 20:49
Hi guys,
I've been really busy the past few days. We had a fire at work and things have been kinda crazy. I'm sorry about the defective PS 1.1 shader. It works perfectly in all my apps. EXCEPT DBP. I should have done more testing before posting it. I will try to find out why it doesn't work correctly in DBP ASAP.

If any one is interested, I have a PS 1.4 water shader with reflections. Here is a screen shot.

Attachments

Login to view attachments
Spotaru
18
Years of Service
User Offline
Joined: 3rd Dec 2006
Location: Over the next rise.
Posted: 11th Jun 2007 20:55
Here is the DBP code with shader and media included. This shader has been tested thoroughly and works in DBP 6.6

Attachments

Login to view attachments
Airslide
20
Years of Service
User Offline
Joined: 18th Oct 2004
Location: California
Posted: 12th Jun 2007 00:13
I suppose it looks okay for big scenes. You may want to post in JPEG next time, MS Paint will do that


Vote today and play the games!
Green Gandalf
VIP Member
20
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 12th Jun 2007 00:18
I like the PS1.4 version. Nice work. (Code could be tidied up a bit here and there, though.)

Have you got an HLSL version of your PS1.1 water shader? It would be easier to see what's wrong with it then. All I see is a uniform blue plain against a black background.
GatorHex
20
Years of Service
User Offline
Joined: 5th Apr 2005
Location: Gunchester, UK
Posted: 12th Jun 2007 19:08 Edited at: 12th Jun 2007 23:40
I'd like to get a water shader with reflection and transparancy. Needs to be fast though. I'm okay up to shader 2.0

Here's a screenshot of your 1.4 version in .jpg so ppl don't have to download that huge .bmp



It seems pretty fast, well done, but it doesn't reflect objects in the scene like the standard DBP reflection shader can do.



and a little bit of transparancy for object poking out would make it look more realistic too me thinx.



Evolveds is the best I've seen in DBP, but it's a bit too slow, yeah that does say 11 fps!



Spotaru
18
Years of Service
User Offline
Joined: 3rd Dec 2006
Location: Over the next rise.
Posted: 13th Jun 2007 03:35
@ Freddix
Yes you can use the PS1.4 shader in the Ultimate Shader Pack.
The PS 1.1 shader has a defect that I am trying to correct.

@ GG
Thanks, No I don't have a HLSL version of the 1.1 shader. I am trying to convert it now.

@ GatorHex
No Offense, but if you want it, BUILD IT. You are comparing apples with oranges. The shader was never intended to have real time reflections. Also adding transparency is not going to happen. There simply isn't enough resources left in a PS1.4 shader to do it. It already is at the limits of being able to compile in PS1.4
You are severely limited in 1.4 shaders. (number of textures, dependent reads,number and type of instructions etc.)

To everyone: I only made this shader to try to give a decent water shader to the users who don't have 2.0 capability. I don't even need it myself. I have 3.0 capability. So if you want to use it fine, if you don't, also fine. But stop comparing 1.4 with 2.0 shaders. It's like complaining that Vista operating system won't run on my old Windows 95 machine.
To anyone offended by this post, I am truly sorry.
GatorHex
20
Years of Service
User Offline
Joined: 5th Apr 2005
Location: Gunchester, UK
Posted: 13th Jun 2007 14:55
I haven't a clue about shaders, and i wasn't being critical of your work, i was just wondering is somone, like yourself, could build a perfect 2.0 water shader. Its unlikly i could do it myself, and i appreciate yours and Evolveds efforts

Spotaru
18
Years of Service
User Offline
Joined: 3rd Dec 2006
Location: Over the next rise.
Posted: 21st Jun 2007 16:23 Edited at: 21st Jun 2007 16:26
Sorry about the late post, I've been very busy lately.

@ GatorHex

My sincerest apologies to you. I didn't mean to come on so strong.
I'm not sure if everything you want in a water shader is possible in DBP. If you could use multiple shaders on the smae object at the same time it would be possible. But as far as I know, DBP only lets you use one shader at a time on a single object. I'll do some more research and see what I can come up with. Also, you are correct in saying that most of the calculations in Evolved's shader is done in the DBP program. I have done a similar set up in DBP and came up with only 17 fps. (Not Good) I'll see if I can get something better.

Meanhile I still haven't found the bug in the 1.1 shader. I'll keep working on it too.
TinTin
19
Years of Service
User Offline
Joined: 16th May 2006
Location: BORG Drone Ship - Being Assimilated near Roda Beta (28)
Posted: 21st Jun 2007 16:42
I havn't a clue about shaders (Havn't even attempted to learn them yet)
I've got a few questions/ideas..
1st.. Can shaders call other shaders
if so, why not write a superfast shader for each of the following..
(Vertex Manipulation) to make waves by adjusting vertex position.
(Bump Mapping) to give smaller ripples
(Fresnel Shadding) to give angle relative transparency
(Reflection Shading) to reflect environments and objects.
Then use a water shader to call each in turn before updating the display.

Cyberspace was becoming overcrowded and slummy so I decided to move. These nice chaps gave me a lift.
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 13th Jul 2007 06:04
I want to know about the "Default DB Shader - that Mirror Looks Grand!

Know way too many languages - Master of none
Mobiius
Valued Member
22
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 13th Jul 2007 17:29
the default db mirror shader is very slow. Its way too slow for any real use. try it and see, it eats fps like i eat kebabs!

3700+ Athlon 64 - Geforce 7600 Gs - 512MbDDR RAM - 40Gb + 250Gb Hdd - Windows XP (SP2)
GatorHex
20
Years of Service
User Offline
Joined: 5th Apr 2005
Location: Gunchester, UK
Posted: 13th Jul 2007 17:43 Edited at: 13th Jul 2007 17:45
I dissagree I think it's fast, in the above screen shot I was getting 120fps on a Pentium M1.5Ghz with Intel 915 Graphics, not exactly a speed machine

DinoHunter (still no nVidia compo voucher!), CPU/GPU Benchmark, DarkFish Encryption DLL, War MMOG (WIP), 3D Model Viewer
Lucifer
19
Years of Service
User Offline
Joined: 26th Dec 2005
Location:
Posted: 15th Jul 2007 02:44
Spotaru, wow, i love this shader, it's very fast and it looks very good, i'm having trouble getting the water to reflect my own skybox, i tried replacing the mountains.dds file with my own sky, but it doesnt work tell me, what do i need to do to make it work?


oh praise the lord, praise furry jesus
Spotaru
18
Years of Service
User Offline
Joined: 3rd Dec 2006
Location: Over the next rise.
Posted: 15th Jul 2007 08:41 Edited at: 15th Jul 2007 08:43
Open the .fx file with notepad and replace the name of the reflection texture with the name of your sky cubemap. It works for me when I change it. If that doesn't work, post your sky and I'll see if I can make it work for you.
Lucifer
19
Years of Service
User Offline
Joined: 26th Dec 2005
Location:
Posted: 15th Jul 2007 15:35
here's the sky i would like it to reflect, it would be super if you could make it work


oh praise the lord, praise furry jesus

Attachments

Login to view attachments
Spotaru
18
Years of Service
User Offline
Joined: 3rd Dec 2006
Location: Over the next rise.
Posted: 15th Jul 2007 15:56
@ Lucifer

Is this a 2d or 3d game? If it's 3d are you using a skysphere instead af a skybox? If so I can change the shader to use sphere mapping instead of cube mapping. Also which version of DBP are you using?
Lucifer
19
Years of Service
User Offline
Joined: 26th Dec 2005
Location:
Posted: 15th Jul 2007 16:01
i'm using the latest version of dbp, this game is 3d, and i'm just using a skysphere


oh praise the lord, praise furry jesus
Spotaru
18
Years of Service
User Offline
Joined: 3rd Dec 2006
Location: Over the next rise.
Posted: 15th Jul 2007 16:22
Okay
I'll see what I can do. It may take me a while, I gotta go to church now. I'll try to work on it when I get back.
Lucifer
19
Years of Service
User Offline
Joined: 26th Dec 2005
Location:
Posted: 17th Jul 2007 02:50
thanks i'd really like it if you could help me make this work, even if you'd just convert the sky to a working .dds file for me


oh praise the lord, praise furry jesus
Spotaru
18
Years of Service
User Offline
Joined: 3rd Dec 2006
Location: Over the next rise.
Posted: 17th Jul 2007 05:11
Converting the sky to a .dds file is probably what I will have to do. I haven't had any luck getting the shader to work with sphere mapping. It has to do with the dependent texture read. You do not have direct access to the w coordinates in 1.4 shaders, and I can't seem to find a work around like I did using cube mapping.
I'll try to make a working cubemap out of the sky texture A.S.A.P
Spotaru
18
Years of Service
User Offline
Joined: 3rd Dec 2006
Location: Over the next rise.
Posted: 17th Jul 2007 18:25 Edited at: 17th Jul 2007 18:26
Here is a .dds file made out of your sky texture. It looks good in the cubemapper, FX composer and Dark Shader. I can't say it will look okay in your program because I can't test it. If it doesn't look good, all I can say is have a try at making it yourself. The programs I use to make cube maps are HDR Shop version 1 and ATI Cubemap Generator. Both are fairly easy to learn and both are free.
You can get the cubemapper from ATI and for HDR Shop just search for in on the web. Also you may need microsofts texture tool (available in the Direct X SDK) for changing the texture format.
Good luck and if you have any questions I'll try to answer them.

Attachments

Login to view attachments
Lucifer
19
Years of Service
User Offline
Joined: 26th Dec 2005
Location:
Posted: 17th Jul 2007 20:10
thanks for the help, this works perfectly and looks very good


oh praise the lord, praise furry jesus
Juso
22
Years of Service
User Offline
Joined: 23rd Sep 2002
Location: Finland
Posted: 19th Jul 2007 17:10
TGC should arrange a competition to build a perfect 2.0 water shader to us who cant program with shaders.

Login to post a reply

Server time is: 2025-06-03 18:28:28
Your offset time is: 2025-06-03 18:28:28