DK22Pac Posted April 23, 2014 Share Posted April 23, 2014 (edited) CLEO Shader API - write & use HLSL shaders with CLEO scriptsOverviewCLEO Shader API is based on Shader class. Its interface has following methods:Load("FileName%v")Loads shader (effect) from file and returns shader's handleDraw("Shader%h" "Technique%v" "Left%f" "Top%f" "Right%f" "Bottom%f")Draws rect with shader's techniqueDrawHudElement("Shader%h" "Technique%v" "Left%f" "Top%f" "Right%f" "Bottom%f")Draws rect with shader's technique at HUD renderingSetFloat("Shader%h" "ParamName%v" "Value%f")Sets float paramSetInt("Shader%h" "ParamName%v" "Value%i")Sets integer paramSetBool("Shader%h" "ParamName%v" "Value%b")Sets boolean paramSetVector("Shader%h" "ParamName%v" "X%f" "Y%f" "Z%f" "W%f")Sets vector paramSetMatrix("Shader%h" "ParamName%v" "Matrix%h")Sets matrix param. Second parameter is a pointer to D3DMATRIX struct.SetTexture("Shader%h" "ParamName%v" "TextureName%v")Sets texture param. Second parameter is name of texture loaded with LoadTexture() method.SetRwTexture("Shader%h" "ParamName%v" "Texture%h")Sets texture param. Second parameter is a pointer to RwTexture object.LoadTexture("Name%v" "FileName%v")Loads texture from fileUnloadTexture("Name%v")Unloads textureFeaturesSemanticsYou can use some default paramters, without passing them in CLEO script. They are marked with semantics. CLEO Shader API supports such semantics:Type SemanticName Descriptiontexture SCREEN_TEX frame buffer texturetexture DEPTH_TEX z-buffer texturefloat3 SUN_CORONA_COL sun's corona colorfloat3 SUN_CORE_COL sun's core colorfloat3 SKY_TOP_COLfloat3 SKY_BOTTOM_COLfloat3 AMBIENT_COLfloat2 SUN_POSN sun position (screen-space coordinates)float SUN_SIZEfloat DAYNIGHT_STATEfloat WEATHER_FOGGYNESSfloat WEATHER_CLOUD_COVERAGEfloat WEATHER_RAINfloat WEATHER_UNDER_WATERNESSint MULTISAMPLE_LEVELS AA level in game menubool NIGHT_VISIONbool INFRARED_VISIONbool HEAT_VISUALSWhen defining a variable for such parameter, use shared specificator: shared float2 sunPosn : SUN_POSN; Screen size constantsUse following parameter if you want to draw full/half screen effect:SCREEN_BASE_XSCREEN_BASE_YSCREEN_SIZE_XSCREEN_SIZE_YSCREEN_HALF_XSCREEN_HALF_Y ExamplesSimple blur shader: shared texture screen : SCREEN_TEX;float dist; sampler2D screenSampler = sampler_state{ Texture = <screen>;}; float4 PS_screen(float2 tex: TEXCOORD0): COLOR{ float4 color; color = tex2D(screenSampler, tex); color += tex2D(screenSampler, tex + dist); color += tex2D(screenSampler, tex - dist); return color / 3;} technique ShowScreen{ pass P0 { PixelShader = compile ps_2_0 PS_screen(); }}[size=4] CLEO-script for this shader: {$CLEO}{$I shaderApi} var [email protected]: shaderend if [email protected] = shader.Load("CLEO\blur.txt")then while true wait 0 068D: get_camera_position_to [email protected] [email protected] [email protected] 050A: [email protected] = distance_between_XYZ [email protected] [email protected] [email protected] and_XYZ [email protected] [email protected] [email protected] [email protected] *= 0.0008 068D: get_camera_position_to [email protected] [email protected] [email protected] [email protected]("dist", [email protected]) [email protected]("ShowScreen", SCREEN_BASE_X, SCREEN_BASE_Y, SCREEN_SIZE_X, SCREEN_SIZE_Y) endend0A93: end_custom_thread Download links https://www.mediafire.com/?pze89mkv09ig087 Edited April 24, 2014 by _DK HzanRsxa2959, Marty McFly, Concavax and 22 others 25 Link to comment Share on other sites More sharing options...
Marty McFly Posted April 24, 2014 Share Posted April 24, 2014 Great! Waited for this quite a time. But I have some questions: - which CLEO version is required? - modloader compatible? Or does the shader txt file have to be in SA folder\CLEO folder? - is the one shaderapi file intented to be without a file extension? - which shader model is required or does this depend on shader file? -the variable "dist" is declared outside the pixel shader without a value and needs to be added to the CLEO file. What if I declare it like "float dist = 1.0;" do I have to add it to the cleoscript, too? Link to comment Share on other sites More sharing options...
madleg Posted April 24, 2014 Share Posted April 24, 2014 amazing plugin <3 -the variable "dist" is declared outside the pixel shader without a value and needs to be added to the CLEO file. What if I declare it like "float dist = 1.0;" do I have to add it to the cleoscript, too? ofc no, that opcodes just allow u to make params dynamic through cleo p.s. rehan97, Ashwin.Star, uncaged and 2 others 5 Link to comment Share on other sites More sharing options...
Node Posted April 25, 2014 Share Posted April 25, 2014 Holy f*ck. Platinum Card 1 Link to comment Share on other sites More sharing options...
FMHn Posted April 27, 2014 Share Posted April 27, 2014 awesome work sir! love it,more simple life, waiting for this for a long time will try it soon, good luck! RyanDri3957V 1 Link to comment Share on other sites More sharing options...
madleg Posted April 27, 2014 Share Posted April 27, 2014 there is any way to do multipass postprocess of screen image? i mean if i call .Draw second time, can i change sharing texture to already processed one? if it so - how? sorry for bad understanding and i know that i can do all shi in a single shader (but it sux a bit) Link to comment Share on other sites More sharing options...
DK22Pac Posted April 27, 2014 Author Share Posted April 27, 2014 (edited) technique ShowScreen { pass P0 { PixelShader = compile ps_2_0 PS_screen(); } pass P1 { PixelShader = compile ps_2_0 PS_screen_2(); } } Edited April 27, 2014 by _DK JSBOfficial 1 Link to comment Share on other sites More sharing options...
madleg Posted May 1, 2014 Share Posted May 1, 2014 (edited) i give up... there is some way to store pixel data as texture in hlsl and then use it like sampler? will be great if you will add something like saving result of processed shader as texture (like in mta) bloom without mask from ultraThing, i guess shared texture screen : SCREEN_TEX;sampler TextureSampler : register(s0){ Texture = <screen>;};float BlurPower = 0.01;float BaseIntensity = 1;float BloomIntensity = 0.4;float BaseSaturation = 1;float BloomSaturation = 1;float BloomThreshold = 0.1;const float2 offsets[12] = { -0.326212, -0.405805, -0.840144, -0.073580, -0.695914, 0.457137, -0.203345, 0.620716, 0.962340, -0.194983, 0.473434, -0.480026, 0.519456, 0.767022, 0.185461, -0.893124, 0.507431, 0.064425, 0.896420, 0.412458, -0.321940, -0.932615, -0.791559, -0.597705, }; float4 main2(float2 texCoord : TEXCOORD0) : COLOR0 { float4 color = tex2D(TextureSampler, texCoord); return saturate((color - BloomThreshold) / (1 - BloomThreshold)); }float4 AdjustSaturation(float4 color, float saturation) { float grey = dot(color, float3(0.3, 0.59, 0.11)); return lerp(grey, color, saturation); } float4 main(float2 texCoord : TEXCOORD0) : COLOR0{ float4 original = tex2D(TextureSampler, texCoord); float4 sum = main2(texCoord); for(int i = 0; i < 12; i++) { sum += main2(texCoord + BlurPower * offsets[i]); } sum /= 13; original = AdjustSaturation(original, BaseSaturation) * BaseIntensity; sum = AdjustSaturation(sum, BloomSaturation) * BloomIntensity; return sum + original; }technique Bloom{ pass Pass1 { PixelShader = compile ps_2_0 main(); }} Edited May 3, 2014 by madleg Link to comment Share on other sites More sharing options...
GoUrbex Posted May 6, 2014 Share Posted May 6, 2014 Hi How make black-white screen using this? Concavax 1 Link to comment Share on other sites More sharing options...
J16D Posted May 10, 2014 Share Posted May 10, 2014 it is possible to apply shaders for a specific texture in game? like this; engineApplyShaderToWorldTexture ( myShader, "waterclear256" ) Link to comment Share on other sites More sharing options...
madleg Posted May 24, 2014 Share Posted May 24, 2014 DK, can you show please an example how to draw a texture loaded from file? Link to comment Share on other sites More sharing options...
DK22Pac Posted May 24, 2014 Author Share Posted May 24, 2014 (edited) You need to pass a texture as a parameter to shader. if and [email protected] = shader.Load("CLEO\blur.txt") shader.LoadTexture("myTex", "CLEO\myTex.png")then [email protected]("shaderTexParam", "myTex") while true wait 0 [email protected]("ShowTex", SCREEN_BASE_X, SCREEN_BASE_Y, SCREEN_SIZE_X, SCREEN_SIZE_Y) endend Edited May 24, 2014 by _DK Link to comment Share on other sites More sharing options...
madleg Posted May 24, 2014 Share Posted May 24, 2014 You need to pass a texture as a parameter to shader. well, i though so and i did, but it wont work for me. In result i get black screen, like texture wasnt loaded. can you help me, if im wrong? or maybe show your shader example? ty texture screenTex;sampler2D ScreenSamp = sampler_state { Texture = (screenTex);};float4 PixelShaderFunction(float2 TexCoord : TEXCOORD0) : COLOR0{ float4 col = tex2D(ScreenSamp, TexCoord); return col; }technique shader{ pass P0 { PixelShader = compile ps_2_0 PixelShaderFunction(); }}//cleo{$I shaderApi}0000:if 0DF0: [email protected] "CLEO\shader0.txt" then 0DF8: load_dx_texture "TEX" from_file "cleo\map.png" 0DF7: set_shader [email protected] dx_texture_param "screenTex" to "TEX" else 0a93:endwhile true wait 0 0DF1: [email protected] "shader" 1 2 3 4end Link to comment Share on other sites More sharing options...
J16D Posted May 24, 2014 Share Posted May 24, 2014 (edited) You need to pass a texture as a parameter to shader. well, i though so and i did, but it wont work for me. In result i get black screen, like texture wasnt loaded. can you help me, if im wrong? or maybe show your shader example? ty ahm.. it's not quite difficult.. but I see that your shader will return black screen anyway..while I was testing, I did this one; shared texture originaltexture : SCREEN_TEX;shared texture newtexture : SCREEN_TEX;sampler OriginalSampler = sampler_state{ Texture = <originaltexture>;};sampler NewSampler = sampler_state{ Texture = <newtexture>;};float4 PixelShaderFunction(float2 TextureCoordinate : TEXCOORD0) : COLOR0 { // sample original texture float4 original= tex2D(OriginalSampler , TextureCoordinate.xy); // sample a pixel from NewSampler texture float4 second= tex2D(NewSampler , TextureCoordinate.xy); original.r = original.r * second.g; original.g = original.b * second.b; original.b = original.g * second.r; //original.r = original.r + second.g; return original; }technique mixtextures{ pass P0 { PixelShader = compile ps_2_0 PixelShaderFunction(); }} {$CLEO}{$I shaderApi}0000:while truerepeat wait 0until 0AB0: key_pressed 50 // number 2if 0DF0: [email protected] = load_shader_from_file "CLEO\shaders\externalTexture.fx"then //0ACA: show_text_box "on" wait 500 0DF8: load_dx_texture "externalT" from_file "CLEO\shaders\humo.png" 0DF7: set_shader [email protected] dx_texture_param "newtexture" to "externalT" repeat 0DF1: draw_shader [email protected] technique "mixtextures" at SCREEN_BASE_X SCREEN_BASE_Y SCREEN_SIZE_X SCREEN_SIZE_Y wait 0 until 0AB0: key_pressed 50 // number 2 0DF9: unload_dx_texture "externalT" //0ACA: show_text_box "off" wait 500else 0ACA: show_text_box "not loaded"end wait 0end the texture, is any SMOKE texture... ps. DK, can you explain how to use this opcode; SetRwTexture("Shader%h" "ParamName%v" "Texture%h") Sets texture param. Second parameter is a pointer to RwTexture object. thanks Edited May 24, 2014 by jayd00 Link to comment Share on other sites More sharing options...
Shmoopy Posted May 25, 2014 Share Posted May 25, 2014 (edited) Inverted colors : shared texture screen : SCREEN_TEX;sampler2D screenSampler = sampler_state{ Texture = <screen>;}; float4 PS_invcolor(float2 uv: TEXCOORD) : COLOR{ float4 color = tex2D( screenSampler, uv ); float4 invertedColor = float4(color.a - color.rgb, color.a); return invertedColor;} Emboss: shared texture screen : SCREEN_TEX;sampler2D screenSampler = sampler_state{ Texture = <screen>;};float4 PS_emboss(float2 uv: TEXCOORD) : COLOR{ float4 color = tex2D( screenSampler, uv.xy); color -= tex2D(screenSampler , uv.xy-0.0005)*2.7f; color += tex2D(screenSampler , uv.xy+0.0005)*2.7f; color.rgb = (color.r+color.g+color.b)/3.0f; return color;} Photocopy: shared texture screen : SCREEN_TEX;sampler2D screenSampler = sampler_state{ Texture = <screen>;};float4 PS_photocopy(float2 uv: TEXCOORD) : COLOR{ float4 color = tex2D( screenSampler, uv.xy); color -= tex2D(screenSampler , uv.xy)*2.7f;color += tex2D(screenSampler , uv.xy)*2.7f;color.rgb = (color.r+color.g+color.b)/2.0f; if (color.r<0.2 || color.r>0.9) color.r = 0; else color.r = 1.0f;if (color.g<0.2 || color.g>0.9) color.g = 0; else color.g = 1.0f;if (color.b<0.2 || color.b>0.9) color.b = 0; else color.b = 1.0f; return color;} Toon Shading : shared texture screen : SCREEN_TEX;sampler2D screenSampler = sampler_state{ Texture = <screen>;};float4 PS_toon(float2 uv: TEXCOORD) : COLOR{ //float4 color = tex2D(screenSampler, uv.xy); float4 color = tex2D(screenSampler, uv); color.r = round(color.r*16.0)/16.0; color.g = round(color.g*16.0)/16.0; color.b = round(color.b*16.0)/16.0; const float threshold = 0.2; const int NUM = 9; const float2 c[NUM] = { float2(-0.0078125, 0.0078125), float2( 0.00 , 0.0078125), float2( 0.0078125, 0.0078125), float2(-0.0078125, 0.00 ), float2( 0.0, 0.0), float2( 0.0078125, 0.007 ), float2(-0.0078125,-0.0078125), float2( 0.00 , -0.0078125), float2( 0.0078125,-0.0078125), }; int i; float3 col[NUM]; for (i=0; i < NUM; i++) { col[i] = tex2D(screenSampler, uv.xy + 0.2*c[i]); } float3 rgb2lum = float3(0.30, 0.59, 0.11); float lum[NUM]; for (i = 0; i < NUM; i++) { lum[i] = dot(col[i].xyz, rgb2lum); } float x = lum[2]+ lum[8]+2*lum[5]-lum[0]-2*lum[3]-lum[6]; float y = lum[6]+2*lum[7]+ lum[8]-lum[0]-2*lum[1]-lum[2]; float edge =(x*x + y*y < threshold)? 1.0:0.0; color.rgb *= edge; return color;} Edited June 3, 2014 by Manfred Von Karma Link to comment Share on other sites More sharing options...
GoUrbex Posted May 27, 2014 Share Posted May 27, 2014 (edited) Is possible get picture from other camera by coordinate? Edited May 27, 2014 by Rafal22 Link to comment Share on other sites More sharing options...
J16D Posted May 29, 2014 Share Posted May 29, 2014 Toon Shading : it like me your toon shader... can you lend me your code? DK22Pac and Concavax 2 Link to comment Share on other sites More sharing options...
Shmoopy Posted May 29, 2014 Share Posted May 29, 2014 (edited) You mean the cleo code ? cz i've already gave the shader code : /*/* Shader API header/* /* Shader API CLEO developed by DK22Pac*/{$OPCODE 0DF0=2, %2d% = load_shader_from_file %1s%}{$OPCODE 0DF1=6,draw_shader %1d% technique %2s% at %3d% %4d% %5d% %6d%}{$OPCODE 0DF2=3,set_shader %1d% float_param %2s% to %3d%}{$OPCODE 0DF3=3,set_shader %1d% int_param %2s% to %3d%}{$OPCODE 0DF4=3,set_shader %1d% bool_param %2s% to %3d%}{$OPCODE 0DF5=6,set_shader %1d% vector_param %2s% to %3d% %4d% %5d% %6d%}{$OPCODE 0DF6=3,set_shader %1d% matrix_param %2s% to %3d%}{$OPCODE 0DF7=3,set_shader %1d% dx_texture_param %2s% to %3s%}{$OPCODE 0DF8=2,load_dx_texture %1s% from_file %2s%}{$OPCODE 0DF9=1,unload_dx_texture %1s%}{$OPCODE 0DFA=6,draw_shader %1d% technique %2s% at %3d% %4d% %5d% %6d% as_hud_element}{$OPCODE 0DFB=3,set_shader %1d% rw_texture_param %2s% to %3h%}constSCREEN_BASE_X=1SCREEN_BASE_Y=2SCREEN_SIZE_X=3SCREEN_SIZE_Y=4SCREEN_HALF_X=5SCREEN_HALF_Y=6endif 0DF0: [email protected] = load_shader_from_file "cleo\toon.txt" then while true wait 0 0DF1: draw_shader [email protected] technique "ShowScreen" at SCREEN_BASE_X SCREEN_BASE_Y SCREEN_SIZE_X SCREEN_SIZE_Y endend Edited May 29, 2014 by Manfred Von Karma Link to comment Share on other sites More sharing options...
J16D Posted May 29, 2014 Share Posted May 29, 2014 (edited) well.. I meant the shader code thanks... I let here the opcodes, that can be added to SB (to use with opcode search) 0DF0: [email protected] = load_shader_from_file "CLEO\shader.fx"0DF1: draw_shader [email protected] technique "technique" at 1 2 3 4 //{SCREEN_BASE_X=1}{SCREEN_BASE_Y=2}{SCREEN_SIZE_X=3}{SCREEN_SIZE_Y=4}{SCREEN_HALF_X=5}{SCREEN_HALF_Y=6} 0DF2: set_shader [email protected] float_param "sFloatParam" to 255.0 // (Float)0DF3: set_shader [email protected] int_param "sIntParam" to 255 // (Int)0DF4: set_shader [email protected] bool_param "sBoolColor" to 0 // (Bool) (0-1)0DF5: set_shader [email protected] vector_param "sFloat4Param" to 255.0 255.0 255.0 255.0 // (Float)0DF6: set_shader [email protected] matrix_param "sMatrixParam" to [email protected]: set_shader [email protected] dx_texture_param "sTextureParam" to "newTexture"0DF8: load_dx_texture "newTexture" from_file "CLEO/texture.png"0DF9: unload_dx_texture "newTexture"0DFA: draw_shader [email protected] technique "technique" at 1 2 3 4 as_hud_element //{SCREEN_BASE_X=1}{SCREEN_BASE_Y=2}{SCREEN_SIZE_X=3}{SCREEN_SIZE_Y=4}{SCREEN_HALF_X=5}{SCREEN_HALF_Y=6}0DFB: set_shader [email protected] rw_texture_param "sTextureParam" to [email protected] // "newTexture" in [email protected] and also the opcode definitions for SASCM.INI (instead of using SB opcode definition) (is the same thing...) ; shader.cleo opcodes by DK22Pac0DF0=2, %2d% = load_shader_from_file %1s%0DF1=6,draw_shader %1d% technique %2s% at %3d% %4d% %5d% %6d%0DF2=3,set_shader %1d% float_param %2s% to %3d%0DF3=3,set_shader %1d% int_param %2s% to %3d%0DF4=3,set_shader %1d% bool_param %2s% to %3d%0DF5=6,set_shader %1d% vector_param %2s% to %3d% %4d% %5d% %6d%0DF6=3,set_shader %1d% matrix_param %2s% to %3d%0DF7=3,set_shader %1d% dx_texture_param %2s% to %3s%0DF8=2,load_dx_texture %1s% from_file %2s%0DF9=1,unload_dx_texture %1s%0DFA=6,draw_shader %1d% technique %2s% at %3d% %4d% %5d% %6d% as_hud_element0DFB=3,set_shader %1d% rw_texture_param %2s% to %3h% if there is something wrong, feel free to correct it... Edited May 29, 2014 by jayd00 Link to comment Share on other sites More sharing options...
DK22Pac Posted May 29, 2014 Author Share Posted May 29, 2014 (edited) Why do you need it in opcode search? WTF? Use this shader. {SCREEN_BASE_X=1}{SCREEN_BASE_Y=2}{SCREEN_SIZE_X=3}{SCREEN_SIZE_Y=4}{SCREEN_HALF_X=5}{SCREEN_HALF_Y=6}Thanks guys, I tried to simplify your work, but you don't look for easy ways. Edited July 28, 2014 by _DK S Y E D 1 Link to comment Share on other sites More sharing options...
J16D Posted May 30, 2014 Share Posted May 30, 2014 Why do you need it in opcode search? WTF? Use this shader. {SCREEN_BASE_X=1}{SCREEN_BASE_Y=2}{SCREEN_SIZE_X=3}{SCREEN_SIZE_Y=4}{SCREEN_HALF_X=5}{SCREEN_HALF_Y=6} Thanks guys, I tried to simplify your work, but you don't look for easy ways. haha that picture is funny.. there are some people like me, that we use the "write opcodes" in SB options. and unfortunately.. you're right. classes are easy but... sometimes we have some troubles with them... like this one for example; we are not expert in SB... some people like me learned about "coding". only to stop f*ck you out with requests. and you're gone DK, you write something once, at month. with lucky... I'm sure you have more interesting things to do... definitelly.. but is not good to judge someone with "wtf"? with meaning; "your'e an asshole" we only don't do the same like you, and all the coders. some people like me only dedicate to make money. take as example, if I start talking with you about boilers, what can you talk me about it? I'm engineer, and this is my branch. you see now... definitely, you don't know the same like me in this branch. and that's what happens to me in topics like "coding" for me, this is only for fun. but probably for you, this is what you do in real life. if you're only a child, I hope you take it the most serious possible. I hope you understand my point now... peace and keep doing great things for this game... Link to comment Share on other sites More sharing options...
DK22Pac Posted May 31, 2014 Author Share Posted May 31, 2014 You didn't add shader class to classes.db. See how other classes are defined and try to understand it. RyanDri3957V 1 Link to comment Share on other sites More sharing options...
Shmoopy Posted May 31, 2014 Share Posted May 31, 2014 (edited) Sepia : ( Would look amazing with a texture shader of film grains or lines) float4 PS_sepia(float2 uv: TEXCOORD) : COLOR{ float4 color = tex2D(screenSampler, uv); color.r = (color.r * 0.393) + (color.g * 0.769) + (color.b * 0.189); color.g = (color.r * 0.349) + (color.g * 0.686) + (color.b * 0.168); color.b = (color.r * 0.272) + (color.g * 0.534) + (color.b * 0.131); return color;} Radial blur : ( Would be awesome in a parkour or a racing mod ) float4 PS_radialb(float2 uv: TEXCOORD) : COLOR{float2 centerPos = { 0.5, 0.5 }; float blurStart = 1.0f; float blurWidth = -0.1; int nsamples = 10; uv -= centerPos; float4 radialb = 0; for(int i=0; i <nsamples; i++) { float scale = blurStart + blurWidth*(i/(float) (nsamples-1)); radialb += tex2D(screenSampler, uv * scale + centerPos ); } radialb /= nsamples;return radialb;} Moving noise : ( If you want it to be static , remove the [email protected] += 1.0 line) float Timer;float4 PS_noise(float2 uv: TEXCOORD) : COLOR{ float x=uv.x*uv.y*123456 * Timer; x=fmod(x,13) * fmod(x,123); float dx = fmod(x,0.01); float dy = fmod(x,0.012); float4 noise=tex2D(screenSampler, uv+float2(dx,dy)); return noise;} [email protected] = 0.5if 0DF0: [email protected] = load_shader_from_file "cleo\blur.txt"then while true wait 0 0DF2: set_shader [email protected] float_param "Timer" to [email protected] 0DF1: draw_shader [email protected] technique "ShowScreen" at SCREEN_BASE_X SCREEN_BASE_Y SCREEN_SIZE_X SCREEN_SIZE_Y [email protected] += 1.0 endend Vignette : float4 PS_vignette(float2 uv: TEXCOORD) : COLOR{float radius = 1.3; float2 center = float2(0.5, 0.5);float d = distance(center, uv) * radius;float3 color = tex2D(screenSampler, uv).rgb * (1.0 - d * d);float4 vignette = float4(color.rgb, radius);return vignette;} Edited June 15, 2014 by Manfred Von Karma Concavax, Z i X, DK22Pac and 3 others 6 Link to comment Share on other sites More sharing options...
KeeJay Posted June 3, 2014 Share Posted June 3, 2014 @Manfred Von Karma - can you do also one with vignette effect? Link to comment Share on other sites More sharing options...
Shmoopy Posted June 3, 2014 Share Posted June 3, 2014 @Manfred Von Karma - can you do also one with vignette effect? Done , check the previous post Concavax 1 Link to comment Share on other sites More sharing options...
GoUrbex Posted June 12, 2014 Share Posted June 12, 2014 Is it possible to do depth of field effect when using shader api? KeeJay and Concavax 2 Link to comment Share on other sites More sharing options...
Junior_Djjr Posted June 14, 2014 Share Posted June 14, 2014 (edited) i loved, this is a in-game configuration of madleg's shader: (only to test i think) but... the .cleo removed my anti aliasing .-. i think of anti aliasing of GPU (gf 8400 gs ddr2 512 mbs), 'cause the anti aliasing of my GTA is off lol edit: wtf, i looked now and the second print the shirt of my CJ is bugged, the shirt is black @[email protected] Edited June 14, 2014 by Junior_Djjr RyanDri3957V, Concavax, madleg and 3 others 6 Link to comment Share on other sites More sharing options...
DK22Pac Posted June 15, 2014 Author Share Posted June 15, 2014 (edited) Programmable pipeline can't be combined with gpu AA... You need to do it inside shader. And also, nice stuff there! Edited June 15, 2014 by _DK Link to comment Share on other sites More sharing options...
Junior_Djjr Posted June 15, 2014 Share Posted June 15, 2014 strange, anyone lose the anti aliasing when put the shaderApi.cleo? but, when i forced the AA of GPU in the game, worked as fine and laggy... when i don't forced continues with a light AA and don't lags (in the confg of game, the AA is off wtf), but when i put the .cleo in game, the graphics stay a sh*t without AA Link to comment Share on other sites More sharing options...
DK22Pac Posted June 17, 2014 Author Share Posted June 17, 2014 Well, I just said it before. Didn't you read my post? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now