Aller au contenu

Photo

NWShader


  • Veuillez vous connecter pour répondre
123 réponses à ce sujet

#51
nwn_martin

nwn_martin
  • Members
  • 11 messages
how do you tell the shader to check distances against a our focal distance beginning at your camera coordinates (lets say center of the viewport for the simplicity of things), continuing along the perpendicular line of sight from the camera in front of you, and ending at the nearest object the line of sight colides with? i havent begun studying the cg language yet, oops.

edit: crunching through the nwshader wiki now. Posted Image

Modifié par nwn_martin, 14 août 2010 - 09:55 .


#52
chico400

chico400
  • Members
  • 26 messages
i confirm that the "Calculate Depth" function return always 1.0 for me

if i use this code

    distance = tex2D(depthFrame, uv).r;
    if ( distance < 0.9){
        factor = 0;
    } else {
        factor = 10.0;
    }

the screen is fully blured

if i use this

    distance = tex2D(depthFrame, uv).r;
    if ( distance < 1.1){
        factor = 0;
    } else {
        factor = 10.0;
    }

it is fully clear

so the problem seams to be on the "Calculate Depth" function in Basic setting of nwshader

peachy do you have a clue for me?

thank my friend ^^

Modifié par chico400, 14 août 2010 - 09:28 .


#53
nwn_martin

nwn_martin
  • Members
  • 11 messages
chico, the problem may be with the fact that nwshader supplies the shaders with a distance measured from a one of the the corners of the screen instead of center or sligtly above center, where the head of our character is supposed to be and watch from that point.
Posted Image
peachy will have to enlighten us on that. Posted Image

the dof effect kind of works for me at least in that, if i zoom out, after one second the picture becomes clear from a blured state. i had to change the setting of the focusing speed in the nwshader gui, the default value of 2.00 is just too slow. i think it should not be so big or it confuses people and makes them think the bluriness will stay forever.
 Posted Image
i remember reading something about smoothing the focusing function with some quadratic element, and if there is time involved, then 2.00 seconds become 4, if someone sets 3.00 then the blurriness will last 9 seconds before it changes, and so forth..
Posted Image
dont mind my thinking aloud. Posted Image

edit: playing with the dof, i think it works, but the first obstacle from the camera is almost always the character you play, so thats why you cant focus far objects..
Posted Image
we need to change the sampling coordinte for the camera in the line of sight. maybe people with the camera hack http://nwvault.ign.c....Detail&id=1358 are going to have this problem solved by itself, because the camera is situated in front of your character.
Posted Image

edit2: forget about camera hack. set the camera min distance in nwshader gui to -0.5 before you start nwmain.exe (i cant seem to be able to change it while the game is running). set the focus shift to 1.00, so that it happens faster. in the game hit the "home" button to set the camera to the min distance. enjoy peachy dof zooming.
Posted Image

Modifié par nwn_martin, 14 août 2010 - 12:23 .


#54
pkpeachykeen

pkpeachykeen
  • Members
  • 77 messages
@chico: Did you have any problems with depth of field previously? I think I may know where the issue is, if only this latest version is broken. For better precision, I changed the depth buffer from being DF16 (16-bit floating point) to either D24S8 (depth 24-bit integer and 8-bit stencil) or DF32 (32-bit floating point). I've heard some rumors that certain cards, particularly old nVidia (if I remember correctly) had problems with 32-bit textures.

It should be possible to add an option to use any of those 3 formats, which should fix the issue for everyone.



@nwn_martin: The calculation is smoothly linear, that is, it uses this formula:

focal distance = linearly interpolate between (current focal distance, current distance, ( frame delta / set value ) )
Delta is the time between frames in seconds, so it adapts for faster/slower FPS.

It will constantly come closer to the true value, and in the set amount of time, should approximately equal the distance. You should be able to see that by zooming out quickly, it will lag for a moment, then quickly resolve. Same thing happens when you zoom in.

It does, on both smooth and instant, focus on the center of the screen (more or less, it may be off by half a pixel or so).



As far as using the camera hack, you don't need that with the latest NWShader, it's included. I've also increased the options, so you can tweak it quite a bit. You can't change it during the game, since it only applies when the game starts based on the saved settings, but you can do whatever.



And like you said, in first-person view with DoF, you get correct viewing. It especially looks great when you walk up to an NPC.

#55
nwn_martin

nwn_martin
  • Members
  • 11 messages
pk, set the focus shift to 9.0, load an area, zoom out full with "end" key for the quickness of it, and just tell me how many seconds have to pass before the view starts to deblur. and then tell me why this initial delay has to be there.
ps: i think we may need a cross hair for aiming the center at objects, heh.

edit: also, the focus shift only controls focusing distant objects (enlarging the distance), where as focusing close objects is constant with various setting. its fast, which is not bad, but could use a setting too.

edit2: depth of field focus transfer:

Modifié par nwn_martin, 15 août 2010 - 12:53 .


#56
chico400

chico400
  • Members
  • 26 messages
hi,

i did not have the problem with previous releases.
i used every days asgorath or older versions with absolutly no problems

