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.

Geek Culture / Free Water Shader

Author
Message
Preston C
21
Years of Service
User Offline
Joined: 16th May 2003
Location: Penn State University Park
Posted: 30th Jan 2004 20:44
Heh, dont bug me about where I'm supposed to post this, it could go in quite a few of the sections so I chose this.

Created it today, derived from the sample bubble shader included with DBPro.



Download At:
http://www.dbforums.co.uk/neowolfgames/forums/WaterShader.zip

Cheers,
Preston

[PS] Lag said his server will be going down later today/tonight. It should be back up by Sunday (at latest). If you dont get a chance to download it by then and you dont want to wait, email me, I'll send over the zip.


Intel Celeron 1.3 Ghrz 512MB Ram NVIDIA GeForceFX 5200 128MB
Neophyte
21
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 30th Jan 2004 20:58
Nicely done, Preston. Wish I could run it though. It requires VS_2_0 and my card only supports VS_1_1.
Dave J
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Feb 2003
Location: Secret Military Pub, Down Under
Posted: 31st Jan 2004 03:13 Edited at: 31st Jan 2004 03:21
Yup, there's not a whole lot of people that will be able to run that. My card can't even support Pixel Shaders at all, let alone PS 2.0

But apart from that I can't seem to get DBP to run any shaders (Including Annistropic) although technically I can support VS 1.1

Screenshot looks nice though.


"Computers are useless they can only give you answers."
the_winch
21
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 31st Jan 2004 03:18
I guess there are very few people that can see it. I can't and my card is less than a year old. Hardly seems worth the effort to get shaders working in dbp.
Preston C
21
Years of Service
User Offline
Joined: 16th May 2003
Location: Penn State University Park
Posted: 31st Jan 2004 03:21
Oi, I was hoping more people would be able to use it! Wish I knew how to get it so lower versions could support it (I kinda made this through trial and error, and I must say it sucked making this thing).

Cheers,
Preston


