Doom3world

The world is yours! Doom 3 - Quake 4 - ET:QW - Prey - Rage
It is currently Thu Jun 20, 2013 8:38 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 45 posts ]  Go to page 1, 2, 3  Next
Author Message
 Post subject: idTech 4 Shader Pack v1.3...
PostPosted: Mon Aug 03, 2009 8:05 pm 
Offline
Last man standing
User avatar

Joined: Thu Aug 19, 2004 7:22 pm
Posts: 1129
As the title suggests, this pack is full of shaders, Doom 3's "interaction" shaders to be exact. Basically, everything I've done so far on the lighting side of idTech4.

Inside are 14 different lighting models used, and each come in 3 different flavors (normal, parallax, and relief mapping) for a total of 42 shaders for Doom 3. The lighting models used range from the simple Phong and Blinn-Phong to the more complex and phisically accurate Cook-Torrance and Ashikhim-Shirley. Each model also includes rebb's ambient lighting (simpified) and rim lighting (although a couple don't include rim lighting as it doesn't work well with non-Lambertian diffuse... still working on it). The parallax shaders are setup to use either a height map or normal map by simply changing some comments with the height map used as default. The relief shaders require a height map and also (unfortunately) an nVidia card. I recommend downloading the original relief mapping mod to get the "normal2depth.exe".