my card is a nvidia 8600gts 512 mb ram, may be you're right with your clue

it would be great if you could correct this.

You know, i'm nwshader-adict  now^^

thanks peachy ;)

Modifié par chico400, 15 août 2010 - 07:45 .


#57
chico400

chico400
  • Members
  • 26 messages
just tested Bahamut version, and DOF work fine with this one too.



i guess you're right peachy with the DF32 issue on Chronepsis version ^^



i hope it's easy to correct



ciao ^^

#58
Dark_Ansem

Dark_Ansem
  • Members
  • 638 messages
we want this for Dragon age too!

#59
Jez_fr

Jez_fr
  • Members
  • 302 messages
Is this stopped? :/

#60
nwn_martin

nwn_martin
  • Members
  • 11 messages
i hope not, jezira. i posted some feedback on the project's forum at sourceforge to engage in a discussion, let's see if it stirs things up. you can join with your feedback too and make complaints about somebody else's feedback :)

#61
pkpeachykeen

pkpeachykeen
  • Members
  • 77 messages
Nope, not stopped yet. I've been busy and haven't had much time to put into this, but I spent the last few hours tackling the two most obnoxious bugs and think I might have them fixed. Need to tweak some XML-related stuff (TinyXML is being a pain building at the moment), but those issues should mostly be taken care of.

I've also upgraded my dev system to Visual Studio 2010, so I may upgrade NWShader to use the Visual C++ 2010 runtimes. However, those require XP SP3 or better (which everyone should have, but I know a few people refuse to progress ;)) so I'll probably be building the releases under VC 2008 for a while. The static analysis built into VS2010 is awful nice though, it's pinpointed a half-dozen memory leaks and a few other possible issues that I never would have caught. I ran CppCheck and am looking into setting up regular PreFast (or whatever it is) analysis to make sure the code-base is of the highest possible quality.

Anyway, uploading some updated code to the SVN right now. I'll be doing more on my end in the next few days, then see about releasing an update.

My next goals are shiny water and/or scriptable GUI. Both are definitely possible, but I haven't gotten either to look good yet. ;)

Water will be simple material shaders with high and low quality version available. I'm looking into simple shiny water (specular), with normal-mapped waves (possibly animated) and varying opacity (fresnel and depth fog). Eventually I'd love to add reflection, refraction, shore foam, caustics and dynamic waves, but that'll be a huge undertaking.

GUI will probably be MyGUI (if I can make it work here), which is a fully scriptable, full-featured XML-based GUI toolset. It does need input hooks, so I'll have to take care of that first (have code around here somewhere to handle it). I'll be tying it tightly to the script system and enable both server-to-client commands and client-to-server replies, thanks to some help from Skywing. It'll probably have a basic system for response checking (for example, when the user clicks a button, it'll just send "|nwshader gui click buttonName" to the server as a chat message). It'll be scriptable and dynamic, though, as much as I can make it.

Edit: And I may have missed any posts on the official NWS forums. They had died down a bit and I somehow stopped getting email updates, so I forgot to check them. Been keeping up a goodly chat/email discussion on this though. I got the code back out after Zebranky started sending me patches (guessing it was a hint). :P
I'll try to check back there and reply to anything I missed.

Also, I've received a fully translated copy of the manual (in Italian) thanks to dark_ansem, so I'll be packaging the next release with complete manual and GUI texts in Italian. If I can find anyone(s) to translate the manual and texts to Spanish, French and German, that would be wonderful. If not, Google will have to do.<_<

Modifié par pkpeachykeen, 07 septembre 2010 - 01:19 .


#62
thirdmouse

thirdmouse
  • Members
  • 143 messages
My ATI card chooses for me. Not that it was a vote!

#63
pkpeachykeen

pkpeachykeen
  • Members
  • 77 messages
I've changed the depth format and things appear to work, I need to do more testing. Fixed up the GUI crash, for good I hope.



I've also added a few features, like filtering shaders (don't display debug ones, and the regex used to filter is tweakable) and a few other GUI tweaks. I'm also making it more accessible, with support for resizing.



Got a few other things on the list, hopefully I can get enough time this week to get it all built and start testing.

#64
pkpeachykeen

pkpeachykeen
  • Members
  • 77 messages
I has made a wee little patch:

https://sourceforge....nwshader/files/



The latest patch (0.2.3.0) depends on the latest Chronepsis download as well. It's a simple patch of the DLL and GUI.



Still testing it, works nicely on my system and everything appears to work.



The config error is fixed, hopefully for good this time. Reworked the config file format to be proper XML. You will lose any settings, but it should be much more stable. A few user requests have been added in, including saving the last tab and a customizable filter for the shader list.



In the core, I think I fixed the depth issues and did a few other tweaks. I'll be doing more if this does in fact fix the issues.



Send any test reports my way, with logs and screens if they contribute.

#65
Dark_Ansem

Dark_Ansem
  • Members
  • 638 messages
you're always the best :D

#66
R-TEAM

R-TEAM
  • Members
  • 30 messages
Hi,



thanks for the patch ;)

The engine self works fine ... but (again :\\ ) the config GUI sucks :P

