Doom3world

The world is yours! Doom 3 - Quake 4 - ET:QW - Prey - Rage
It is currently Sat May 18, 2013 7:16 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 45 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
 Post subject: Re: Sikk's Shader Pack v1.1...
PostPosted: Thu Nov 05, 2009 7:01 pm 
Offline
Last man standing
User avatar

Joined: Thu Aug 19, 2004 7:22 pm
Posts: 1123
Do what? Get parallax/relief mapping to work with ambient lights? You can't. I explained why it's not possible above. If you are talking about something else, you will need to be more specific. I know English is not you native language and I, of course, have no problem with that whatsoever but, as it stands now, I haven't a clue of what the subject is that your questions are about.


Also, just a heads-up, I'll be releasing an update within the next couple of days.


Top
 Profile E-mail  
 
 Post subject: Re: Sikk's Shader Pack v1.1...
PostPosted: Thu Nov 05, 2009 8:45 pm 
Offline
found a secret
User avatar

Joined: Tue May 24, 2005 12:16 am
Posts: 520
New lighting models Sikk, or remastered old ones, or both? :D

Your Cook-Torrence is completely awesome i must say, there's some really eye-poping specularity on complex hi-res relief maps!

As for the transmission of height from normalmap instead of specmap, it doesn't work because of normal maps compression? Mr. Fabio couldn't get the relief working with height map stored in normals alpha channel because of that (well, to be precise, because of normal map compression no height data could be stored in alpha channel of normal maps). Is that what's causing the problems? If so, then, theoretically, custom normal maps would work with that variation of ambient light fix?

