Closed ttmso closed 1 year ago
yeah
i have both the menu.lua thing and the bin file
oh shit, im a idiot
oh no, oh no not you again https://user-images.githubusercontent.com/93525030/223705010-045626dd-23b7-4397-b5ae-9dfbe0de4c34.mp4
so i got rid of all the addons and checked the verify integrity of game files, and still doesn't work...
i don't have a way to reproduce, so i've no idea what could cause it
ok ):
so i factory reset gmod and now it works (: and i made this:
i just copied the soble shader and then changed some shit and boom, code:
shaderlib.CompileVertexShader("SobelOperatorVertexShader", 0, [==[
struct VS_INPUT { float4 vPos : POSITION; };
struct VS_OUTPUT { float4 projPosSetup : POSITION; };
VS_OUTPUT main( const VS_INPUT v ) { VS_OUTPUT o = (VS_OUTPUT)0;
float4 vProjPos = mul( v.vPos, cViewProj );
vProjPos.z = dot( v.vPos, cViewProjZ );
o.projPosSetup = vProjPos;
return o;
}
]==])
shaderlib.CompilePixelShader("SobelOperatorPixelShader", 0, [==[
sampler FrameBuffer : register(s0); float3 SBColor : register(c0);
struct PS_IN { float2 P : VPOS; };
float4 main(PS_IN i ) : COLOR { float4 pixel = tex2D(FrameBuffer, i.P/float2(1920, 1080)); // float4 pixel = PARAM_COLOR
// float4 color = pixel/sin(i.P.x/100);
float4 color = float4(1-pixel.x, 1-pixel.y, 1-pixel.z, 1);
return color;
};
]==])
also im wondering if you can make it so a time var is in it, i want to make a procedural pulse effect
also the sun is a black hole wtf
lol villager hmmm
code:
if !EGSM or !(EGSM.Version > 0) then return end -- DON'T FORGET TO CHECK
local function CompileShaders()
shaderlib.CompileVertexShader("SobelOperatorVertexShader", 0, [==[
#include "common_vs_fxc.h"
struct VS_INPUT
{
float4 vPos : POSITION;
};
struct VS_OUTPUT
{
float4 projPosSetup : POSITION;
};
VS_OUTPUT main( const VS_INPUT v )
{
VS_OUTPUT o = (VS_OUTPUT)0;
float4 vProjPos = mul( v.vPos, cViewProj );
vProjPos.z = dot( v.vPos, cViewProjZ );
o.projPosSetup = vProjPos;
return o;
}
]==])
shaderlib.CompilePixelShader("SobelOperatorPixelShader", 0, [==[
sampler FrameBuffer : register(s0);
float3 SBColor : register(c0);
struct PS_IN
{
float2 P : VPOS;
};
float4 main(PS_IN i ) : COLOR
{
float4 pixel = tex2D(FrameBuffer, (i.P+float2(sin((i.P.x/16))*16, sin((i.P.y/16))*16))/float2(SCR_W, SCR_H));
float4 color = pixel/float4(1, 1.25, 1.25, 1);
return color;
};
]==])
end
CompileShaders()
local shader = shaderlib.NewShader("SobelOperator")
shader:SetPixelShader("SobelOperatorPixelShader")
shader:SetVertexShader("SobelOperatorVertexShader")
shader:BindTexture(0, PARAM_BASETEXTURE)
local SBColor = shader:AddParam("$SBColor", SHADER_PARAM_TYPE_COLOR)
shader:SetPixelShaderConstantFP(0, SBColor)
local mat = Material("lucman/test_shader")
local screentexture = render.GetScreenEffectTexture()
hook.Add("RenderScreenspaceEffects", "SobelOperator", function()
render.UpdateScreenEffectTexture()
render.CopyRenderTargetToTexture(screentexture)
render.SetMaterial(mat)
render.DrawScreenQuad()
end )
hook.Add("RecompileShaders", shader:GetName(), CompileShaders)
omg steve is dead
also im wondering if you can make it so a time var is in it, i want to make a procedural pulse effect
shader:SetPixelShaderStandardConstant(index, STDCONST_CURTIME)
nice
is there a depth buffer too?
oh good idea: make a discord server where people can show what they made and ask how to do things like me
is there a depth buffer too?
_rt_ResolvedFullFrameDepth
oh good idea: make a discord server where people can show what they made and ask how to do things like me
so i made the vmt but idk where to put the lua file, in autorun/client?