DJThanos Posted May 21, 2014 Share Posted May 21, 2014 I found some "shader examples" for MTA, which included road reflection, car reflection and water reflection.. Is there a way to convert and put them in the game? Or get the code of the mod and put it in the game? Or make the mod exclusively for singleplayer and samp? And if no possible, how to make SA GFX work on SAMP? Link to comment Share on other sites More sharing options...
uNi Posted May 21, 2014 Share Posted May 21, 2014 Doesn't some versions of ENB work with sa-mp? Â Â Link to comment Share on other sites More sharing options...
DJThanos Posted May 21, 2014 Author Share Posted May 21, 2014 i can't run ENB Link to comment Share on other sites More sharing options...
uNi Posted May 21, 2014 Share Posted May 21, 2014 i can't run ENB  It depends on the config you're using: try this one: http://www.mediafire.com/download/26x8uh0t85nayuc/%5BSAMP%5DBETTER+GRAPICS.rar  It contains a file for low end pcs.   Link to comment Share on other sites More sharing options...
DJThanos Posted May 21, 2014 Author Share Posted May 21, 2014 I already use an edited timecyc that works on samp (PS2 timecyc). And ENB won't work. I want a mod for SAMP that has MTA water reflection, or car reflection. But SA GFX is incompatible with SAMP.. Link to comment Share on other sites More sharing options...
DJThanos Posted May 21, 2014 Author Share Posted May 21, 2014 Any help? Link to comment Share on other sites More sharing options...
TJGM Posted May 22, 2014 Share Posted May 22, 2014 Too lazy to explain, but it simply can't happen. Link to comment Share on other sites More sharing options...
Shmoopy Posted May 22, 2014 Share Posted May 22, 2014 (edited) SA GFX will work , but it doesn't come with water and road reflections , only vehicles . But , i think , that you can tweak them in the "shaders/" folder . Here is the vehicles reflection shader of SA GFX : Â Â //NOTES://Shadows have been *temporarily* dropped, in order to facilitate progress in other aspects of the mod!// This is used by 3dsmax to load the correct parserstring ParamID = "0x003";#include "defines.fxh"int maxaniso = 1;//max anisotropyint filtermin = 2;//anisotropic = 3, linear = 2int filtermag = 2;int filtermip = 2;//linear////////////////////////////////////////////////////Matrices//////////////////////////////////////////////////float4x4 WorldIT : WorldInverseTranspose < string UIWidget = "None"; >;float4x4 WorldViewProj : WorldViewProjection < string UIWidget = "None"; >;float4x4 World : World < string UIWidget = "None"; >;float4x4 ViewInv : ViewInverse < string UIWidget = "None"; >;////////////////////////////////////////////////////Main Light//////////////////////////////////////////////////float3 LightDir : Direction< string Object = "Spotlight"; string Space = "World";> = {0.0f, 0.5, -1.0f};//{0.0f, 1.0f, -0.5f};float4 LightColor1 : Diffuse < string UIName = "Light1 Color"; string Object = "Spotlight"; string UIWidget = "Color";> = {1.0f, 1.0f, 1.0f, 1.0f};float3 spec2dir : Direction< string Object = "SpotLight"; string Space = "World";> = {0.0f,0.0f,1.0f};////////////////////////////////////////////////////Material surface//////////////////////////////////////////////////float4 MatDiffuse : Diffuse< string UIName = "Material Diffuse"; string UIWidget = "Color";> = {1.0f, 1.0f, 1.0f, 0.0f};float4 MatAmbient : Ambient< string UIName = "Material Ambient"; string UIWidget = "Color";> = {0.0f, 0.0f, 0.0f, 1.0f};float4 MatSpec : Specular< string UIName = "Material Specular"; string UIWidget = "Color";> = {1.0f, 1.0f, 1.0f, 1.0f};float4 MatEmissive : Emissive< string UIName = "Material Emissive"; string UIWidget = "Color";> = {0.0f, 0.0f, 0.0f, 1.0f};float4 AltMatSpec : Specular< string UIName = "Second Specular"; string UIWidget = "Color";> = {0.0f, 0.0f, 0.0f, 0.0f};//{0.7f, 0.8f, 1.00f, 1.0f};float MatSpecPow : SpecularPower < string UIWidget = "slider"; float UIMin = 1.0; float UIMax = 128.0; float UIStep = 1.0; string UIName = "specular power";> = 40.0;float AltMatSpecPow : SpecularPower < string UIWidget = "slider"; float UIMin = 1.0; float UIMax = 128.0; float UIStep = 1.0; string UIName = "specular power 2";> = 80.0;float refmult : Environment< string UIWidget = "slider"; float UIMin = 0.0f; float UIMax = 2.0f; float UIStep = 0.001f; string UIName = "Reflection Multiplier";> = 0.5f;float fresnel< string UIWidget = "slider"; float UIMin = 0.0f; float UIMax = 100.0f; float UIStep = 0.001f; string UIName = "Fresnel";> = 15.0f;float edgeref< string UIWidget = "slider"; float UIMin = 0.0f; float UIMax = 100.0f; float UIStep = 0.001f; string UIName = "Edge Reflection";> = 2.0f;//global colorsfloat4 sceneambient< string UIName = "Scene Ambient"; string UIWidget = "Color";> = {0.0f, 0.0f, 0.0f, 1.0f};float4 skyrgb< string UIName = "Sky Color"; string UIWidget = "Color";> = {0.5f, 0.75f, 1.0f, 1.0f};////////////////////////////////////////////////////Textures//////////////////////////////////////////////////texture colorTexture : Diffuse < string ResourceName = "default_color.dds"; string ResourceType = "2D";>;texture refcubeTexture : Environment < string ResourceName = "default_reflection.dds"; string ResourceType = "CUBE";>;texture normalTexture : Normal < string ResourceName = "default_bump_normal.dds"; string ResourceType = "2D";>;////////////////////////////////////////////////////Samplers - need to sync filter/addressing w/game//////////////////////////////////////////////////sampler2D colorSampler = sampler_state { Texture = <colorTexture>; MinFilter = <filtermin>; MagFilter = <filtermag>; MipFilter = <filtermip>; AddressU = Wrap; AddressV = Wrap; AddressW = Wrap; MIPMAPLODBIAS = 0.0f; MAXMIPLEVEL = 0; BORDERCOLOR = 0xFF000000;//argb MaxAnisotropy = <maxaniso>;};samplerCUBE envSampler = sampler_state { Texture = <refcubeTexture>; MinFilter = <filtermin>; MagFilter = <filtermag>; MipFilter = <filtermip>; AddressU = Wrap; AddressV = Wrap; AddressW = Wrap; MIPMAPLODBIAS = 0.0f; MAXMIPLEVEL = 0; BORDERCOLOR = 0xFF000000;//argb MaxAnisotropy = <maxaniso>;};sampler2D normalSampler = sampler_state { Texture = <normalTexture>; MinFilter = <filtermin>; MagFilter = <filtermag>; MipFilter = <filtermip>; AddressU = Wrap; AddressV = Wrap; AddressW = Wrap; MIPMAPLODBIAS = 0.0f; MAXMIPLEVEL = 0; BORDERCOLOR = 0xFF000000;//argb MaxAnisotropy = <maxaniso>;};////////////////////////////////////////////////////Structures////////////////////////////////////////////////////Vertex structure from gamestruct appdata { float3 Position : POSITION; float3 UV : TEXCOORD0; float4 Normal : NORMAL; //float4 Binormal : BINORMAL0; //float4 Tangent : TANGENT0;};//data passed from the vertex shader to the pixel shaderstruct vertexOutput { float4 HPosition : POSITION; float3 TexCoord : TEXCOORD0; float3 LightVec1 : TEXCOORD1; float3 WorldNormal : TEXCOORD2; float3 WorldPos : TEXCOORD3; float3 WorldEyePos : TEXCOORD4; float3 Spec2Vec : TEXCOORD5; //float3 WorldTangent : TEXCOORD5; //float3 WorldBinorm : TEXCOORD6;};////////////////////////////////////////////////////Shaders////////////////////////////////////////////////////Vertex ShadervertexOutput mainVS(appdata IN){ vertexOutput OUT; OUT.WorldNormal = mul(IN.Normal, WorldIT).xyz; float4 Po = float4(IN.Position.xyz,1.0); float4 Pw = mul(Po, World); OUT.WorldPos = Pw; OUT.LightVec1 = normalize(-LightDir); OUT.TexCoord = IN.UV; OUT.WorldEyePos = ViewInv[3].xyz; OUT.HPosition = mul(Po, WorldViewProj); OUT.Spec2Vec = normalize(spec2dir); return OUT;}//Bump Pixel Shader no reflectionfloat4 mainPSB(vertexOutput IN) : COLOR{ float4 map = tex2D(colorSampler,IN.TexCoord.xy); float3 Vn = normalize(IN.WorldEyePos - IN.WorldPos); float3 Nn = normalize(IN.WorldNormal); //normal map float3 bumps = tex2D(normalSampler,IN.TexCoord.xy).xyz - (0.5).xxx; Nn = Nn + (bumps.x + bumps.y); //Nn = normalize(Nn); //float3 cbumps = ComputeNormalsPS(IN.TexCoord.xy); //Nn = Nn * cbumps; //Nn = Nn + (bumps.x + bumps.y); Nn = normalize(Nn); //calc light vec float3 Ln = normalize(IN.LightVec1.xyz); float3 Hn = normalize(Vn + Ln); float hdn = pow(max(0,dot(Hn,Nn)),MatSpecPow);// * 1.0f; float ldn = dot(Ln,Nn); ldn = max(0.0,ldn); //blend sun light color float4 diffContrib = ldn * LightColor1; float4 specContrib = (ldn * hdn) * (LightColor1 * MatSpec);//MatSpec //Directx Fixed-Function lighting model float4 ambientlight, diffuselight, specularlight; ambientlight = (MatAmbient * map) * (sceneambient + LightColor1); diffuselight = ((MatDiffuse * map) * diffContrib); specularlight = specContrib * (diffContrib); float4 finalcolor = ambientlight + diffuselight + specularlight + MatEmissive; finalcolor.a = MatDiffuse.a * map.a; return finalcolor;}//Bump Pixel Shader no reflection, no diffuse texfloat4 mainPSB_notex(vertexOutput IN) : COLOR{ float3 Vn = normalize(IN.WorldEyePos - IN.WorldPos); float3 Nn = normalize(IN.WorldNormal); //normal map float3 bumps = tex2D(normalSampler,IN.TexCoord.xy).xyz - (0.5).xxx; Nn = Nn + (bumps.x + bumps.y); //Nn = normalize(Nn); //float3 cbumps = ComputeNormalsPS(IN.TexCoord.xy); //Nn = Nn * cbumps; //Nn = Nn + (bumps.x + bumps.y); Nn = normalize(Nn); //calc light vec float3 Ln = normalize(IN.LightVec1.xyz); float3 Hn = normalize(Vn + Ln); float hdn = pow(max(0,dot(Hn,Nn)),MatSpecPow);// * 1.0f; float ldn = dot(Ln,Nn); ldn = max(0.0,ldn); //blend sun light color float4 diffContrib = ldn * LightColor1; float4 specContrib = (ldn * hdn) * (LightColor1 * MatSpec);//MatSpec //Directx Fixed-Function lighting model float4 ambientlight, diffuselight, specularlight; ambientlight = (MatAmbient ) * (sceneambient + LightColor1); diffuselight = ((MatDiffuse ) * diffContrib); specularlight = specContrib * (diffContrib); float4 finalcolor = ambientlight + diffuselight + specularlight + MatEmissive; finalcolor.a = MatDiffuse.a; return finalcolor;}//Bump Shiny Pixel Shaderfloat4 mainPSBS(vertexOutput IN) : COLOR{ float4 map = tex2D(colorSampler,IN.TexCoord.xy); float3 Vn = normalize(IN.WorldEyePos - IN.WorldPos); float3 Nn = normalize(IN.WorldNormal); //normal map - is tangent space, will need to adjust later float4 bumps = tex2D(normalSampler,IN.TexCoord.xy); //Nn = Nn + (bumps.x + bumps.y); //Nn = normalize(Nn); //expand normal to -1/+1 range and normalize bumps = normalize(2.0f*bumps - 1.0f); //Nn = Nn + (bumps.x + bumps.y); Nn.x = Nn.x + bumps.x; Nn.y = Nn.y + bumps.y; Nn = normalize(Nn); //calc light vec float3 Ln = normalize(IN.LightVec1.xyz); float3 Hn = normalize(Vn + Ln); float hdn = pow(max(0,dot(Hn,Nn)),MatSpecPow);// * 1.0f; float ldn = dot(Ln,Nn); ldn = max(0.0,ldn); //spec2 float3 Ln2 = normalize(IN.Spec2Vec); float3 Hn2 = normalize(Vn + Ln2); //float hdn = pow(max(0,dot(Hn2,Nn)),MatSpecPow);// * 1.0f; //float ldn = dot(Ln,Nn); //ldn = max(0.0,ldn); //float3 Hn2 = normalize(Vn + Ln.xyz);//use camera input float hdn2 = pow(max(0,dot(Hn2,Nn)),AltMatSpecPow); //blend sun light color float4 diffContrib = ldn * LightColor1; float4 specContrib = (ldn * hdn) * (LightColor1 * (MatSpec * 1.0f));//MatSpec float4 spec2 = (ldn * hdn2) * (LightColor1 * (AltMatSpec * 1.0f));//AltMatSpec specContrib += spec2; //reflection map coordinates are flipped and swizzled for GTA float3 refvect = reflect(Vn,Nn); refvect.xyz = refvect.xzy;//this is expensive. it's either this, or multiple lights, but not both (under sm20) //refvect = (refvect * ViewInv); float4 reflColor = texCUBE(envSampler,-refvect.xyz); float vdn = dot(Vn,Nn); float fres = (reflColor * edgeref) * pow(1-abs(vdn),fresnel); #ifdef MASKREF reflColor = reflColor * 1.0f; #endif //Directx Fixed-Function lighting model float4 ambientlight, diffuselight, specularlight; ambientlight = (MatAmbient * map) * (sceneambient + LightColor1); diffuselight = ((MatDiffuse * map) * diffContrib); specularlight = specContrib * (diffContrib) + ((reflColor * refmult) + fres); float4 finalcolor = ambientlight + diffuselight + specularlight + MatEmissive; finalcolor.a = MatDiffuse.a * map.a; return finalcolor;}//Bump Shiny Pixel Shader no diffuse texfloat4 mainPSBS_notex(vertexOutput IN) : COLOR{ float3 Vn = normalize(IN.WorldEyePos - IN.WorldPos); float3 Nn = normalize(IN.WorldNormal); //normal map - is tangent space, will need to adjust later float4 bumps = tex2D(normalSampler,IN.TexCoord.xy).xyzw - (0.5).xxxx; //Nn = Nn + (bumps.x + bumps.y); //Nn = normalize(Nn); Nn = Nn + (bumps.x + bumps.y); Nn = normalize(Nn); //calc light vec float3 Ln = normalize(IN.LightVec1.xyz); float3 Hn = normalize(Vn + Ln); float hdn = pow(max(0,dot(Hn,Nn)),MatSpecPow);// * 1.0f; float ldn = dot(Ln,Nn); ldn = max(0.0,ldn); //spec2 float3 Ln2 = normalize(IN.Spec2Vec); float3 Hn2 = normalize(Vn + Ln2); //float hdn = pow(max(0,dot(Hn2,Nn)),MatSpecPow);// * 1.0f; //float ldn = dot(Ln,Nn); //ldn = max(0.0,ldn); //float3 Hn2 = normalize(Vn + Ln.xyz);//use camera input float hdn2 = pow(max(0,dot(Hn2,Nn)),AltMatSpecPow); //blend sun light color float4 diffContrib = ldn * LightColor1; float4 specContrib = (ldn * hdn) * (LightColor1 * (MatSpec * 1.0f));//MatSpec float4 spec2 = (ldn * hdn2) * (LightColor1 * (AltMatSpec * 1.0f));//AltMatSpec specContrib += spec2; //reflection map coordinates are flipped and swizzled for GTA float3 refvect = reflect(Vn,Nn); refvect.xyz = refvect.xzy;//this is expensive. it's either this, or multiple lights, but not both (under sm20) //refvect = (refvect * ViewInv); float4 reflColor = texCUBE(envSampler,-refvect.xyz); float vdn = dot(Vn,Nn); float fres = (reflColor * edgeref) * pow(1-abs(vdn),fresnel); //Directx Fixed-Function lighting model float4 ambientlight, diffuselight, specularlight; ambientlight = (MatAmbient) * (sceneambient + LightColor1); diffuselight = ((MatDiffuse) * diffContrib); specularlight = specContrib * (diffContrib) + ((reflColor * refmult) + fres); float4 finalcolor = ambientlight + diffuselight + specularlight + MatEmissive; finalcolor.a = MatDiffuse.a; return finalcolor;}//Bump Shiny Pixel Shader sm2float4 mainPSBS20(vertexOutput IN) : COLOR{ float4 map = tex2D(colorSampler,IN.TexCoord.xy); float3 Vn = normalize(IN.WorldEyePos - IN.WorldPos); float3 Nn = normalize(IN.WorldNormal); Nn = normalize(Nn); //calc light vec float3 Ln = normalize(IN.LightVec1.xyz); float3 Hn = normalize(Vn + Ln); float hdn = pow(max(0,dot(Hn,Nn)),MatSpecPow);// * 1.0f; float ldn = dot(Ln,Nn); ldn = max(0.0,ldn); //blend sun light color float4 diffContrib = ldn * LightColor1; float4 specContrib = (ldn * hdn) * (LightColor1 * (MatSpec * 1.0f));//MatSpec //reflection map coordinates are flipped and swizzled for GTA float3 refvect = reflect(Vn,Nn); refvect.xyz = refvect.xzy;//this is expensive. it's either this, or multiple lights, but not both (under sm20) float4 reflColor = texCUBE(envSampler,-refvect.xyz); float vdn = dot(Vn,Nn); float fres = (reflColor * edgeref) * pow(1-abs(vdn),fresnel); #ifdef MASKREF reflColor = reflColor * 1.0f; #endif //Directx Fixed-Function lighting model float4 ambientlight, diffuselight, specularlight; ambientlight = (MatAmbient * map) * (sceneambient + LightColor1); diffuselight = ((MatDiffuse * map) * diffContrib); specularlight = specContrib * (diffContrib) + ((reflColor * refmult) + fres); float4 finalcolor = ambientlight + diffuselight + specularlight + MatEmissive; finalcolor.a = MatDiffuse.a * map.a; return finalcolor;}//Bump Shiny Pixel Shader no diffuse tex sm2float4 mainPSBS_notex20(vertexOutput IN) : COLOR{ float3 Vn = normalize(IN.WorldEyePos - IN.WorldPos); float3 Nn = normalize(IN.WorldNormal); Nn = normalize(Nn); //calc light vec float3 Ln = normalize(IN.LightVec1.xyz); float3 Hn = normalize(Vn + Ln); float hdn = pow(max(0,dot(Hn,Nn)),MatSpecPow);// * 1.0f; float ldn = dot(Ln,Nn); ldn = max(0.0,ldn); //blend sun light color float4 diffContrib = ldn * LightColor1; float4 specContrib = (ldn * hdn) * (LightColor1 * (MatSpec * 1.0f));//MatSpec //reflection map coordinates are flipped and swizzled for GTA float3 refvect = reflect(Vn,Nn); refvect.xyz = refvect.xzy;//this is expensive. it's either this, or multiple lights, but not both (under sm20) float4 reflColor = texCUBE(envSampler,-refvect.xyz); float vdn = dot(Vn,Nn); float fres = (reflColor * edgeref) * pow(1-abs(vdn),fresnel); #ifdef MASKREF reflColor = reflColor * 1.0f; #endif //Directx Fixed-Function lighting model float4 ambientlight, diffuselight, specularlight; ambientlight = (MatAmbient) * (sceneambient + LightColor1); diffuselight = ((MatDiffuse) * diffContrib); specularlight = specContrib * (diffContrib) + ((reflColor * refmult) + fres); float4 finalcolor = ambientlight + diffuselight + specularlight + MatEmissive; finalcolor.a = MatDiffuse.a; return finalcolor;}////////////////////////////////////////////////////Techniques - sm 20//////////////////////////////////////////////////technique VehicleBump20{ pass p0 { #ifdef WIRE Fillmode = wireframe; #endif VertexShader = compile vs_2_0 mainVS(); PixelShader = compile ps_2_0 mainPSB(); }}technique VehicleBump_notex20{ pass p0 { VertexShader = compile vs_2_0 mainVS(); PixelShader = compile ps_2_0 mainPSB_notex(); }}technique VehicleBumpShiny20{ pass p0 { VertexShader = compile vs_2_0 mainVS(); PixelShader = compile ps_2_0 mainPSBS20(); }}//glasstechnique VehicleBumpShiny_notex20{ pass p0 { VertexShader = compile vs_2_0 mainVS(); PixelShader = compile ps_2_0 mainPSBS_notex20(); }}////////////////////////////////////////////////////Techniques - sm 2x//////////////////////////////////////////////////technique VehicleBump2x{ pass p0 { #ifdef WIRE Fillmode = wireframe; #endif VertexShader = compile vs_2_0 mainVS(); PixelShader = compile ps_2_b mainPSB(); }}technique VehicleBump_notex2x{ pass p0 { VertexShader = compile vs_2_0 mainVS(); PixelShader = compile ps_2_b mainPSB_notex(); }}technique VehicleBumpShiny2x{ pass p0 { VertexShader = compile vs_2_0 mainVS(); PixelShader = compile ps_2_b mainPSBS(); }}//glasstechnique VehicleBumpShiny_notex2x{ pass p0 { VertexShader = compile vs_2_0 mainVS(); PixelShader = compile ps_2_b mainPSBS_notex(); }}////////////////////////////////////////////////////Techniques - 30//////////////////////////////////////////////////technique VehicleBump30{ pass p0 { #ifdef WIRE Fillmode = wireframe; #endif VertexShader = compile vs_3_0 mainVS(); PixelShader = compile ps_3_0 mainPSB(); }}technique VehicleBump_notex30{ pass p0 { VertexShader = compile vs_3_0 mainVS(); PixelShader = compile ps_3_0 mainPSB_notex(); }}technique VehicleBumpShiny30{ pass p0 { VertexShader = compile vs_3_0 mainVS(); PixelShader = compile ps_3_0 mainPSBS(); }}technique VehicleBumpShiny_notex30{ pass p0 { VertexShader = compile vs_3_0 mainVS(); PixelShader = compile ps_3_0 mainPSBS_notex(); }} Â Â Â Here is the waters shader of ENB Series ( I may be wrong) : Â Â Â #include "Helpers.fx"//--------------------------------Matrix's--------------------------------float4x4 gmViewProj;float4x4 gmInvView;float4x4 gmView;float4x4 gmProj;float4x4 gmRefl;float3x3 TBN = {float3(1,0,0),float3(0,1,0),float3(0,0,1)};//--------------------------------Textures--------------------------------const texture gtDiffuse;const texture gtDepth;const textureCUBE tRefl;const texture tScreen;const texture tNormalW;const texture tNormalN;const texture tNormalH1;const texture FoamTexture;const texture FoamTexture2;//--------------------------------Vectors---------------------------------float3 g_LightDir ={0,0,1};float3 g_vRight;float3 g_vUp;float3 g_vForward;float3 gvAmbientColor;float3 gvAmbientColor2;float2 WaterScale = { 100, 100 };float4 WaterSpeed = { -0.4f, -0.45f, 0.1f, 0.02f };float3 RefractionColor = {1,1,1};float2 TexScale = { 1.0f, 1.0f };//--------------------------------Scalars---------------------------------float time;float Softness = 0.2f;//--------------------------------Samplers--------------------------------sampler2D gsDiffuse = sampler_state{ Texture = <gtDiffuse>; MinFilter = LINEAR; MagFilter = LINEAR; MipFilter = None; AddressU = Wrap; AddressV = Wrap;};sampler2D gsDepth = sampler_state{ Texture = <gtDepth>; MinFilter = LINEAR; MagFilter = LINEAR; MipFilter = None; AddressU = Wrap; AddressV = Wrap;};sampler TexScreen=sampler_state { Texture = <tScreen>; ADDRESSU = CLAMP; ADDRESSV = CLAMP; ADDRESSW = CLAMP; MAGFILTER = LINEAR; MINFILTER = LINEAR; MIPFILTER = None;};samplerCUBE TexRefl=sampler_state { Texture = <tRefl>; ADDRESSU = CLAMP; ADDRESSV = CLAMP; ADDRESSW = CLAMP; MAGFILTER = LINEAR; MINFILTER = LINEAR; MIPFILTER = None;};sampler TexNormalW=sampler_state { Texture = <tNormalW>; ADDRESSU = WRAP; ADDRESSV = WRAP; ADDRESSW = WRAP; MAGFILTER = LINEAR; MINFILTER = LINEAR; MIPFILTER = None;};sampler TexNormalN=sampler_state { Texture = <tNormalN>; ADDRESSU = WRAP; ADDRESSV = WRAP; ADDRESSW = WRAP; MAGFILTER = LINEAR; MINFILTER = LINEAR; MIPFILTER = None;};sampler TexWaves=sampler_state { Texture = <tNormalH1>; ADDRESSU = WRAP; ADDRESSV = WRAP; ADDRESSW = WRAP; MAGFILTER = LINEAR; MINFILTER = LINEAR; MIPFILTER = None;};sampler FoamT=sampler_state { Texture = <FoamTexture>; ADDRESSU = WRAP; ADDRESSV = WRAP; ADDRESSW = WRAP; MAGFILTER = LINEAR; MINFILTER = LINEAR; MIPFILTER = None;};sampler FoamT2=sampler_state { Texture = <FoamTexture2>; ADDRESSU = WRAP; ADDRESSV = WRAP; ADDRESSW = WRAP; MAGFILTER = LINEAR; MINFILTER = LINEAR; MIPFILTER = None;};struct VS_OUTPUT{ float4 vpos : POSITION; float2 texcoord : TEXCOORD0; float3 wpos : TEXCOORD1; float4 screenpos : TEXCOORD2; float3 viewpos : TEXCOORD3;};struct VS_INPUT{ float4 pos : POSITION; float2 texcoord : TEXCOORD0;};VS_OUTPUT ForwardVS(VS_INPUT IN){ VS_OUTPUT OUT; float4 aPos = float4(IN.pos.xyz, 1.0); OUT.vpos = mul(gmViewProj, aPos); OUT.screenpos = OUT.vpos; OUT.wpos = aPos.xyz; OUT.viewpos = mul(aPos, gmView); OUT.texcoord.xy = IN.texcoord.xy; return OUT;}float4 ForwardPS(VS_OUTPUT IN) : COLOR0{ float4 scrPos = IN.screenpos; scrPos.xyz /= scrPos.w; float3 viewPos = IN.viewpos; float3 normal = mul(IN.wpos,transpose(TBN)); float3 vspReflect = normalize(reflect(normalize(viewPos), normalize(mul(normal,(float3x3)gmView)).xyz)); float3 vspPosReflect = viewPos + vspReflect; float3 sspPosReflect = mul(float4(vspPosReflect, 1.0), gmProj).xyz / vspPosReflect.z; float3 sspReflect = sspPosReflect - scrPos.xyz; float3 vCurrOffset = scrPos + sspReflect ; vCurrOffset.xy = float2(vCurrOffset.x * 0.5 + 0.5,vCurrOffset.y * -0.5 + 0.5); float3 vLastOffset = scrPos; vLastOffset.xy = float2(vLastOffset.x * 0.5 + 0.5,vLastOffset.y * -0.5 + 0.5); sspReflect = float3(sspReflect.x * 0.5 ,sspReflect.y * -0.5, sspReflect.z); int nNumSamples = 16; int nCurrSample = 0; float3 vFinalResult; float vCurrSample; int depthTest = 0; while (nCurrSample < nNumSamples) { // Sample from depth buffer float4 scrPos = mul(float4(tex2Dlod(gsDepth,float4(vCurrOffset.xy,0,0)).xyz,1),gmViewProj); scrPos.xyz /= scrPos.w; vCurrSample = scrPos.z; if (vCurrSample < vCurrOffset.z) { depthTest = 1; // Calculate final offset vLastOffset.xy = vLastOffset.xy + 0.01 * sspReflect.xy; const float blendfact = 0.6; float2 factors = float2(blendfact, blendfact); // Blend //fvTotalDiffuse.xyz = lerp(vFinalResult, fvTotalDiffuse, max(max(factors.x /* linear curve */, factors.y * factors.y /* x^2 curve */), blendfact)); nCurrSample = nNumSamples + 1; } else { ++nCurrSample; vLastOffset = vCurrOffset; vCurrOffset += sspReflect; } } vFinalResult = tex2D(TexScreen,vLastOffset.xy).xyz*depthTest; return float4(vFinalResult, 1.0f);}technique Forward{ pass p0 { VertexShader = compile vs_3_0 ForwardVS(); PixelShader = compile ps_3_0 ForwardPS(); AlphaTestEnable = false; AlphaBlendEnable = false; }}; Â Â Â You should tweak this to make it SA GFX compatible Edited May 22, 2014 by Manfred Von Karma Link to comment Share on other sites More sharing options...
DJThanos Posted May 22, 2014 Author Share Posted May 22, 2014 I saw a vid on YouTube, with someone playing sAMP with SA GFX mod, he only saied he made the .dll load like .asi. I attempted to change extension to .asi, but game crashes. I don't want having real-time reflections only in singleplayer, with my setting they are cool Link to comment Share on other sites More sharing options...
Shmoopy Posted May 22, 2014 Share Posted May 22, 2014 Check this out : http://forum.partyserver.us/index.php?topic=11884.0DexX is the author of SA GFX , he said: I'm curious to know what he did as well. With the current version i'm working on (see my sig) i can only get into an SAMP game if i disable part of the mod, which essentially breaks it - the vehicles are black, i have Z fighting issues, etc. It's not pretty. There isn't any SAMP code i can find (looks like it's not open source) so i'm doing what amounts to trial and error.Btw, what are the reasons / gfx effects you use SAGFX for? Not a wishlist of what you want to see, but why you installed it already. Link to comment Share on other sites More sharing options...
DJThanos Posted May 22, 2014 Author Share Posted May 22, 2014 I'm bad at editing files like this Link to comment Share on other sites More sharing options...
DJThanos Posted May 22, 2014 Author Share Posted May 22, 2014 IS there any way to edit the .dll, so it's compatible with SA:MP? Link to comment Share on other sites More sharing options...
DJThanos Posted May 26, 2014 Author Share Posted May 26, 2014 Guys anymore help? 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