On the other side ambient light fix looks torelable only, when you have some shading baked into diffuse, if not, it looks like childrens drawing (not that it's a bad thing, it should look like that) :D. I think sticking to dim lights with noshadows on scene works better, even if it's not realistic.

Sikk, i remember You mentioned Prey can have different lighting models for different materials. Is that true? Is it applied in material, or is there a much more complex process to that? I don't own Prey yet, but i'm thinking this ability could be helpful for future and planning to buy it. I'm wondering, if Prey's editing (map building, texture creation, modelling, camera scripting) is drastically different from D3, that would be big problem. Here's hoping, that with idtech4 going GPL some talented coder will modify this for D3!

_________________
N I И


Top
 Profile  
 
 Post subject: Re: Sikk's Shader Pack v1.1...
PostPosted: Fri Nov 06, 2009 7:27 pm 
Offline
Last man standing
User avatar

Joined: Thu Aug 19, 2004 7:22 pm
Posts: 1123
One new lighting model with just some fixes/tweaks and general clean up.

The normal map issue is because of compression but I'm not sure if using a custom normal map would solve it. I experimented with this a while ago and I don't remember exactly what my results were (I think there was a channel missing when the shader loads it or something, although I guess you could only use two channels for the normal, rebuild the z component and stick the height map in there...I'd have to look into it). Also the problem isn't with the ambient light fix but with ambient lights themselves, if that's what you were implying.

And, yeah, Prey can use specific shaders for each material. This is declared in the material with the use of "blend shader" blend mode. How this works, I don't know, but there are some snippets of code in the renderer and materials header files about it. Prey's editing is the exact same, I think, except for the needed additions that are unique with Prey. But, no, it's not drastically different and is one hell of a game. I highly recommend picking up a copy.


Top
 Profile E-mail  
 
 Post subject: Re: Sikk's Shader Pack v1.1...
PostPosted: Fri Nov 06, 2009 8:02 pm 
Offline
found a secret
User avatar

Joined: Tue May 24, 2005 12:16 am
Posts: 520
Can't wait for the update then!

As for ambient lights i was just wondering, like i said, not using them and placing normal lights with noshadows stage is much more convenient for me.

I wonder, how new model will look, and what tweaks and fixes C-T model will recive, i mean, just look at this beauty:

Image

simple 1k texture with normal map slapped together in max in one hour, and it presents itself like some very hi-res model rendered in some top-notch 3d application, with zero perfomance hit, it's just amazing.

Now i definetly grab copy of prey to check it out in near future. However i already saw there's no md5camera support and You have to do some script black magic to make it even start, dang! And i'm pretty sure there won't be possibility of using some D3 graphic mods there :(, oh well, i guess it's worth checking out.

P.S. Do you planning bumping up relief sampling a little bit? There's 15 samples right now and, from what mr. Fabio said, today's computers can handle 20 (and maybe higher) without a problem. Also, changing this value

Quote:
#[FPO] relief mapping: view vector with depth factor
PARAM const = { 0.06, 0.1, 0.5, 2.0 };
TEMP view, RT, R3;


in code of His interaction shader was making relief deeper, which value should be change in Yours? Because they are quite different (i'm lame in coding, sorry :D)

_________________
N I И


Top
 Profile  
 
 Post subject: Re: idTech 4 Shader Pack v1.2...
PostPosted: Tue Nov 10, 2009 7:38 pm 
Offline
Last man standing
User avatar

Joined: Thu Aug 19, 2004 7:22 pm
Posts: 1123
reliefParm's x component is the depth scale (0.0425 in my shaders). And, no, I don't plan on increasing the samples. Right now the 15 linear and 6 binary searches are good enough, in my opinion. The aliasing artifacts will never be completely removed. If anything I would like to decrease the number of samples, for instance, try something like this or maybe one day try to figure out a way to do POM. Now, you could increase the samples, if you want, by simply copying/pasting.


By the way, the first post has been updated with a new release. The reason for the slight delay was I decided to implement a crude hemisphere lighting ambient term so it took a while to go through 60+ shaders and add this. I say it's crude because there are some limitations that needed to be worked around and I wanted it to also be as simple as possible, therefore the result isn't perfect but it works and looks pretty good. It's only ten more instructions than rebb's NdotV method (3 in the vertex, 7 in the fragment) so the performance shouldn't be much different.

The way it's setup by default is the sky color is set to 0.5 across the board and the ground color to 1.0 across the board so that it takes the actual light color assigned in the editor. If any one want's to use a specific sky/ground color, just set the colors in the shader and use a white ambient light. Also, I found that using the "north pole" as the light origin makes the floor and ceiling look very flat so I offset it a bit. Here a some screens.

(note: all lights in this scene are acting as ambient lights, with sky = 0.5 gray/ground = 0.0 black)
Image Image Image
Image Image Image


Top
 Profile E-mail  
 
 Post subject: Re: idTech 4 Shader Pack v1.2...
PostPosted: Fri Nov 27, 2009 7:11 pm 
Offline
Last man standing
User avatar

Joined: Thu Aug 19, 2004 7:22 pm
Posts: 1123
First post updated along with a new pack.


Top
 Profile E-mail  
 
 Post subject: Re: idTech 4 Shader Pack v1.2...
PostPosted: Sat Nov 28, 2009 12:48 am 
Offline
found a secret
User avatar

Joined: Tue May 24, 2005 12:16 am
Posts: 520
awesome :D

EDIT: self-shadowing looks great! But i see You implemented that new relief mapping method in Nvidia shaders, it looks horrible ;)

_________________
N I И


Top
 Profile  
 
 Post subject: Re: idTech 4 Shader Pack v1.2...
PostPosted: Sat Nov 28, 2009 1:44 am 
Offline
Last man standing
User avatar

Joined: Thu Aug 19, 2004 7:22 pm
Posts: 1123
I'm assuming by the wink smiley that you're being sarcastic but I'm not sure what you mean. The nVidia specific relief mapping has been in from the beginning. The Ati (ARB) version is the new one.


Top
 Profile E-mail  
 
 Post subject: Re: idTech 4 Shader Pack v1.2...
PostPosted: Sat Nov 28, 2009 1:52 am 
Offline
found a secret
User avatar

Joined: Tue May 24, 2005 12:16 am
Posts: 520
That's strange. I copied Cook Torrence with self shadowing term from nvidia folder and there was this relief with ugly artifacts caused by the new method. But appart from that self shadowing is another great interesting addition :)

_________________
N I И


Top
 Profile  
 
 Post subject: Re: idTech 4 Shader Pack v1.2...
PostPosted: Mon Nov 30, 2009 8:19 am 
Offline
Last man standing
User avatar

Joined: Thu Aug 19, 2004 7:22 pm
Posts: 1123
I know what you're talking about now. The NdotV ambient, self-shadowing nVidia relief shaders are using the wrong constant value. I'll fix this and upload a new pack asap.

Edit: Problem fixed and new pack has been uploaded.


Top
 Profile E-mail  
 
 Post subject: Re: idTech 4 Shader Pack v1.2...
PostPosted: Mon Nov 30, 2009 10:17 am 
Offline
found a secret
User avatar

Joined: Tue May 24, 2005 12:16 am
Posts: 520
Thanks! :)

_________________
N I И


Top
 Profile  
 
 Post subject: Re: idTech 4 Shader Pack v1.2...
PostPosted: Sun Jan 10, 2010 12:54 am 
Offline
picked up 100 armour

Joined: Sat Dec 05, 2009 10:30 pm
Posts: 109
Ok, i know this has been a long time since this topic was even touched. But i keep having problems with the relief shaders, they look glitchy, like when i look at anything from an angle the texture looks deformed. Im using the ahikhmin-shirly shader and ive tried all the versions of it(hemispheric ambient, n-v ambient, self shadowed non self shadowed, nvidia and ati versions) all of them have the same problem. is there a way i can fix this?


Top
 Profile E-mail  
 
 Post subject: Re: idTech 4 Shader Pack v1.2...
PostPosted: Sun Jan 10, 2010 2:00 am 
Offline
found a secret
User avatar

Joined: Tue May 24, 2005 12:16 am
Posts: 520
Screenshot would be helpful,m beacuse glitchy can mean many things ;). If You're Radeon user - relief will look like ass always, sorry. If You mean shattered edges on nvidia, then number of sampling is the fault. The v1.1 have up to 15 samples if i remember and Sikk said something about degrading them to lower number, however you can manually copy paste specific part of shader to increase number of samples and make shattering slightly better.