Store the screensave format randomly false and save only the first selected shader ....

Have setting this with an texteditor - now it works nice ....



Regards

R-TEAM

#67
Jez_fr

Jez_fr
  • Members
  • 302 messages
Thanks to continue working on this Peachy =)

I do have a problem though. I don't see any change at all ingame XD
I followed exactly the installation procedure (easy enough) so I have chronepsys 0223 + patch 0230, have every files copied in main NWN folder, along with NWNShader folder. I think that's correct.

With default installation I don't see any change at all once ingame. So I tried the NWNShader GUI, and checked Fullscreen shaders and Material Shaders boxes. Still no change.

Do I have this correct? or do I need to add some shaders by hand (where?) or did I missed something, like maybe does it require the camera hak to work?

And what can I check ingame to be certain that NWNShader is working?

Thanks for any help in advance! ^^

Modifié par Jez_fr, 01 octobre 2010 - 05:08 .


#68
pkpeachykeen

pkpeachykeen
  • Members
  • 77 messages
R-TEAM: So no crash now? That was my main goal for this, to prevent the crash that had been a problem for 223.
I haven't found a solution for the screenshot directory/format being blank. I haven't been able to find a definite pattern or fix; even the code Zebranky sent me didn't solve the problem entirely. As long as it doesn't crash now, that's a step.
As for the shader flaw, I did a lot of tweaking with the shader list, so it's not surprising it's not fully working. I'll take a look on that too.

Jez_fr: Well, my biggest goal was a success if it doesn't crash. ;)
To test if it's running, delete the file nwshader.log and run the game. If the log is recreated, NWShader ran. you can see the settings and what exactly happened in the log file.

As for no shaders, again, I'll take a look at it. Not sure why, I based the code very closely after the last version (223).

As far as requiring the camera hack, no, NWShader does not require the camera hack. In fact, if you use NWShader, there's no need to use the camera hack: NWShader includes an improved version as an option.

You're actually safer using a byte-perfect version of the original engine with temporary patches performed by NWShader than using a hacked engine: NWShader's edits only last as long as the game is running and don't change any files. NWShader is capable of performing the same patching technique as the camera hack, simply in a safer and more flexible manner. It's also possible to apply other patches in the same manner, so anyone wanting to improve a particular function can replace it with their own code. Eventually I hope to expose a full API for patching the engine, but that'll be a bit in the future.

Modifié par pkpeachykeen, 01 octobre 2010 - 11:10 .


#69
Nostrebor

Nostrebor
  • Members
  • 32 messages
Hi,

I just installed nwshader ( chronepsys 0223 + patch 0230) on Windows 7 64-bit. The nwshader.xml is not compatable with nwshader gui. As a result all of the values are set to something that does not work. After I set them nwshader appers to work fine.

#70
Nostrebor

Nostrebor
  • Members
  • 32 messages
By the way, After I set the values, I was very impressed by nwshader. Are there any materials/shaders that make wolf's hair look better. My kid likes wolves.

#71
pkpeachykeen

pkpeachykeen
  • Members
  • 77 messages
I haven't done anything to wolves yet, but it's possible to make a fur or other effect shader. I'll have to play with that.



For reference, do the shaders work on your system, Nostrebor? I'm trying to pin down what patch broke, if it did break anything.

#72
Nostrebor

Nostrebor
  • Members
  • 32 messages

pkpeachykeen wrote...

I haven't done anything to wolves yet, but it's possible to make a fur or other effect shader. I'll have to play with that.

For reference, do the shaders work on your system, Nostrebor? I'm trying to pin down what patch broke, if it did break anything.



The shaders don't seem to do any thing, but I don't know if my configuration file is correct. 

Modifié par Nostrebor, 03 octobre 2010 - 01:54 .


#73
Nostrebor

Nostrebor
  • Members
  • 32 messages

pkpeachykeen wrote...

For reference, do the shaders work on your system, Nostrebor? I'm trying to pin down what patch broke, if it did break anything.


I have attached the log file.  There seems to be a few errors (is there anyway to keep the forum from reflowing the file.  Bullets worked but there should be another way):


Long List removed

Modifié par Nostrebor, 03 octobre 2010 - 11:19 .


#74
Nostrebor

Nostrebor
  • Members
  • 32 messages
 I think the NWNShader GUI is not correctly writting selected shaders to the "nwshader.xml".  I selected the bloom.cgfx and depthoffield.cgfx shaders, but the xml file has:
  • </Settings>
  •   <Shaders>
  •     <Shader number="0" file="shaders\\bloom.cgfx" />
  •   </Shaders>
When I exit and restart the GUI even this entry is ignored (no shaders are selected)

#75
pkpeachykeen

pkpeachykeen
  • Members
  • 77 messages
Whoa. Any way you can condense that log (or even edit it out, now that I've gone over it)? Bit long. :P



There is a known issue with the shader list, causing them not to be properly written. I'll be fixing that and verifying both ends work correctly. I added a filter to the list, which seems to be having a few unpleasant side effects. Should be easy to take care of, and the loading and drawing code should still work.