Author Topic: Shaders and effects  (Read 34819 times)

Re: Shaders and effects
« Reply #45 on: December 16, 2011, 08:36:28 pm »
If it's done via shaders, it is optional. Everyone can write and use their own shaders or no shaders at all, because it's client side.

And here comes question (cause I'm noob in this matter) - how to apply custom shaders?

friday, friday, fun, fun... posterization applied into game as hlsl shader :)



but need to be fixed more, and gamma should be set correctly..

simpliest wat to do that is add this code to 3D_SpecularMapping.fx and 3D_Default.fx to end of

Code: [Select]

PSNormal


   function before line:

Code: [Select]

return output;


Code: [Select]

float3 transformedColor = output.rgb; // by mistake I placed here output.xyz

// set number of colors
float numberOfColors = 12;

// set gamma
float gamma = 0.5;

transformedColor = pow(transformedColor, gamma);
transformedColor = transformedColor * numberOfColors;
transformedColor = floor(transformedColor);
transformedColor = transformedColor / numberOfColors;
transformedColor = pow(transformedColor,1.0/gamma);
output.rgb = transformedColor;



and now noise (it may be hard):




HOOOAH!!!

first successfull run with noise





http://rudo-brody.pl/uploads/2011-12-16_2159.mp4

nightvision fun :P


more work with shaders more fun :D


tomorrow I will place here fully functional and refactored code
« Last Edit: December 17, 2011, 10:46:49 am by Graf »
no Wez no fun...
http://rudo-brody.pl/uploads/2011-12-24_0012.png
everyday my english loose 1point :/

Offline Karpov

  • Moderator
  • Come Together
Re: Shaders and effects
« Reply #46 on: December 16, 2011, 10:43:38 pm »
Oh, that's great. Good work

Offline Johnnybravo

  • Hey there!
Re: Shaders and effects
« Reply #47 on: December 16, 2011, 10:55:28 pm »
What do you use for the noise? Bitmap? Noise function? Or you just calculate it for every pixel?

Posterization filter gets quite some nice low color image, kudos for that :d. (though it's not correct, because this would better be with a palette lookup, but that's just slow for realtime anyway so I guess this is good enough).
"What is this, I don't even"
"This is your forum."

Re: Shaders and effects
« Reply #48 on: December 16, 2011, 10:57:43 pm »
Code: [Select]
float rand(float2 co)
{
return frac(sin(dot(co.xy ,float2(12.9898,78.233))) * 43758.5453);
}

float noise(float2 co)
{
return rand(floor((co * 500.0) + (8.0*co)));
}

that's noise :) it is multipled per color (r,g,b) in pixel shader

better posterisation than nothing, it works very similar and looks very similar to pallette cut
« Last Edit: December 16, 2011, 11:01:34 pm by baaelSiljan »
no Wez no fun...
http://rudo-brody.pl/uploads/2011-12-24_0012.png
everyday my english loose 1point :/

Offline Luther Blissett

  • Moderator
Re: Shaders and effects
« Reply #49 on: December 17, 2011, 05:35:14 am »
This looks very promising! The texture on that coat could also be improved a little both tonally and in terms of the colour range (I made it, so I assume the comment won't offend anyone). It was made before the specular shaders were implemented, so includes a lot of "painted on" highlight and shadow, which is now a little too "old school" now we have the engine responding to lighting.

If the original .PSD file would be useful for your testing, I can send that along. Otherwise, feel free to redo / improve the texture as necessary :)

Offline barter1113

  • New Vegas fanatic =)
Re: Shaders and effects
« Reply #50 on: December 17, 2011, 09:32:32 am »
OMG baaelSiljan very nice. I love nightvision shader i know it is for fun but looks promising and it is good idea :D Very good.

Re: Shaders and effects
« Reply #51 on: December 17, 2011, 10:51:01 am »
Most impressive!
Wasteland is a tricky business.

Offline LagMaster

  • No. 1 Topic Starter