_________________
N I И


Top
 Profile  
 
 Post subject: Re: idTech 4 Shader Pack v1.2...
PostPosted: Sun Jan 10, 2010 9:26 am 
Offline
picked up 100 armour

Joined: Sat Dec 05, 2009 10:30 pm
Posts: 109
Well since im too lazy to show you what i mean, ill just explain it :D
Anyways when i look at something from an angle, it looks like the item is imploded on its self...i think it may be edge shattering. But yeah when i look straight forward stuff looks okay, but at an angle stuff looks just...like they were sucked into themselves..also guns look like crap. Im using nvidia btw, and i have 1.3 shader pack and it still does all this.. How do i change samples, and what part of the shader can i copy to reduce the "shattered edge thing"


Top
 Profile E-mail  
 
 Post subject: Re: idTech 4 Shader Pack v1.2...
PostPosted: Sun Jan 10, 2010 3:28 pm 
Offline
found a secret
User avatar

Joined: Tue May 24, 2005 12:16 am
Posts: 520
Hmmm, from what i can tell, Your Relief works correct, because what relief mapping does is imploding texture, that's the whole point of it. It pushes inside dents of normal map and takes the highest point of it as surface as zero position.

Basically about 80% od D3 textures won't be rendered correctly because of that, because edges of these tileable textures aren't at zero position (standrad purple shade of normal map, RGB - 128,128,255), so edges will be "pushed inside" revealing "pushed inside" edges of the next tile of the same texture. I don't know if made myself clear, but let me show that for You :D:

Image

That's why relief is not so good for standard D3 assets, but is ultra-mega-awesome power tool for custom stuff, when You get how it works You can literally do magic with that stuff, because not all normal maps have to be converted to work with relief, You can selectively choose, which texture should and which not.

As fo shattering, it's the effect, which makes the 3d objects in Your normal map looking like they have no antialiasing - jagged edges. These are samples. More of them will mean more jaggies on 3d objects and it works alittle bit like increasing resolution - think like when You have a standard ball mesh in map without AA, in resolution 640x480 it will appear more jagged then in resolution 1024x768. I think 20 samples are fairly ok even for close up at very little angle

_________________
N I И


Top
 Profile  
 
 Post subject: Re: idTech 4 Shader Pack v1.2...
PostPosted: Sun Jan 10, 2010 6:16 pm 
Offline
picked up 100 armour

Joined: Sat Dec 05, 2009 10:30 pm
Posts: 109
Okay, so i cant use relief for regular doom 3? only to work with texturing for a map? awwww,,,I see what your talking about with the edge shattering, i upped the amount of samples to about 20 and it goes away, but how do i get rid of implosions? can one not simply use relief in doom 3?


edit: i dont know actually if that is my case at all here ill let you have a look to see what im talking about, there is no overlapping there is complete deformity in the textures. its with the stock relief shader with nothing changed as well.