Intel Celeron 1.3 Ghrz 512MB Ram NVIDIA GeForceFX 5200 128MB
Represent
20
Years of Service
User Offline
Joined: 24th Dec 2003
Location:
Posted: 31st Jan 2004 03:22
My card is so old it wont support DX9.0 unless I upgrade its driver but the site has been down a lot. And when ever I get to it the stops loading.... :-(

Oh well...

Looks nice Preston.

Neophyte
21
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 31st Jan 2004 03:36
@Preston Chanderton

" Wish I knew how to get it so lower versions could support it "

The key is "VertexShader = compile vs_2_0 VShade();". If you change that to "VertexShader = compile vs_1_1 VShade();" then it will attempt to compile it to VS_1_1 though that doesn't mean that it will succeed. If you are using instruction that are only in VS_2_0 or are over the instruction count limit of VS_1_1 then it won't compile. You can solve the instruction count limit problem with VS_1_1 by breaking up the shader into multiple passes but if you are using instructions that are VS_2_0 only then I'm afraid porting the shader will become a lot more difficult if not impossible.

Having said that, I'm sure that the bubble shader was set to VS_2_0 because of one of the aforementioned limitations. So it won't be as easy as changing from VS_2_0 to VS_1_1. I don't know this for sure though as I haven't tested it and I don't know the extent to which you altered the bubble shader.

I don't really have the time tonight but if you'd like to make an effort to port the shader from VS_2_0 to VS_1_1 then just post as much and I'll take a look later when I get the time and see why its VS_2_0.
Preston C
21
Years of Service
User Offline
Joined: 16th May 2003
Location: Penn State University Park
Posted: 31st Jan 2004 03:39
@Neophyte: If you wanna have a go at it, go ahead.

Cheers,
Preston


Intel Celeron 1.3 Ghrz 512MB Ram NVIDIA GeForceFX 5200 128MB
Neophyte
21
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 31st Jan 2004 04:41
I'll have a look at it tommorrow then if I have the time. I'll post if I have any results or make any progress.
Jeku
Moderator
21
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Vancouver, British Columbia, Canada
Posted: 31st Jan 2004 04:47
@Preston - Just do a video capture of your screen, convert the video to Divx, and let us download that

Jeku (Being half serious)


http://www.automatongames.com/
Ancient Chinese proverb: Man who runs behind car gets exhausted.
STE
21
Years of Service
User Offline
Joined: 7th Oct 2003
Location:
Posted: 31st Jan 2004 04:59
Quite pretty, although it doesn't look much like water

Respect for actually getting a modified shader to work, because I have had f*ck all results with my efforts.
If anything needs a good tutorial, it's shaders.

STE ;¬!
Neophyte
21
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 31st Jan 2004 07:02
@STE

"If anything needs a good tutorial, it's shaders."

I actually have started on a tutorial for shaders but its been on the backburner for quite some time now. I've just been busy with more importent things. However, it looks like I might get some spare time soon and getting Preston's water shaders to work would be an interesting challenge. I might just finish the tutorial and use Preston's water shader as an example(with his permission of coarse).
Preston C
21
Years of Service
User Offline
Joined: 16th May 2003
Location: Penn State University Park
Posted: 31st Jan 2004 18:39 Edited at: 31st Jan 2004 18:40
Well, could someone with vertex shader 1.1 and pixel shader 1.1 test this? I think I got it to run at lower specs (not too sure, I've got the only computer in the house that supports shaders period).

http://www.dannywartnaby.co.uk/rgt/attachments/water.zip

(Just replace the old .fx with this one and run the exe)

Cheers,
Preston


Intel Celeron 1.3 Ghrz 512MB Ram NVIDIA GeForceFX 5200 128MB
Neophyte
21
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 31st Jan 2004 18:43
@Preston

Works like a charm.
Xanatus
21
Years of Service
User Offline
Joined: 15th Mar 2003
Location: Germany
Posted: 31st Jan 2004 22:33 Edited at: 31st Jan 2004 22:42
Presto it works but the animation isnt really smooth.
Did you use vertex manipulation or a bumpmap for the waves? If vertex manipulation then i guess its to slow for really usage. You should add enviroment mapping that looks great

Did you have a look on tgc's water shader? If not you can download it here:
http://xanatus.com/tgc_water.zip


[EDIT]
Oh, when i change
float timeScale=0.005;
to
float timeScale=0.001;
the animation works much faster

Preston C
21
Years of Service
User Offline
Joined: 16th May 2003
Location: Penn State University Park
Posted: 31st Jan 2004 23:27
@Xanatus: Yes, changing that will make it go much faster. But the reason I made this shader was because I didnt have access to TGC's shader. Since it was for DBDN members only. So, I think you might wanna take that off of your site, before more people leech off of it.

I tried to add environment mapping, but it almost made me throw my computer in front of a speeding truck (thats how annoyingly evil it was). I also tried to get it to be a bit transparent...but that didnt work either.

I used vertex manipulation because I didnt know how to use bump mapping in shaders. Really, truly and honestly, I made this through trial and error, starting with the bubble shader.

Also, I used a really bad grid object with it. Maybe if you used a different grid, it would look much better.

Cheers,
Preston


Intel Celeron 1.3 Ghrz 512MB Ram NVIDIA GeForceFX 5200 128MB
Neophyte
21
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 31st Jan 2004 23:40
@Xanatus

"You should add enviroment mapping that looks great "

Only on well rounded objects. On flat objects or poorly tesselated objects it looks like utter crap. Trust me on this. I've got a working enviroment map shader and I've tested it on both a box and a sphere. On the sphere it looks beautiful(if upside down). On the box its crap.

Its probably for the best that Preston's water shader didn't implement it. It probably would have looked pretty bad on that mesh.

@Preston

I haven't looked at you new shader in depth, only glanced at it, but was all that you changed the VS_2_0 to VS_1_1? I'm curious to know and unfortunetely I'm feeling too lazy right now to look from line to line checking for differences.
Preston C
21
Years of Service
User Offline
Joined: 16th May 2003
Location: Penn State University Park
Posted: 1st Feb 2004 00:24
@Neophyte: yep, thats all I changed.

@Xanatus: Well, I downloaded TGC's shader (I feel like a pirate now) and well...I dont wanna say it looks bad...but...lets just say I prefer mine

Cheers,
Preston


Intel Celeron 1.3 Ghrz 512MB Ram NVIDIA GeForceFX 5200 128MB
Xanatus
21
Years of Service
User Offline
Joined: 15th Mar 2003
Location: Germany
Posted: 1st Feb 2004 01:00
its allowed to share tgc's shaders. its the same like dark matter models. i have no dbdn access and got those shaders as a prsent from lee.

Xanatus
21
Years of Service
User Offline
Joined: 15th Mar 2003
Location: Germany
Posted: 1st Feb 2004 01:08 Edited at: 1st Feb 2004 01:09
Quote: "@Xanatus

"You should add enviroment mapping that looks great "

Only on well rounded objects. On flat objects or poorly tesselated objects it looks like utter crap. Trust me on this. I've got a working enviroment map shader and I've tested it on both a box and a sphere. On the sphere it looks beautiful(if upside down). On the box its crap.

Its probably for the best that Preston's water shader didn't implement it. It probably would have looked pretty bad on that mesh."

thats a screenshot of the water in dark age of camelot:
http://www.xanatus.com/daoc.jpg

it is a plain with an enviroment map and it looks very good. its only the way how you use it.
daoc use the best water shader that i ever saw. and its the most efficientest ever cause the ripples are done with bumpmaps. and, it works with my gfx card (geforce 4 ti).

the tgc shader doesnt work with my gfx card and is very inefficient cause it needs to much fps.

Ian T
22
Years of Service
User Offline
Joined: 12th Sep 2002
Location: Around
Posted: 1st Feb 2004 02:04
'its allowed to share tgc's shaders. its the same like dark matter models. i have no dbdn access and got those shaders as a prsent from lee.'

DarkMATTER models have no royalties for use in products but that dosen't mean they can be handed about for free or the product would have no value. The shaders aren't even being sold and I believe they still fall under the DNS of DBDN; unless you recieved them seperatly of course, but I'm still not sure they were meant to be shared.

--Mouse: Famous (Avatarless) Fighting Furball

I am the chainsaw paladin.
Dave J
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Feb 2003
Location: Secret Military Pub, Down Under
Posted: 1st Feb 2004 03:54 Edited at: 1st Feb 2004 03:55
Just email Lee, I'm sure he'd give you the shader (probably not the DM models, but the shader he would). Lee likes giving presents, look what he gave me:



lol, unfortunately I only got the picture... not the model + shaders.


"Computers are useless they can only give you answers."
Preston C
21
Years of Service
User Offline
Joined: 16th May 2003
Location: Penn State University Park
Posted: 1st Feb 2004 04:17
I think he only likes giving presents to people he like. I'm sure I've bugged him enough with random nonsense that he could hold a grudge and say "Do it yourself you lazy ass." I'm sure the entire TGC team would agree with me, I must be one of the more annoying people here at Apollo

Cheers,
Preston


Intel Celeron 1.3 Ghrz 512MB Ram NVIDIA GeForceFX 5200 128MB
Xanatus
21
Years of Service
User Offline
Joined: 15th Mar 2003
Location: Germany
Posted: 1st Feb 2004 04:18
hi, lee gave us all darkmatter 2 moddels, fx shaders and a few other stuff last year at a german event

Neophyte
21
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 1st Feb 2004 05:32
@Xantatus

"it is a plain with an enviroment map and it looks very good."

That's because that plain(I should probably being spelling it "plane" but...)is well tesselated. It would have to be else you really couldn't get those waves as a poorly tessellated mesh would strech the bump map image preventing those tight ripples from forming.

I'm not even sure that it is being done with environment maps. I've seen identical effects done with stencils before that looked just as good.

@Exeat

Nice picture. Did you notice the anti-aliasing flaws near the barrel though? They really keep bugging me. They're near the base of the barrel and where the handle connects to the gray round piston thing. The anti-aliasing is sampling from the green backdrop and not the barrel making it appear like the barrel isn't connected to the base.
Dave J
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Feb 2003
Location: Secret Military Pub, Down Under
Posted: 1st Feb 2004 05:51 Edited at: 1st Feb 2004 05:58
Ahh yes, I see, it's happening in several other places too. Hopefully it's just the model that's been poorly constructed - although the more I look at it, the more it looks like a major bug in DBP. We really need to see it in real-time though.


"Computers are useless they can only give you answers."
Neophyte
21
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 1st Feb 2004 07:24
@Exeat

Yeah, I see it in other places too now. I think I remember a bug report way back some time about this. It think it was related to transparency, but I'm not sure. I do know that anti-aliasing plays a part in it though. Or at least I think I know.
Dave J
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Feb 2003
Location: Secret Military Pub, Down Under
Posted: 1st Feb 2004 07:28
Yeah, it's the first time I've ever seen it though. It's most likely not a shader issue but more something to do with transparency and anti-aliasing like you said, although I personally don't have a clue why they're using transparency on a model like that - it looks as if the geometry should come out fine without it.


"Computers are useless they can only give you answers."
Chenak
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 1st Feb 2004 14:15
I want that per-pixel phong shader ive been looking for one that works in dbpro for ages but i bet if they release the shader with U6 (they did promise to give us free shaders didnt they?) i bet it wont work with my poor GF4ti card

Once you start down the Dark Path, forever will it dominate your destiny...
Dave J
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Feb 2003
Location: Secret Military Pub, Down Under
Posted: 1st Feb 2004 14:20
Actually notice that one doesn't use hardware acceleration, so yes, it most likely will work.

The other 4 however will need hardware although I don't see why they won't work on a GF4 TI - that supports VS 1.1 and PS 1.1 if my memory serves well.


"Computers are useless they can only give you answers."
Chenak
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 1st Feb 2004 15:04 Edited at: 1st Feb 2004 15:05
phong shading uses hardware acceleration doesn't it? Well i got the shaders for it anyway which are vs1.1, ps1.1 to vs2.0, ps1.4, but of course the FX shader wont work cos i dont know how to implement it properly

Once you start down the Dark Path, forever will it dominate your destiny...
Chenak
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 1st Feb 2004 15:11
heres the shader if anyone wants to play around with it, would be great if someone could get it to work



Once you start down the Dark Path, forever will it dominate your destiny...
Neophyte
21
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 1st Feb 2004 18:08
@Inferno

"heres the shader if anyone wants to play around with it, would be great if someone could get it to work "

I'll give it a look. I think I remember you posting about per-pixel lighting before but I'm not sure.

Out of curiosity, where did you get this shader? I remember last time taking a look at a shader that you posted, but it had media included in it. It had a model of a head or something and it was in a custom file format that neither of us knew. Was that you that posted it? I ask because if there is media that goes with this it would make my job easier if you could post a link for me to download it.
Chenak
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 1st Feb 2004 18:39
Lol, yer that was me, i gave up trying to get it to work in the end cos I dont know anything about how to program shaders

here's the link to where i got it from:

http://personal.telefonica.terra.es/web/codegarrofi/perPixelLighting/perPixelLighting.htm

Once you start down the Dark Path, forever will it dominate your destiny...
Neophyte
21
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 1st Feb 2004 18:53
Yup, thats the link.

I'll download it later and see what I can do.
Surreal Studio IanG
21
Years of Service
User Offline
Joined: 21st Sep 2003
Location: Cyberspace...I think
Posted: 1st Feb 2004 19:22
Preston where did u get the bubble shader from?
u say in the readme
Quote: "It was derived from the sample Bubble shader, and I must say I'm happy with the results"
so where did u get it from?

Flick that switch...*BANG*...Not that one!
Preston C
21
Years of Service
User Offline
Joined: 16th May 2003
Location: Penn State University Park
Posted: 1st Feb 2004 19:29
It came with Dark Basic Professional

Cheers,
Preston


Intel Celeron 1.3 Ghrz 512MB Ram NVIDIA GeForceFX 5200 128MB
Dave J
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Feb 2003
Location: Secret Military Pub, Down Under
Posted: 2nd Feb 2004 07:01 Edited at: 2nd Feb 2004 07:05
Check the Help>Examples>Basic3D folder in your DBP directory. I believe there should be an Annistropic, Bubble, Simple and Cartoon FX shader in there. There's also a sample Pixel and Vertex shader.

Quote: "phong shading uses hardware acceleration doesn't it?"

When you see a 'teaser' image like the one I posted, the "+" next to the Shader names generally mean they require hardware acceleration. Likewise, if there's no "+" then it would be safe to assume they don't. Strangely most shaders should require hardware which suggests that Per-Pixel Phong isn't actually a shader in DBP. Possibly faked, I'm just speculating.


"Computers are useless they can only give you answers."
Neophyte
21
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 2nd Feb 2004 08:40
@Exeat

"When you see a 'teaser' image like the one I posted, the "+" next to the Shader names generally mean they require hardware acceleration."

I think the plus means "and". Like Cube Map and Reflection Map and Bump Map, etc.
Dave J
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Feb 2003
Location: Secret Military Pub, Down Under
Posted: 2nd Feb 2004 09:33
Possibly, but TGC have used the + in the past (can't remember where). The whole "4 textures" thing and then listing 5 shaders also throws it off a bit. But it's probably just me being stupid.


"Computers are useless they can only give you answers."
las6
22
Years of Service
User Offline
Joined: 2nd Sep 2002
Location: Finland
Posted: 2nd Feb 2004 09:47
I think there's some heavy overusing of shaders in that pic. First of all, you could drop down reflection map and the diffuse map and the difference wouldn't be all that big. If even noticeable.
Diffuse colors can be linked to vertices, much more effective that way. And you've got cubemap and reflection map, what's that all about? if reflection map is a mask, it sure isn't used that way.

and that model has some probs, unless they added a cartoon outline shader too. but the antialiasing problems you mentioned could be just jpeg artifacts.

Keyboard not detected. Press F1 to continue.

Login to post a reply

Server time is: 2024-11-24 16:53:22
Your offset time is: 2024-11-24 16:53:22