Re: Shaders and effects
« Reply #52 on: December 17, 2011, 11:15:40 am »
oooooooooooooommmmmmmmmmmmmmmmmmmmmmmmmgggggggggggggggggggg


epic!!!!!!!!!!

Re: Shaders and effects
« Reply #53 on: December 17, 2011, 03:17:41 pm »
This looks very promising! The texture on that coat could also be improved a little both tonally and in terms of the colour range (I made it, so I assume the comment won't offend anyone). It was made before the specular shaders were implemented, so includes a lot of "painted on" highlight and shadow, which is now a little too "old school" now we have the engine responding to lighting.

If the original .PSD file would be useful for your testing, I can send that along. Otherwise, feel free to redo / improve the texture as necessary :)

It looks most falloutish :) I love this coat! But fun with adjusting I will left to You, I just created some shader effects ;)
no Wez no fun...
http://rudo-brody.pl/uploads/2011-12-24_0012.png
everyday my english loose 1point :/

Re: Shaders and effects
« Reply #54 on: December 17, 2011, 04:05:27 pm »
    DIRTY SHADERS 0.2

  • download: http://rudo-brody.pl/dirtyshaders02.zip
  • do backup of Client\data\effects\3D_Default.fx
  • do backup of Client\data\effects\3D_SpecularMapping.fx
  • extract zip to Client\data\effects\
  • modify FO3D files

   BEWARE:

   May cause error when quiting game (I don't know why).

Code: [Select]

  DIRTY SHADERS 0.2
  -----------------

  POLARYZATION AND NOISE:

  Add those values to FO3D model:
 
    float NumberOFColors
      number of colors for polarization filter
   
    float Gamma
      gamma option for polarization filter, play with it to get best result 
   
   
    float AddNoise
      noise amount - 0.0 to 1.0 (more than 1.0 can be passed but looks ugly) 
 
 
  example:
 
  EffDef Floats NumberOFColors 8
  EffDef Floats Gamma 0,6
  EffDef Floats AddNoise 1,0
 


Change log:

  0.2
    removed mip mapping so textures should look more ugly and dirty and pixelated ;)
 
  0.1
    initial shaders

example code IMO best for coat:

Code: [Select]

   EffDef Floats NumberOFColors 12
   EffDef Floats Gamma 0,8
   EffDef Floats AddNoise 0,4


    EFFECT:

   
   

   Please check it and play with it and get fun.. I'm waiting for your changes and opinions.


« Last Edit: December 17, 2011, 04:14:38 pm by baaelSiljan »
no Wez no fun...
http://rudo-brody.pl/uploads/2011-12-24_0012.png
everyday my english loose 1point :/

Offline LagMaster

  • No. 1 Topic Starter
Re: Shaders and effects
« Reply #55 on: December 17, 2011, 04:49:21 pm »
now we got a way to make 3D look like original fallout, no more need for the hated(but i whant it original) comment topics

Offline Surf

  • Moderator
  • это моё.
Re: Shaders and effects
« Reply #56 on: December 17, 2011, 05:00:35 pm »
Amazing progress baael - looks even better than I expected! :)

Offline LagMaster

  • No. 1 Topic Starter
Re: Shaders and effects
« Reply #57 on: December 17, 2011, 05:52:41 pm »
sr for spam post, but found a small problem

the shadow is not pixelated

Re: Shaders and effects
« Reply #58 on: December 17, 2011, 06:10:10 pm »
sr for spam post, but found a small problem

the shadow is not pixelated

yeah, working on it
no Wez no fun...
http://rudo-brody.pl/uploads/2011-12-24_0012.png
everyday my english loose 1point :/

Offline Johnnybravo

  • Hey there!
Re: Shaders and effects
« Reply #59 on: December 17, 2011, 07:14:33 pm »
Yeah, guess it should not be opaque black in original full color either.
"What is this, I don't even"
"This is your forum."