http://img532.imageshack.us/img532/1223/shot00009.jpg

http://img253.imageshack.us/img253/2508/shot00005q.jpg

http://img94.imageshack.us/img94/6886/shot00006k.jpg

I hope this helps to explain what im talking about.


Top
 Profile E-mail  
 
 Post subject: Re: idTech 4 Shader Pack v1.2...
PostPosted: Sun Jan 10, 2010 7:02 pm 
Offline
found a secret
User avatar

Joined: Tue May 24, 2005 12:16 am
Posts: 520
Hmm i think that may be the cause, the way relief works. I never tried to use it with d3 frankly, only with my custom stuff. But every single relief technique is about pushing dent's into the surface, not extruding it over the surface texture is applied. Even fancy super duper parallax displacement in future dx11 works by pushing dents into the texture, not other way around.
Because i think it's impossible to simulate 3d objects that way.

The things i see on Your screenshots may be fault of screwed up height map (relief uses height map stored in specular alpha channel) to see what's on postion zero of surface (white) and what's pushed inside (shades of grey to black)) generated by normal2depth.exe, which in most d3 texture cases have to guess what's what while generating it. I think when you check it out, it will appear screwed up badly. I would wait for High Res texture pack guy from texture creation thread is working on, it will have properly rendered incorporated height maps.

_________________
N I И


Top
 Profile  
 
 Post subject: Re: idTech 4 Shader Pack v1.2...
PostPosted: Sun Jan 10, 2010 7:28 pm 
Offline
picked up 100 armour

Joined: Sat Dec 05, 2009 10:30 pm
Posts: 109
Yeah i guess ill have to wait till rygel releases his pack. Now i cant wait! lol :mrgreen:


Top
 Profile E-mail  
 
 Post subject: Re: idTech 4 Shader Pack v1.2...
PostPosted: Mon Mar 29, 2010 8:09 pm 
Offline
did just hit his 750th monster
User avatar

Joined: Fri Jul 10, 2009 6:32 pm
Posts: 782
so, I actually went and tried your shaders on Quake 4 for the first time as I reinstalled it recently and I noticed that all your shaders for Q4 are flawed.

80% of the screen is black and the rest is completely messed up colorwise.

after taking a look at the original Q4 shaders I noticed that its just the "MAD" lines that are incorrect.

in your pack for Q4 every shaders has this

Code:
# generate the vertex color, which can be 1.0, color, or 1.0 - color
# for 1.0          : env[16] =  0.0, env[17] = 1.0
# for color         : env[16] =  1.0, env[17] = 0.0
# for 1.0 - color   : env[16] = -1.0, env[17] = 1.0
MAD      result.color, vertex.color, program.env[16], program.env[17];

END


I changed it to this

Code:
# generate the vertex color, which can be 1.0, color, or 1.0 - color
# for 1.0          : env[16] =  0.0, env[17] = 1.0
# for color         : env[16] =  1.0, env[17] = 0.0
# for 1.0 - color   : env[16] = -1.0, env[17] = 1.0
#MAD      result.color, vertex.color, program.env[16], program.env[17];
MAD      result.color, vertex.color, program.env[16].x, program.env[16].y


and they work again flawlessly.

just a heads up for you and everyone that want to use these otherwise great shaders on Q4

I don´t know about Prey and ETQW because I don´t have those installed right now.

oh, and I can confirm the issue reported by Alexthegr81, I also get some strange distorsions only on some textures, mostly noticeable on characters but only when I use the parallax version of the shaders.

_________________
BoreDooM


Top
 Profile E-mail  
 
 Post subject: Re: idTech 4 Shader Pack v1.2...
PostPosted: Mon Mar 29, 2010 8:59 pm 
Offline
Last man standing
User avatar

Joined: Thu Aug 19, 2004 7:22 pm
Posts: 1123
Oh fuck me. I knew there was bound to be something like that. Whenever I make any changes to the shaders I found it to be faster to do all the D3 ones first in a sorta assembly line process and then just copy/paste the files for Q4 and then go back through and make the necessary Q4 specific changes. It seems I overlooked the most important change. Thanks, vertex007. I'll update the pack soon.

edit: Parallax/reilef mapping for complex models (like characters and such) doesn't work like how you might think. The only way to fix this is to remove the offset altogether by setting the specular's alpha channel to middle gray.


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 2 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