Pete´s Messageboard... No ISO/BIOS requests!

Homepage Members Register Login Search Old board


Neuer Thread ...


AuthorTopics » Book an abo for this threadClose Thread Move Thread Fix the thread Print view Delete this thread

3Nitro 



...

Status:Offline
Date registered: 23.10.2009
Post:3
Send Message
...   Created on 23.10.2009 - 06:43Jump to top Quote this post Report this post Edit Delete


Hi, can anyone make shader that add noise effect (Film grain) like in silent hill 2 or etc?
Or where I can find some info about writing shaders for this plugin?
And one more question) Is there way to combine 2 or more shader effects?




KrossX 
Strong supporter
......

...

Status:Offline
Date registered: 16.06.2008
Post:90
Send Message
...   Created on 07.11.2009 - 23:54Jump to top Quote this post Report this post Edit Delete


From This Thread on the ePSXe's forum, you might want to check the following to know more about Shaders:
Shaders @ Wiki | Guide to Shaders

About a "noise" shader. This is what I was able to do. Is not animated and it flickers sometimes... but, it's something. XD


gpuPeteOGL2.slv

Code:
1:
2:
3:
4:
5:
6:
7:
8:
 
uniform vec4 OGL2Param;

void main()
{
     gl_Position = ftransform();
     gl_TexCoord[0].xy = gl_MultiTexCoord0.xy;     
}


gpuPeteOGL2.slf
Code:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
 
uniform sampler2D OGL2Texture;
uniform vec4 OGL2Param;

void main()
{    
    vec2 constant1 = vec2( 142.0/11.0, 1017.0/13.0 );    
    float constant2 = 481344.0/11.0;                               
    
    vec3 final = texture(OGL2Texture, gl_TexCoord[0].xy).xyz;             
    float noise = fract( sin( dot( gl_TexCoord[0].xy, constant1 )) * constant2);     
            
    // Color correction 16-235    
    final = final * 1.16438356 - 0.07305936;    
        
    gl_FragColor.xyz = mix(final, noise, OGL2Param.z * 0.15);             
     
}


#EDIT: Cleaned it up a bit.

[Dieser Beitrag wurde am 15.11.2009 - 23:08 von KrossX aktualisiert]





Signature

3Nitro 



...

Status:Offline
Date registered: 23.10.2009
Post:3
Send Message
...   Created on 15.11.2009 - 19:15Jump to top Quote this post Report this post Edit Delete


Thx KrossX, but it's still too difficult for me to write shaders.

About you noise filter, it's flicking all the time, but that is better then nothing, thank you.
Also I find game/demoscene called Ruinas 2.0
http://blenderartists.org/forum/showpos … ostcount=4
Maybe you can extract noise shader from it?
Game created with Blender, and contain project '*.blend' files. So you can just open it with Blender.




KrossX 
Strong supporter
......

...

Status:Offline
Date registered: 16.06.2008
Post:90
Send Message
...   Created on 15.11.2009 - 21:49Jump to top Quote this post Report this post Edit Delete


I'll see if I can stop the flickering. But I would need some constantly changing value to animate it, like "time". Sadly, I don't know of such thing on Pete's OGL2. =S
Also, the noise function was taken from here: Lumina - Noise

#EDIT: Cannot get rid of the flickering at all. =_="

[Dieser Beitrag wurde am 15.11.2009 - 23:06 von KrossX aktualisiert]





Signature

3Nitro 



...

Status:Offline
Date registered: 23.10.2009
Post:3
Send Message
...   Created on 16.11.2009 - 11:29Jump to top Quote this post Report this post Edit Delete


So it means that plugin is compiling shader code, some functions are not realized and cant be included?

Maybe you can get random val. from the each frame (color of some pixel, overall luminance or something else)? Then when frame changed noise will refresh. Or that's impossible too?




KrossX 
Strong supporter
......

...

Status:Offline
Date registered: 16.06.2008
Post:90
Send Message
...   Created on 16.11.2009 - 14:30Jump to top Quote this post Report this post Edit Delete


Well, custom variables must be provided prior shader. That is, from the plugin in this case. For example, the OGLParam, that has information like shader level selected.

I did try to base the noise on the image itself. The outcome was some kind of "animated" noise... but where and when the image actually changed, so it looked ugly. =S

There are noise functions on GLSL, but I have no idea on how to use them. That is, I always get no result from them. >_<

Anyhow, I've just merely attemped to mess with shaders. I still don't know what each thing does, nor what can the plugin provide. T_T

#EDIT: Perhaps using an external noise texture? At least it wouldn't flicker I think. Or perhaps, use external textures to get values and animate the noise... I dunno how can that be done... >_<

[Dieser Beitrag wurde am 16.11.2009 - 14:42 von KrossX aktualisiert]





Signature


Similarly threads:
Topics Created by Replies Boardname
Shader Aquamarin 0 schaddi
4-in-1 Shader v1.10 MegaManJuno 3 pete_bernert
What's a Shader Near 1 pete_bernert
Request: noise/film grain shader Kodaemon 10 pete_bernert
Natural Vision Shader + AA Shader v2.o = Best Shader for 2d !! zaykho 10 pete_bernert
Neuer Thread ...





Masthead

This forum is a free service of razyboard.com powered by:
Geizkragen Price Comparison. Top product in the price comparison: Krups Nespresso Essenza (XN2001)
Do you want a free forum in less than two minutes? Then click here!



blank