This is an on-going work in progress as I plan to keep adding more models as I find them and any features I find globally beneficial. For instance, I had ambient aperture lighting(pulled from Humus' tech demo) in at one time but not all textures benefited from it (plus it really requires a specific aa normal map to shadow correctly) so I excluded it but the rim lighting looked good enough for everything so it's included. It really is a shame id designed D3 (as well as, Q4 and ETQW) like this, Human Head is the only studio to do shaders right.

Also included is a little test map I used while writing these. It has a player start but is more designed to be used from within the editor.

Anyways, here's the file. If anyone finds any bugs or artifacts, let me know. These shaders were tested but not extensively tested.

Update 11/10/09:
Released a pack update. Details of changes are in the readme. Also changed the name of the pack to idTech 4 Shader Pack.


Update 11/27/09:
Released an update. Again, detail are in the readme but here are some things of note. I added a self shadowing term (not to be confused with self shadowing bump mapping). I also added ATI compatible relief mapping shaders as well as fixed the problem with relief mapping where diffuse/specular maps would be scaled wrong if they use a different scale than the normal map, like if the normal map of diffuse texture A is scaled to half its size to work with diffuse texture B which is unscaled. This was because all three textures were using normal map's texcoord. With just a little extra math this was able to be fixed.

I also wanted to point out that it is becoming impossible for me to check over every shader to make sure they're clean so if anyone finds any broken shaders or bugs, please let me know.

Edit: Added some before/after screens to show what I mean by self shadowing.
Image Image Image Image

Shader pack:
http://sikkpin.fileave.com/idTech4ShaderPack_v1.3.rar

Test maps (D3):
http://sikkpin.fileave.com/D3_testmaps.rar


Last edited by Sikkpin on Sun Apr 04, 2010 2:36 am, edited 8 times in total.

Top
 Profile E-mail  
 
 Post subject: Re: Sikk's Shader Pack v1...
PostPosted: Mon Aug 03, 2009 11:53 pm 
Offline
missed 400 shots

Joined: Sat Jul 05, 2003 4:08 pm
Posts: 452
Antispam measure: What is larger? The Sun or the Galaxy?: sun
If you use parts from shaders of other people, then at least put a readme.txt into the package and give each proper credit there, or make it clear in the shaders themselves via comments.

You can't expect everyone who gets the file to have read this forum thread.

_________________
( imagine obnoxiously huge Image here )
Doom3 Ambient Light Fix - Thread - Site


Top
 Profile  
 
 Post subject: Re: Sikk's Shader Pack v1...
PostPosted: Tue Aug 04, 2009 6:29 pm 
Offline
Last man standing
User avatar

Joined: Thu Aug 19, 2004 7:22 pm
Posts: 1129
Well, the only place you can get this shader is from this thread and I don't expect to host it anywhere else. But, your right, give credit to where it's due. It would be a small readme though as your ambient lighting trick is the only thing used from someone else's work. I'll remember to put one in for next release.


Top
 Profile E-mail  
 
 Post subject: Re: Sikk's Shader Pack v1...
PostPosted: Fri Aug 14, 2009 8:28 pm 
Offline
fired 300 rounds
User avatar

Joined: Thu Nov 30, 2006 6:40 pm
Posts: 328
Location: Salt (Girona) Spain
Antispam measure: What is larger? The Sun or the Galaxy?: sun
This are the BEST shaders i have seen for IdTech4 games like Doom 3 ever, they are awesome, but one question, what is the best, i am specially interested in the Parallax ones ???


Thanks in advance, Sikk ! :idea:

_________________
http://doom3.filefront.com/developer/Dafama2K7;23734


Top
 Profile E-mail  
 
 Post subject: Re: Sikk's Shader Pack v1...
PostPosted: Mon Aug 17, 2009 6:54 pm 
Offline
Last man standing
User avatar

Joined: Thu Aug 19, 2004 7:22 pm
Posts: 1129
Well, there is no "best", so to speak. Each model has it's pro's and con's and it's probably best to either just go through them one by one and find what works best for you (visual quaility vs realism vs performance) or do some research one each model to find which one strikes you as being the best. Though, if you want my opinion, I prefer the Cook-Torrance model with Ashikhmin-Shirley and Ward tied for second. But try not to let that bias your choice as it's really up to you.


Top
 Profile E-mail  
 
 Post subject: Re: Sikk's Shader Pack v1...
PostPosted: Mon Aug 17, 2009 7:47 pm 
Offline
Last man standing
User avatar

Joined: Fri Jan 07, 2005 12:27 am
Posts: 1050
Sikkpin wrote:
It really is a shame id designed D3 (as well as, Q4 and ETQW) like this, Human Head is the only studio to do shaders right.


Explain?

Awesome- thanks a ton for releasing these- if I ever em running w/ custom stuff I'll send pics along. I didn't realize there was a rim light shader in the works, that's f'n cool.


Top
 Profile  
 
 Post subject: Re: Sikk's Shader Pack v1...
PostPosted: Mon Aug 17, 2009 8:24 pm 
Offline
Last man standing
User avatar

Joined: Thu Aug 19, 2004 7:22 pm
Posts: 1129
The shame is that you can't have specific shaders for specific materials. Not all materials behave to light the same way but in D3/Q4/ETQW, they do. You can't add specific features because it'll effect every surface in the game. I say HH did it right because they allowed this, which is why you can have sss for skin, anisotropic specular reflection for hair, rim lighting for cloth, etc. This "one shader to rule them all" way really limits what you can do with this engine. And the fact that they couldn't get it right in three games is just sad. Not to mention that ETQW, a game that was supposed to have "this" generation visuals, used the exact same per-vertex specular as D3/Q4. Why id never use their tech to it's full potential I don't know.


Top
 Profile E-mail  
 
 Post subject: Re: Sikk's Shader Pack v1...
PostPosted: Mon Aug 17, 2009 8:39 pm 
Offline
Last man standing
User avatar

Joined: Fri Jan 07, 2005 12:27 am
Posts: 1050
I thought ETQW had a modular shader system, with interaction shaders for different materials? Didn't the strogg metal have its own lighting model?

I really wish they'd release the tech4 source, or even just update the sdk with enough of the renderer to hook in some more drastic changes. RAGE is gonna push that towards 2011, if ever due to zenimax.


Top
 Profile  
 
 Post subject: Re: Sikk's Shader Pack v1...
PostPosted: Tue Aug 18, 2009 7:14 pm 
Offline
Last man standing
User avatar

Joined: Thu Aug 19, 2004 7:22 pm
Posts: 1129
Well, the truth is, yes, ETQW does, but it wasn't taken advantage of, in my opinion. They only use 6 different shaders. Basic, foliage, translucent, ambient, MT basic, MT ambient. So basically all normal surfaces (that are not foliage or translucent) are lit that same way, with the same Lambertian diffuse and the same specular falloff. Now, they also utilized conditional statements within the shaders, which is nice, but it was only used for things irridescents, self-illumination and parallax mapping (which, by the way, was only used on two fucking textures, and not very well, mind you) for specific materials.


Top
 Profile E-mail  
 
 Post subject: Re: Sikk's Shader Pack v1...
PostPosted: Thu Aug 20, 2009 8:48 pm 
Offline
found a secret

Joined: Sun Jun 18, 2006 6:31 pm
Posts: 648
I can understand where you're coming from, but do not forget that ET:QW is marketed as an MP game and hence needs every performance tweak it can get. Too bad "the flaw" went undetected till after release though...

_________________
"And remember, respect is everything" - GTA2
"Whoever wins, we lose"


Top
 Profile  
 
 Post subject: Re: Sikk's Shader Pack v1...
PostPosted: Thu Aug 20, 2009 11:54 pm 
Offline
Last man standing
User avatar

Joined: Thu Aug 19, 2004 7:22 pm
Posts: 1129
Don't get me wrong, I understand that fully, but you must also remember that it was marketed as a "next generation" game which it definitely is not. Next generation meaning this generation (x-box360/ps3). It's really no different than Doom 3 aside from megatextures (which, imo, were way too low res, looked great from afar but up close it looked terrible) which is last generation (x-box/ps2). I just expected much more from this game visually, as I'm sure many people did based off of the early screens and vids. The maps were much smaller than what I thought they would be, and completely lacking of any detail whatsoever. I thought these were war zones, why is everything so clean and empty? And I'm not even going to mention the audio side of this game.


Top
 Profile E-mail  
 
 Post subject: Re: Sikk's Shader Pack v1...
PostPosted: Fri Aug 21, 2009 4:09 am 
Offline
did just hit his 750th monster

Joined: Tue Jul 05, 2005 3:15 pm
Posts: 824
Location: Adelaide - Australia
I think a lot of the clutter was removed for performance reasons. It would have been nice to have in there but when it is a choice between releasing something that looks as great as possible, or something that twice as many people will be able to run (and therefore buy) it's a pretty obvious choice.


Top
 Profile  
 
 Post subject: Re: Sikk's Shader Pack v1...
PostPosted: Fri Aug 21, 2009 8:36 pm 
Offline
Last man standing
User avatar

Joined: Thu Aug 19, 2004 7:22 pm
Posts: 1129
I don't doubt that any and all decisions were based around performance but that is what's so great about pc games, options. Pc's are upgradeable and therefore games should be scalable. Did increasing the general performance of this game help with the sales any? I'll let this topic drop as I don't want to sidetrack the point of this thread. It's a great game, it just failed in the visual/audio department, in my opinion.

Anyway, back on topic, I will be releasing an update here within the next few days that includes a few more lighting models(Oren-Nayar, Lafortune, and a couple anisotropic models), some fixes and tweaks, and versions for Quake 4 and ETQW. I'm not sure if custom shaders can be used online in ETQW but I'm sure mods would be able to use them and anyone who plays offline.


Top
 Profile E-mail  
 
 Post subject: Re: Sikk's Shader Pack v1.1...
PostPosted: Wed Aug 26, 2009 7:35 pm 
Offline
Last man standing
User avatar

Joined: Thu Aug 19, 2004 7:22 pm
Posts: 1129
I uploaded the new version. Link in first post. The ETQW set is incomplete. The "basic_fragment.inc" (which handle about 99% of the surfaces, minus the megatexture) are up to date, though. I still need to work on the foliage, translucent, parallax, and megatexture interaction, though I did include a Blinn-Phong for each of those. The megatexture, I didn't realize, has a specular component to it. It's to bad that SD didn't use it as it actually looks good, especially for roads. ETQW will be my focus for now, I guess. I just got Wolf and the sp is perfect as far as visuals go but the mp still uses that same old shitty shaders (although they do use a variable specular exponent which does make a big difference) so I'm probably going to have to do the same thing for those. Luckily, I can pretty much copy/paste from the ETQW shaders.

Anyways, enjoy, and also, I put the test maps into a separate file to cut the file size down of the shaders. There are two maps inside, one I used to test general lighting and the other I used for testing parallax/relief mapping. The parallaxtest map is especially cool with relief mapping, specifically the "four" texture.


Top
 Profile E-mail  
 
 Post subject: Re: Sikk's Shader Pack v1.1...
PostPosted: Wed Aug 26, 2009 8:50 pm 
Offline
Last man standing
User avatar

Joined: Fri Jan 07, 2005 12:27 am
Posts: 1050
Hmm- neato. I haven't gotten the time to really play around with this, but it's really cool to see shaders getting love around here.

Have you played around with the megatexture stuff in etqw much? How moddable is it, ie. would it be possible to get it back to the point of the original teaser trailer, where the jeep drives down the moonlit roads and shows normal/spec contributions in the MT? Pulling baked lighting out of the megatexture could be really cool.

Dying to know if there's any vestigial megatexture left in wolf SP, but i guess we gotta wait for SDK with that.


Top
 Profile  
 
 Post subject: Re: Sikk's Shader Pack v1.1...
PostPosted: Thu Aug 27, 2009 2:52 am 
Offline
picked up 200 ammo
User avatar

Joined: Tue Dec 09, 2008 1:05 pm
Posts: 208
your parallax and relief shader not working with ambient light on scene


Top
 Profile E-mail  
 
 Post subject: Re: Sikk's Shader Pack v1.1...
PostPosted: Thu Aug 27, 2009 6:57 pm 
Offline
Last man standing
User avatar

Joined: Thu Aug 19, 2004 7:22 pm
Posts: 1129
You can't get them to work because the heightmap is in the specular map's alpha channel and the specmap is not sent to the shader with ambient lights (or the channels are set at 0 by the code, I don't know which). The only other way would be to use the diffuse map (normal map doesn't work, I've tried it) but that is used for transparency. id really made D3 limited when it comes to shaders which is why I praise Human Head for doing it right with Prey. You're really unlimited with what you can do with Prey but unfortunately it's not as wide spread and popular.

About megatextures, I have already given the megatexture an improved specular component but with the lack of a normal/bump map it's a smooth highlight (still looks good though). I do plan on doing more work with it and it may be possible to load a generic bump map (like the detail bump) and use it to roughen the specular. As far as having an actual normal map that matches the megatexture I doubt is possible. That would most likely need to be compiled into the mt somehow. Whether you can use hacks to get a normal map to the shader (like pass the red channel through the diffuse alpha and the green channel through the mask alpha and then reconstruct the blue channel within the shader), I don't know, but it would be limited to only custom maps/mods. I don't know enough about the structure of ETQW's shaders to say anything definite.


Top
 Profile E-mail  
 
 Post subject: Re: Sikk's Shader Pack v1.1...
PostPosted: Thu Aug 27, 2009 7:09 pm 
Offline
picked up 200 ammo
User avatar

Joined: Tue Dec 09, 2008 1:05 pm
Posts: 208
get you get me text of material ?


Top
 Profile E-mail  
 
 Post subject: Re: Sikk's Shader Pack v1.1...
PostPosted: Thu Aug 27, 2009 7:15 pm 
Offline
Last man standing
User avatar

Joined: Thu Aug 19, 2004 7:22 pm
Posts: 1129
Huh?


Top
 Profile E-mail  
 
 Post subject: Re: Sikk's Shader Pack v1.1...
PostPosted: Thu Nov 05, 2009 6:43 pm 
Offline
picked up 200 ammo
User avatar

Joined: Tue Dec 09, 2008 1:05 pm
Posts: 208
it means
how i can do that?


Top
 Profile E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 45 posts ]  Go to page 1, 2, 3  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group