#[Archive] The Shader Hole

1 messages · Page 2 of 1

jovial tide
#

check for dxlevel < 95

cosmic perch
#

would that still work for intel tho?

jovial tide
#

yes

#

intel cards are forced to 90

cosmic perch
#

thats weird, svetov telling me that he had intel gpu working fine with sm 3.0

#

on linux

jovial tide
#

thats linux

cosmic perch
#

welp it wouldnt hurt

jovial tide
#

if you ask rubat nicely he could fix it

#

it requires 1 line of c++ change and 1 line to edit a .cfg file

cosmic perch
#

lemme make an issue for it and include a screenshot of what u said

jovial tide
#

specifically the check for intel to force disable SM3 in CShaderDeviceMgrDx8::ComputeCapsFromD3D needs to be removed

#

and dxsupport.cfg needs the entry for "Intel Unknown" have its MaxDxLevel changed to 95

cosmic perch
#

🥹

jovial tide
#

this has been tested in other source games by patching the check out and sm3 does indeed work on windows intel

#

its likely a leftover from the 2000s era where intel had bad sm3 support

cosmic perch
#

do u think i would still need to have a fallback to sm 2?

#

i have been searching around and most pcs now support sm3

jovial tide
#

you'll have to conduct an experiment on real servers

#

query everyone's dxlevel and see how many people are on dx 95

#

i dont know if u can also check what card they have in lua

cosmic perch
#

there was a way by reading crash dumps ig

#

i dont have a server but i can just one of my addons to collect that

#

i might just do the fallback thing just to be in a safe zone

jovial tide
#

well until (or if) rubat adds the intel fix, you will need a fallback

cosmic perch
#

thank you for ur great work again ❤️ ❤️

cosmic perch
#

i forgot that im not using length/fwidth for AA anymore lol, but i cant do blur without sm 3.0

#

i need i.pos

#

i will just compile rounded stuff using sm2.0 and blur can be ignored on non sm3.0 targets

cosmic perch
#

@jovial tide i have updated the process_shaders.ps1 to automate the versioning

#

a step i was gonna do is instead of using compile_shader_list.txt to compile list of files, is just have a directory path passed to it and just process all files that have hlsl ext

jovial tide
#

thats similar to what ive done already

cosmic perch
#

oh thats nice

jovial tide
#

there is no reliance on the file suffix anymore as well

#

and the powershell dependency is removed

cosmic perch
jovial tide
#

its passed as a flag to the shader compiler

#

-ver 30 or -ver 20b

cosmic perch
#

why not just detect the version off the file suffix?

#

oh nvm

#

i understand

#

previously it required both ye

jovial tide
#

so you dont have to make duplicate files for compiling both ps20 and ps30

cosmic perch
#

yeah good one

#

having fallback to sm2 without i.pos will be p much impossible lol

snow cradle
zinc sedge
#

reflectivity?

#

what is this

snow cradle
zinc sedge
#

cool

#

you're doing this with the screenspace general shader?

snow cradle
#

But it should work

zinc sedge
#

are compute shaders possible with screenspace general?

snow cradle
glossy sorrel
# zinc sedge are compute shaders possible with screenspace general?

Probably.
But data loading and unloading will eat all your CPU resources, since you can't access frame buffer data directly, nor load said data efficiently in said buffer.

You can kinda write data by loading images (png, jpg, etc) as textures, or by generating uncompressed RGBA8888 vtfs and then loading them instead.
Or by directly rendering something in RenderTarget that has point sampling.

To read the data, you'd have to call render.Capture and then waste your resources by decoding png/jpg, or by using render.CapturePixels and render.ReadPixel, which also has really really big performance impact.

#

Also, you don't have access to the memory synchronisation primitives such as barriers.
And you don't have any way of storing "local" variables per work group.

wispy birch
#

pretty please

misty surge
#

We can update to the L4D2/CSGO constants support (extra 4 floats) and I’d be happy!

glossy sorrel
#

We can have EGSM incorporated in Garry's Mod.
Everyone will be happy then!

snow cradle
#

Could you share the parallax cubemap code?

snow cradle
#

how to write matrix const float4x4 g_ObbMatrix from lua???

snow cradle
#

i need help

#

@jovial tide

cosmic perch
#

no help for u

snow cradle
#
local function CreateTransformationMatrix(entity)
    local maxs = entity:OBBMaxs()
    local mins = entity:OBBMins()
    local center = entity:OBBCenter()

    --[[local x = Vector(maxs.x - mins.x, maxs.x, 0)
    local y = Vector(0, maxs.y - mins.y, 0)
    local z = Vector(-200, 0, maxs.z - mins.z + 200)]]

    local x = Vector(maxs.x - mins.x, maxs.x, 0)
    local y = Vector(0, maxs.y - mins.y,  maxs.x)
    local z = Vector(mins.z, maxs.z, maxs.z - mins.z)

    x:Normalize()
    y:Normalize()
    z:Normalize()

    local matrix = Matrix()
    matrix:SetForward(x)
    matrix:SetRight(y)
    matrix:SetUp(z)
    matrix:SetTranslation(center)

    matrix:Invert()



    return matrix
end
snow cradle
#
local pos = Vector(0.0, 0.0, 62.031250) 

local function CreateTransformationMatrix(entity)
    local maxs = entity:OBBMaxs()
    local mins = entity:OBBMins()

    local sizeX = (maxs.x - mins.x)*0.5
    local sizeY = (maxs.y - mins.y)*0.5
    local sizeZ = maxs.z - mins.z

    local matrix = Matrix()
    matrix:Identity()
    matrix:Scale(Vector(sizeX, sizeY, sizeZ*0.656))
    matrix:SetTranslation( pos )
    matrix:Invert()

    return matrix
end
#

float distance = min( furthestPlane.x, min( furthestPlane.y, furthestPlane.z ) );

bronze epoch
#

Youre gonna be my hero

misty surge
#
#

View matrix for the player, with translation. So I assume ViewModel but idk if it’s uh View projection

snow cradle
misty surge
#

Pure Viewspace. No Vertex data. I'm so hyped. Completely 3D.

cosmic perch
#

what the fuck

#

we can reach the moon now

#

source pls so we can learn how u do this tech

misty surge
#

Still a lot to fix up. Screenspace doesn’t properly let you do a lot of things. Like passing a fragpos, I have to use an extra texcord. View matrix is fed into the shader instead of using screenspace translations. Maybe when it’s a bit more ready, I don’t see why not.

cosmic perch
#

leave it on git and let us see how u deal with these issues *-*

#

im too scared to play with VS_OUTPUT/PS_INPUT

#

not sure if anything fuckery will happen if i do that

misty surge
#

Nah, it’s all about being wrong, until you’re right. Spent a week on this, the original method I scrapped due to unrealistic behavior.

cosmic perch
#

all info we have now will be dead for new people

#

forums would have been awesome ;-;

misty surge
#

yup, those days were awesome.

cosmic perch
#

@raw sand ur done

raw sand
cosmic perch
#

NO MORE CARING ABOUT IT HEAVY

#

🔫 🔫 🔫 🔫 🔫 🔫 🔫 🔫 🔫 🔫 🔫 🔫 🔫

snow cradle
#

😎😎😎😎😎
small success. I've given up on matrices (for now, but I'll still need to adapt the rotations, since this thing only works with 90 degree rooms for now)

raw sand
#

magician

snow cradle
cosmic perch
#

make a mirror room mate

#

@snow cradle @snow cradle @snow cradle @snow cradle @snow cradle @snow cradle @snow cradle

raw sand
#

make sir alonnes arena 🗣️

snow cradle
livid cliff
#

Could these shaders be used to recreate source water fog? I need a way to have moving water that also has reflections and refractions that doesn't require RenderView

snow cradle
snow cradle
#

SSLR needs to be combined with other reflections, otherwise the picture will move away.

livid cliff
#

I have absolutely no idea what this means harold
It seems I will have a lot to learn if I want to actually make this

snow cradle
snow cradle
livid cliff
#

It would need to be a 1:1 (or at least close enough to a 1:1) recreation of "expensive" source water

misty surge
#

I know the lighting doesn't make any sense but:

#

Came out pretty nice.

#

Fixed it

#

Call it a night, tm probably will work on some other planets perhaps.

#

Do some basic depth map, shouldn't be too hard.

snow cradle
#

100% image?

#

And do u have custom lua ViewProj?

snow cradle
snow cradle
graceful lynx
zinc sedge
# snow cradle

are you going to have screen space reflections layered on top of parallax corrected cubemaps?

#

so like, the screen space reflections take visual priority over the cubemap where possible

#

and when you're not able to see the windows in screen space then it'll show the cubemap windows

snow cradle
misty surge
#

After my long deserved sleep, here’s how it works:

I calculate the view rays casted by screen space, these would be the edges of the projection matrix. I translate the the rays using a simple Inverse View matrix I made in lua.

Then I bake all of this data into the 3D planets, so they don’t use traditional Verticies, instead they’re generated via the fragment shader. Pure Screenspace shader, no 3.0 here.

#

The only verts being casted is the 4 edges in the screen quad I draw.

#

I have access to the planets normals, and stuff as I would had I used the vertex soup from say a sphere itself.

misty surge
misty surge
#

If I had shader 3.0. Oh man, I’d be so happy. Unlocks so much more power.

cosmic perch
#

we already have sm3?

livid cliff
#

Isn't it like un-available on x86-64 rn because the changes to the shader were reverted due to Linux crashing or smth

cosmic perch
#

fuck x86

#

oh wait

#

fuck linux too

misty surge
#

Ray marching since 2.0 vs using 3D textures. We’ll see.

misty surge
snow cradle
#

Did you know that screen space shaders don't support lightmaps?

#

We simply will not be able to add their support to shaders for brushes or models

misty surge
#

I did not! Huh wow

#

Have you tried looking at the +mat_mat list or w.e. It’s called for the rendertargets?

snow cradle
#

SSGI + Bilinear Filtering

snow cradle
#

SSGI 32 -> 12 samples (more fps & no noise)

misty surge
#

You think I should put in a request to add 3.0 shaders option into screenspace, it would be lit.

#

Lmk

#

Lol

cosmic perch
#

we have sm3

#

go on dev branch

#

it doesnt work on x86-64

#

check how i do it here, ive taken the thing for vertex shader from this one

#

thats why we need forums!!!!

short dirge
#

what we need is long standing issues forcing people to be on -64 to be resolved

#

namely, merging 64bit to main

raw sand
#

i think that servers should start having a popup that says "hey, psa, switch to 64 bit" on join

#

if enough servers do it

#

we can annoy people into changing numbas

cosmic perch
#

rubat wouldnt care lol

#

64 is more trouble for him and its prob annoying to have to deal with 3 branches

short dirge
#

i hate having to switch to 64 just for hammer++ to work at all

livid cliff
#

He has to deal with three branches and the occasional nonsense that comes from Linux lol

misty surge
#

Fog and some clouds using 3D textures. I wanna make em actually 3D.

#

I stand corrected, 3.0 works

cosmic perch
#

is it all math drawn or has textures

misty surge
#

only 4 textures

cosmic perch
#

how do u supply them to the shader?

misty surge
#

I only use 3 actually.

#

Screenspace

#

$c0_x,y,z,w.... $c0-3 BUT 4 is only L4D. IDK WHY

#

& portal 2

#

Or was it CSGO idk

#

Per planet

#

so in theory I can probably get away with having any amount as long as I have a material to back it up.

#

3.0 needs another compiler flags, but it's worth noting I can push my Parallax mapping up to 128 without issues. Since I got a lot of that working, I'll probably start implementing actual volumetic clouds.

cosmic perch
#

what other compiler flags, i just pass the -ver as 30

#

check rndx on how i do it, i made it p easy to compile with multiple versions too

#

thats what the other empty textures for lol

raw sand
#

very nice srlion

cosmic perch
errant nacelle
#

why did you hide my pfp on the rndx github page

cosmic perch
#

its an easter egg hehe

#

basically it means circles dead

#

👍

#

🔫

errant nacelle
#

also this is false

#

you can have over 300 new circles per frame and only lose like 50 fps

cosmic perch
#

its drawpoly perf notu

#

that 50 fps is a lot

#

i know it wont happen

errant nacelle
#

down from 600 :v

cosmic perch
#

but old pcs will actually have an impact from drawpoly

#

and u got no AA

#

🔫

errant nacelle
#

I do if you enable aa in game settings :^)

cosmic perch
#

currently because i have no way to batch setfloat calls, its as fast as drawing an image

raw sand
cosmic perch
#

no it doesnt work anymore

#

changing AA in settings literally does nothing

errant nacelle
#

how did they break aa

cosmic perch
#

thank god

#

i thought i was fucked in my head

#

because i was sure that changing AA does affect drawpoly

errant nacelle
#

it 100% use to

cosmic perch
#

if u can test it to confirm

#

because ive tested everything and it doesnt work

#

im sure because i was checking how drawpoly would look like in high aa

#

we can still do msaa with shaders lol

errant nacelle
#

drawpoly definitely has aa

cosmic perch
#

did u test it

errant nacelle
#

testing it rn

cosmic perch
#

ok

#

show results

errant nacelle
#

were you rendering in a none aa hook or some shit

#

some of them don't have aa

cosmic perch
#

hudpaint

#

and panel:Paint

errant nacelle
#

they don't have aa 😭

cosmic perch
#

see

#

i was going insane, when i was making sam i was checking how it looked with and without

errant nacelle
cosmic perch
#

wait they do?

errant nacelle
#

I'm pretty sure Panel:Paint should have aa but HUDPaint definitely doesn't

cosmic perch
errant nacelle
#

that's in PostRender with cam.Start2D

cosmic perch
#

oh

#

panels dont too

errant nacelle
#

PostRenderVGUI has aa too so idk why vgui wouldn't have aa

cosmic perch
#

🤔

#

wtf

snow cradle
misty surge
#

Looks amazing

#

Where’s the trash can tho?

snow cradle
errant nacelle
#

pick up the can

graceful lynx
obsidian merlin
misty surge
#

Volumetic clouds WIP RN, debugging some stuff. But this is a great result for now.

hollow arrow
#

Btw sit i was wondering is it costless or not to put all my UI into that ?

hollow arrow
cosmic perch
#

nope

hollow arrow
#

Cause all my UI look bad

cosmic perch
#

that shader is really fast

hollow arrow
#

Hmm good to know I’ll look at that thanks sir

snow cradle
cosmic perch
#

counter strike!!

snow cradle
#

SOURCE

misty surge
#

@jovial tide How many max samplers can we produce for screenspace? Is it only 4? D:

jovial tide
#

4 texture samplers

misty surge
#

sampler3D route then I suppose.

snow cradle
#

I really want to have at least 5 textures 🤓 and 32 floats

#

for adding 4x4 matrix + other values

snow cradle
#

Parallax on PP Snow v2 (+bumps + speculars + ao)

dusty linden
#

very nice

snow cradle
snow cradle
#

Point light shader (start)

snow cradle
graceful lynx
#

How does a point light cast shadows in all directions?

#

Surely it's not just many spot lights facing in different directions

snow cradle
#

or 6 ortho cams

#

i wanna make 2 with 180

#

idk how better

#

||1 with 360° ||

graceful lynx
snow cradle
#

is it is 60° cameras

#

also i think they can use 1 matrix ViewProj. All 6 cameras

graceful lynx
#

The wider the FOV, the more the image will be distorted around the edges, right?

#

So more renders with lower FOVs will be better

snow cradle
#

🤔

graceful lynx
#

That's true

#

I have no idea how it can be fixed

snow cradle
# graceful lynx I have no idea how it can be fixed
  1. In fact, you can only render the view from the nearest cameras.
  2. You can only render those cameras that have noticed movement - calculation in LUA
  3. Cameras can be rendered in turn in their frame. Each fps, different cameras are updated. And so on in turn.

If the camera is not updated, the shadows will remain. New ones simply will not appear.

These methods can be combined.

zinc sedge
snow cradle
graceful lynx
snow cradle
#

we need to capture exactly 360, no more, no less

snow cradle
graceful lynx
#

But forward and right are 90° apart

#

So wouldn’t you want a 90° fov?

snow cradle
#

and how many camera i need with 90 fov?

#

4?

#

@graceful lynx

graceful lynx
#

4 for horizontal, then 1 for up and 1 for down

snow cradle
#

360/90=4

#

i think 4 cameras must be as "X"

graceful lynx
#

Right

#

No matter from which side you view, it looks like an X of camera frustums pointing out from the center

snow cradle
zinc sedge
#

I've made a similar thing to a cubemap before with 6 views making up a cube and the fov needed to be 90° to look correct

snow cradle
zinc sedge
#

are you doing something like this but for some kinda shadow mapping?

zinc sedge
snow cradle
#

I will render each camera separately and add up the shadow results

zinc sedge
#

is it a cube of views at all?

zinc sedge
snow cradle
# zinc sedge you mentioned "cubeTexture" so I'm curious what this is

the cube will not be assembled. there will be 6 separate shadow map textures. Which will give 6 shadow results.

Or 2 cameras at 180. I don't know yet. Although it is possible to assemble a cube texture. It is difficult to think about this, since the approach changes dramatically depending on the number of cameras.

Especially considering that the VCS has a limit of 4 textures. All this devilry will have to be broken down into several shaders and compiled

#

cube texure like cubemap

snow cradle
#

I don't know which approach to choose, how best to implement it

#

I'll make 2 cameras of 180° and fuck it

zinc sedge
#

since each view is presumably 90° from each other

snow cradle
zinc sedge
#

every view should have the same position. From my understanding anyways

#

when I've made a cubemap like thing before, that's how it worked and it looked good

snow cradle
#

yea it must be 90°. i l read it on forums

snow cradle
#

@misty surge how to create radial fog

#

Is Radial Fog a Post Processing?

#

And then it is worth disabling the old fog, and tying the current functions to the new fog? (rewriting standard functions)

#

Overall, it would be possible to add even more functions to the fog. But the fog would also have to be created in a 3D skybox.

#

It would also be possible to add some unique features to the fog shader and make it more beautiful.

#

Surely a lot of technologies have already been invented before us.

#

It's worth looking at what's on the internet about shaders and fog effects.

#

Maybe we can make fog using 3d textures ??

#

Or make color gradient for fog

#

Also we can mix fog color and sun color using sun direction

#

Better fog

misty surge
#

Currently went with Ray marching, it's unfortunate that the effect is limited due to how it's being rendered.

#

I'd add more detail, but eventually my shader won't load.

wispy quartz
snow cradle
keen coral
#

PP radial fog base for @snow cradle

snow cradle
dusty linden
#

looks great

misty surge
#

Ooo niceee

#

Which 3D texture did you use?

misty surge
#

Nice! Ok. Thank you. Ima look into fixing the clouds when I’m not at work (1:00am - 6am ;-;)

snow cradle
#

Radial fog shader test ft. @keen coral

misty surge
#

First one looks better

#

Both 🔥

snow cradle
snow cradle
#

how to make texured fog? can i use perlin noise?

errant nacelle
#

flow field perlin noise would look cool

snow cradle
#

idk how to use tex3D perlin noise on fog shader

#

what is float3 texcoord for tex3D on fog shader

#

i l try use worldpos as float3 texcoord

#

and mul result to FogFactor

snow cradle
#

test render 3d texture

snow cradle
#

just first try

graceful lynx
#

Is there a wind direction built into the Source engine already?

#

It would be very cool if the direction of movement for these kinds of effects was in sync with other effects like vegetation blowing in the wind

errant nacelle
#

stormfox support when

graceful lynx
#

Stormfox does definitely have a wind direction concept

errant nacelle
#

only reason I suggested a flow field was because of wind

#

you could add some pretty cool convection currents too

misty surge
#

Do we have access to the geometry shader? I don’t know if there’s an option, but this would be nice, if we had that on screen space.

misty surge
#

Apparently not. Dx11 tho

snow cradle
heavy blade
#

hi shader guys

#

ok, my work here is done, I don't understand shit about shaders, have fun! :D

misty surge
# heavy blade

What’s this? Shader replacements? For not just Screenspace?

heavy blade
#

I have no idea, you can override shaders

neat terrace
#

ahuh

misty surge
#

If there’s a way without using EGSM, I’d like to know asap how.

elfin plover
#

That's for when you're compiling the SDK

#

Don't think it's going to be much help for what's being done here

misty surge
#

Finally fixed my fog

#

Looks nicer inside the atmosphere too. More realistic.

#

Still gotta fixup the parallax and raymarching on the terrain.

misty surge
#

Fixed exterior view. Looks epic! 😄

snow cradle
#

yoooo

misty surge
leaden wasp
#

beeee

misty surge
snow cradle
#

yo

bronze epoch
#

Blue marble

misty surge
graceful lynx
#

OKAY

#

Anyone got a good first-time setup guide?

#

A "Hello World" type shader example?

vapid reef
neat terrace
#

we can now load from the garrysmod/shaders/*.vcs dir
does this change anything in vmts?

icy plume
#

I’ve been trying to understand this from an end user perspective. How do these shaders work and how would one apply them? Would it be a master vmt that loads the shader for you to use in other vmts?

vapid reef
#

look at the resource i sent

#

they explain everything

#

for more directed questions you can ask them but for general "how does it all work" those resources suffice

icy plume
#

Thanks, will do

cosmic perch
#

u need to add what u want to compile in compile_shader_list.txt with the version and define ur stuff in src

jovial tide
cosmic perch
#

@jovial tide do i need to worry about the bug for 2d/ui?

neat terrace
#

what happens with the bug :?

jovial tide
#

which bug

#

oh

#

depth testing isnt relevant for UI

#

this is only for 3d geometry

cosmic perch
#

ok nice as i would hate to rewrite what i wrote

#

can just do now:

rndx_rounded_1_psxx.hlsl -v-20b -v-30
misty surge
#

If you’re using screenspace and you need depth correctly displayed, I believe (might be wrong) the DepthWrite shader will need to include your mesh you’re rendering since screenspace doesn’t have a depth pass.

#

Or a very non existent one.

#

@jovial tide When you write out your example, maybe try to also show us how to use DepthWrite as well, since it’s very useful, but not documented.

jovial tide
#

you should not be needing depthwrite

neat terrace
#

oh cool, i should be alright then
im just blending a bunch of textures together :)

misty surge
jovial tide
#

yes

#

a generic custom shader would be a lot more powerful

#

and support 8 textures, lightmaps, hardware skinning... and so on

misty surge
#

Jeeze my heart stopped after you said that.

#

Sounds amazing.

#

Keep up the great work brother. Wouldn’t be here without your help.

exotic willow
errant nacelle
#

make a new shader.* library that's just surface.* remade with shaders

cosmic perch
neat terrace
#

i heard people being limited to a certain number of opcodes/operations in their shaders; does this still happen?

cosmic perch
#

@agile turret would u accept a replacement for draw.RoundedBox using shaders?

glossy sorrel
exotic willow
glossy sorrel
#

SM2 - meh, but enough.

neat terrace
cosmic perch
#

my lib will literally be just 1 file include, no steps, no anything, just one file include

errant nacelle
#

do shaders work with stencils

cosmic perch
#

i wanted to test that really, maybe @jovial tide could tell

#

every time i would test it, i would be really busy

exotic willow
cosmic perch
#

its a low chance that he would add it tbh, he doesnt want to deal with any issues for a heavy used function

glossy sorrel
cosmic perch
#

he could accept it as a new function, we dont know if shaders will have same behaviour of draw.roundedbox or not, so a weird behaviour that user depends on, will just break

glossy sorrel
#

Also, SM3 supports loops, so that they do not unroll themselves and do not eat up all your limits.

cosmic perch
#

if u can wait for me to polish rndx and then u create a simple version out of it, i wouldnt mind

exotic willow
glossy sorrel
cosmic perch
glossy sorrel
exotic willow
#

Sounds like an old granny's behavior

cosmic perch
#

u dont want to break old addons just to have fancy smooth/faster drawings tbh

cosmic perch
#

idk, but u will surely mess up one shitty addon

#

it wouldnt hurt if u just make a wrapper on top of rndx for ur own server

cosmic perch
glossy sorrel
# exotic willow How?..

For example, user expects that rounded box will affect whole rectangle when rendering trough stencil.
And now, with shaders, it affects expected region where pixels were actually changed.

glossy sorrel
cosmic perch
#

unless u have versions locked

#

thats why i make my libs use a local table, so if someone uses a higher version, it doesnt break ur addon which uses an old version

exotic willow
cosmic perch
#

i can also freely do breaking changes as old scripts will keep functioning

exotic willow
#

Well, just wait for reply about replacement

cosmic perch
#

if u have a server, dont wait for it and replace it already

exotic willow
cosmic perch
#

just wait for my polish tho, i just need to finish remaking goobie-mysql first sad

glossy sorrel
#

Also, yeah.
Now I can do something like shell texturing. Finally.

glossy sorrel
#

It still will be rendered using VertexLitGeneric.
But alpha values and multi-texture blending. Oh boy.

exotic willow
glossy sorrel
exotic willow
glossy sorrel
#

My implementation do not support uv offsetting and scaling.

exotic willow
#

Well, need to replace Glitch effect with shader one, i think?

cosmic perch
#

where is ur implementation @glossy sorrel betch

glossy sorrel
cosmic perch
#

see i told ya, a betch

glossy sorrel
#

9(9(9(((9((((((((99(((9(

cosmic perch
#

SHARE IT

#

we need as much shaders out so people can learn

#

and see different implementations

glossy sorrel
# cosmic perch SHARE IT

I will.
But first I have to settle a business with physics engines and C.
It eats me from within.

cosmic perch
#

haha

glossy sorrel
#

luajit is no fun when trying to interface with libraries without adequate C api.

cosmic perch
#

are u detouring luajit internal functions or just the lua c api

glossy sorrel
#

Btw, tcc helps a lot with all of this.

cosmic perch
#

oh fuck ffi

#

are u using meta's ffi? last time i tried it, was slow to use

#

unless using raph's version that compiles with ffi lol

exotic willow
graceful lynx
exotic willow
graceful lynx
restive spade
#

is there any examples of using screenspace_general with shaders meant to be used on 3d meshes with depth testing?

jovial tide
#

depth testing is broken, im going to forward a fix

restive spade
#

alright, awesome!

shadow shuttle
#

nice
boy why you so half life water

bitter oriole
shadow shuttle
#

oh darn

bitter oriole
#

@jovial tide will more examples be posted today?

shadow shuttle
#

the waves go up and down in your shader right

bitter oriole
#

I need to find an example on how to manipulate the vertexes

shadow shuttle
#

Ah aight

dusty linden
#

🐴

short dirge
misty surge
#

Still WIP shader stuff.

sacred jackal
#

Someone got a example on how to use the shader on a model?

#

Idk if i did this correct but this is the shader vmt

screenspace_general
{
    $pixshader "example_ascii_ps20"

    $basetexture "loading_test/loading_test/waist_belt_med_ge_mtx75c01_u_d"
    $texture1    ""
    $texture2    ""
    $texture3    ""
 [Striped, nothing changed]

And this the model texture:

"VertexLitGeneric"
{
    $model "1"
    $nocull "1"
    $vertexcolor 1

    $basetexture "effects/shaders/example_ascii"

    $softwareskin 1
    $translucent 1
}
timid pumice
#

It doesn't work like that, basetexture takes a texture, not a material as parameter

sacred jackal
#

oh

#

sorry

wispy quartz
sacred jackal
icy plume
#

would it be useful to have some kind of shader tag for the workshop? 🤔

#

would make it far easier to find everything shader related on the workshop whenever that time comes

shadow shuttle
#

that would be helpful really helpful

sacred jackal
dreamy grail
#

💀

sacred jackal
#

yeah, somehow the shader is only affecting some parts of it ❓

misty surge
#

Plus, it won’t appear like it would on the screen because of the translations.

sacred jackal
#

hmm okay

misty surge
#

What you can do most likely is if you want that texture to work, you may have to try a simple box first, so you can see how it distorts

#

Basically your UVs may be too small. So having a test box to see what/how it works, is a good start.

bitter oriole
#

I decided to use imesh to make the "goldsrc water effect" combined with the "wave" pixel shader.

shadow shuttle
#

woo wake up waves dropped

heavy blade
misty surge
shadow shuttle
#

replace the green goop with a normal water texture

graceful lynx
#

MKA0207: “I faithfully recreated an old effect!”
This chat: “What if you did something completely different?”

shadow shuttle
#

use the remover tool on this guys house

misty surge
#

The sun wip

#

Next is uh... Black holes and I'm done with this for now.

#

Can start implementing this into the game I have setup finally...

#

You can barely see these planets, but there's 9 of em. The sun is huge a.f.

dusty linden
#

Hmm. Planet LOD?

misty surge
#

The sun is actually bigger at like earth x 189~ So essentially would take half of the entire render pipeline tbh, but the planet's are actual ratios.

#

For complex planets, sure like earth, I have a distance check in the shader itself.

#

As well as front vs back rendering

#

Like behind screen, don't draw.

#

At that distance.

#

Earth uses volumetric clouds. So yeah, it'll be a bit more but I'm sure after I can totally optimize the performance.

#

Each planet is 8k textures, Depending on what I can do, maybe increasing resolution perhaps may tank performance, but higher detail would look even better.

vapid reef
misty surge
#

It does have raymarched and parallax. If I could push an extra buffer (using samplers for: framebuffer, planet color, heightmap, & 3d clouds (limited to 4??? D:<)) but maybe I could throw the bump map into the heightmap and split it up horizontally?

#

If I could change the $frame and check inside the shader, that would be cool but I don't know how to do that. VTFs with seperate frames may only be material specific.

vapid reef
#

only way is to provide it as a parameter, consider shaders as pure functions

misty surge
#

I also have a night texture too on hold which is another buffer I'd like to have. But perhaps I can sprite sheet it, and setup a system at least for earth.

#

I need at least 2 more texture slots I don't have.

rain marten
#

Is there a "correct" way to get a high-precision depth buffer of the player's view?

I initially used the DepthWrite shader alongside the RenderScene and PreDrawSkyBox hooks, but that had issues like: flickering chunks of the map, improper depth on transparent objects, hidden sprites on the "normal" view, etc.

Right now I'm using the _rt_ResolvedFullFrameDepth texture instead. It does work without those issues (as long as I add a NeedsDepthPass hook that simply returns true), but it still feels like I'm just doing a hacky thing, and it still breaks when it comes to grass (like on this video).

ionic wraith
#

@misty surge I'm trying to implement ray marching but I can't figure out a way to get the ray direction, how did you do it?
I'm asking you since you seem knowledgeable about the subject

misty surge
#

Sure, I’m at work. When I get a chance I’ll explain for ya

#

I may have an example somewhere too.

misty surge
#

Ok so DepthWrite is an extremely powerful tool for fooling the game that "SCREENSPACE" has depth. IT does not have any depth. Period.

Raycasting is simply just this:
Light from eye to surface.

Meaning there's two levels to this. You'd have to:

  1. Render new material into a renderTarget (to increase, use 16bit)
  2. Preload depth in our case.

What is so great about DepthWrite? Well this is when you're able to produce the maximum precision. Lack there of.

When you have depth, raycasting would be simply be super easy. input_UV coords are the clipspace equivilent of ray casting,

After you have clip space position, you must properly multiply this clip and convert it into 3D (worldDir) (rayDir) . Please multiply it into a "VIEWMATRIX".

ViewMatrix will convert into 3D position IF you inverse it to allocate a clip to Real World Position. So inverseViewMatrix. PLEASE do not use Translations because the shader cannot handle improper usage. You need to properly convert them.

With that said, you'd have raycasting from eye to dir. Then raymarching to check the distance (OR DEPTHMAP?!@?#?!@?) so you could just occupy that level of technique.

misty surge
#

Honestly you could do so much just with this shader alone. It’s a form of illusion of depth. That is the most important tool,

Runtime shader calculations are faster than some silly 2 pass process.

#

There are trade offs as well. Which follows some basic logic like where it is based on distance

#

Etc etc. lemme see if I can find my example code

#

This is my vertex shader for my planets system. Simple stuff. Don't overcomplicate it.

#

I have issues with the view matrix we're given here, so I actually override my shader with the "VIEW MATRIX" which is literally:

local viewMatrix = Matrix();
viewMatrix:SetAngles(Angle(EyeAngles().y,EyeAngles().0,EyeAngles().p)
-- Don't think your slick you can shortcut by translating before it's decompiled, that's a VERRY hard lesson here, we need a better matrix.

for ....
  Shader:SetFloat() -- Which should be SetFloat4() for performance gains
end
#

Controlling shader logic via lua > using static view matrix since ScreenSpace is static.

#

The world should revolve around the camera. Okay I'm done typing, my keyboard is sticking rn.

#

raymarching is a technique to basically use a shader's until.TraceLine(This Pixel).

#

RayTracing is like 2 levels of that idea above.

#

DX11 :V

#

Anything else is up to you. I wanna potentially release the planet shader. I've never contributed anything at all so maybe this could be my dent. idk

#

To draw objects in my case I'd have to convert 3D to 2D and layer it, so each shader has a layer being rendered ontop one another. Using FrameBuffers I blend each layer so I can produce a ton of planets. In the order furthest from the camera to the closest because.... IT will then layer the planet's in order of "DEPTH" which I outsource to CPU using lua distance check, and some index table setup I have going on.

#

If they're close together, you'll notice the depth is "fake" but spaced out it's impossible to tell.

misty surge
#

Not my up-to-date code, but this is generally how I'm rendering planets.

ionic wraith
#

I'll take a look at it after work thanks 👍

vapid reef
# rain marten Is there a "correct" way to get a high-precision depth buffer of the player's vi...
#

this is The Way™️

#

internally the result of the depth pass is not copied over unless NeedsDepthPass is set to true, something to do with performance

#

basically saves you that depth blit if you return false

#

ideally though you do all the depth stuff realtime since blitting rt's is stinky on that perf

#

it would be neat if we could get a RT that has more R channel bits

#

since you know 8 isnt enough for this depth rt

hollow arrow
#

Would it be possible to get a shader for cubemap parallax ?

misty surge
#

I think so. But I’m not entirely sure I never tried myself.

vapid reef
#

^

hollow arrow
#

Please can you release it 🙏

bitter oriole
wispy quartz
#

For 8 bit and 16 bit its 256 depth values vs 65536 depth values is a lot of diff

misty surge
#

My only gripe with higher res depth, is that obviously can be very expensive in your scene.

shadow shuttle
graceful lynx
#

It would look especially nice if you found a way to get props like that canister to float in the goo

misty surge
#

This 100% reminds me of crash bandicoot levels lol

misty surge
#

I spent the whole night making a new system to copy and paste the shader and generate the vmt without having to restart the game each time. Very useful, 🙂 iterating between shaders makes adjusting so much easier.

#

Fixed up layer blending with alpha. So much better because now I freed up one of my texture slots for a night-time side to the planet

#

Looks a lot nicer, and less dilluted like the last few pictures. I don't think anyone would notice unless in-game.

dusty linden
misty surge
#

Should I post my power shell script here for ppl?

#

Very helpful, saves me so much time between builds

rain marten
wispy birch
#

is ur answer im p sure

rain marten
#

when creating the DepthWrite material?

#

because I've tried that one

wispy birch
#

yeah something of that sort

#

the reason this shit happens is cause these trees are only alpha transparent, the vertex space is still occupied, and depth is written via that (also the reason why there are two entity passes, opaque and transparent)

#

do alphatest == 0 and it should be ok

rain marten
#

aw, I thought there was a way to let the depthwrite shader know to discard those pixels, but I guess not

wispy birch
#

im not sure that this shader has an idea of alphatest in the first place tbh

hollow arrow
misty surge
# wispy birch im not sure that this shader has an idea of alphatest in the first place tbh
wispy birch
#

nah, thats blending, its not conditional

misty surge
#

Lame ;-;

#

Shader DepthWrite needs an upgrade

wispy birch
#

if you want to use alphatest, you can do alphatest with stencil and THEN DepthWrite

wispy birch
misty surge
#

Alpha testing, mainly

wispy birch
#

stencil gets you covered

misty surge
#

I see, that makes sense. Hmm haven’t messed around with stencils in a while but they’re pretty useful.

misty surge
# hollow arrow Please do

I’m going to definitely get a more published version, so we can just update shaders while in game. No need to restart. I’ll keep everyone posted!

misty surge
#

Saturn

#

I may add one moon to mars i forget it has an atmosphere.

sacred jackal
#

someone got a DepthWrite example? i cant find shit about it 😭

midnight hatch
misty surge
#

There, I hope I explained it enough, but ye

cosmic perch
#

that solution i buggy

#

i noticed that it works but sometimes it crashed for me or did weird glitches

misty surge
#

I rewrote it.

cosmic perch
#

no i didnt use it, i noticed that u can do some magic to reload the shader

misty surge
#

Yea dude

cosmic perch
#

found it by luck, worked but sometimes didnt

misty surge
#

It works a lot better now.

cosmic perch
#

so i went to stick with just reloading game

misty surge
#

Yeah, this works 100% of the time.

cosmic perch
#

even if u change whole code?

misty surge
#

Yes, the system had some issues. I just worked it out better on my end, it works flawless.

#

Major improvement.

#

Instead of keeping it to myself, I implore you to check it out.

#

works with vertex shaders too, but I haven't tested that too much.

cosmic perch
#

whats the trick i cant follow in ps1

misty surge
#

Then when you're ready to publish just use the masic ones.

cosmic perch
#

does it just replace file contents

misty surge
#

The order it does it is, compile, finish, update vmt local copy locals to game path, rewrite shader's names to proper new ones, and change the vmt last.

#

I forgot to include one more file shoot.

cosmic perch
#

oh ok that works then, new shader basically

#

rewriting same file name works if everything is just the same but u only change values

misty surge
#

Yup

cosmic perch
#

thank god i dont have to touch shaders again hehe

misty surge
#

All derrived from the name itself.

#

So it needs like erm

#

atmosphere_vs3x or _vs30

#

so it decides which one it is.

#

updates the $pixelshader

#

and $vertexshader

#

IF setup, I can like literally change 1 number, relax and see the update LIVE

#

If you wanna publish it, just do it manually when you're ready.

#

Ideally, what it's doing pretty nicely is it's seperating the local from the exported gmod path. So I can work within a scope outside of the gmod's directory.

#

If you decide on using it, lmk if you have issues. I'll fix them. I want people to use shaders easily verses manual. This will save everyone time. I hope this helps.

cosmic perch
#

unforun i dont touch shaders anymore, not sure if anyone else is writing shaders

misty surge
#

Exactly, hence why I think this idea should really be considered as a standard for gmod shader development. But I think it’s possible to just allow ourselves easier access.

misty surge
#

For all purposes, this is literally me changing the shader by 1 number each time building and compiling in the background.

#

4 compiles in like 20 seconds, helps instead of the annoying style we're forced into.

#

@jovial tide Maybe you can take a look at the repository maybe I'm missing something.

misty surge
#

Fixed up the readme

misty surge
#

How it's lookin rn

graceful lynx
#

It looks good

#

Is that a model, or entirely shader code?

misty surge
#

No models, just shader math

graceful lynx
#

Neat!

hollow arrow
#

Maybe @misty surge can help me

finite quarry
#

anyone got an up to date guide on getting shader model 3.0 pixel and vertex shaders compiled and running in the game?

#

i haven't been here in some time

misty surge
#

When we attribute the screenspace shader, it lacks depth calling which is important for 3D geometry.

The work around is to cast DepthWrite, and use that to sort of resolve this issue of lacking depth.

Normally in 3D shaders, we have access to more buffers, in this case we’re limited to what we’re offered.

With all this said and done, it is indeed possible to use 3.0 correctly, but again you may need a work around for depth as it currently stands.

misty surge
#

Lighting can use normal mapping, bump mapping or depth mapping and each one has tradeoffs and benefits between each other.

vapid reef
misty surge
#

Hmm, I don’t think I’ve tried that yet. You got some incite? 😏

finite quarry
#

Alright thanks for the info

vapid reef
#

all i know is that when i asked rubat to give me a list of all the shader params is that those were missing from the wiki, it now contains all the shader params the screenspace_general has https://wiki.facepunch.com/gmod/Shaders/screenspace_general

finite quarry
#

in any case, even if I can't get vertex shaders working, post process screenspace ones are pretty cool and fun in and of themselves

vapid reef
#

all you need should be loading it through VERTEXSHADER and enabling something like $model

misty surge
#

Wow, that’s amazing dude.

finite quarry
#

i'll give it a try at some point, i wanna recreate some of the EGSM example shaders

misty surge
#

Must try it when I get home I can’t believe I missed that.

#

That’s epic stuff. @vapid reef

#

Ty

vapid reef
#

More info here

vapid reef
finite quarry
#

is the NeedsDepthPass fix on x64 yet?

#

NPCs still seem to turn invisible for me

vapid reef
#

i dont see a build deployed yet in the commit channel

finite quarry
#

yea seems like it isn't

#

is there anything special to do differently when compiling 3.0 pixel shaders? currently just interested in screenspace 3.0 pixel shaders

#

2.0b is pretty limiting when it comes to things like sample counts for blurs

jovial tide
finite quarry
#

i see

vapid reef
misty surge
finite quarry
#

should the pixelshader still have the ps20 prefix even if it's 3.0?

vapid reef
#

not sure, try both and see what happens, ill update the wiki with the findings

finite quarry
#

doesn't seem like it

#

i don't know

#

my shader doesn't seem to load either way

#

spits out an error in console that it couldn't load when it's ps20

#

and i am supposedly giving it a sm30 vertex shader

#

oh well

#

someone smarter than me will figure it out

misty surge
#

I use _ps30/20 and specifically _vs20. What’s the error populating the terminal?

finite quarry
#

oh no, the shaders compile fine

#

it's just that they don't load

#

but idk, i'm trying to do something way out of my scope

#

porting this

misty surge
#

Oh, I see. It’s giving you that red error.

finite quarry
#

only if it's with the ps20 prefix

#

ps30 prefix gives no error

#

but doesn't load either

misty surge
#

Lemme see when I get home I’ll show you my ssao perhaps.

finite quarry
#

oh you've already made ssao?

misty surge
#

Yeah, first thing I did but I don’t remember too much what I did.

finite quarry
#

that's cool

#

guess i don't have to bust my ass trying to make it work then

#

would like to learn from yours tho

#

just to see how i can get sm3 to work

misty surge
#

NP, try to figure it out. And when I get home I’ll post it up on GitHub too.

finite quarry
#

you'll get showered with steam awards if you upload it to the workslop

misty surge
#

Even if you can’t— it’s better to learn from your own mistakes 🙂

finite quarry
#

get all the animated anime girl avatars you want

misty surge
finite quarry
#

I meant if you package it as a toggleable shader effect in the Post Process tab

misty surge
#

Oh I see, well that’s pretty simple stuff.

finite quarry
#

Yea

finite quarry
#

yayy the fix is in!!

vapid reef
shadow shuttle
#

lol wat

finite quarry
graceful lynx
#

“Incite” means “to provoke”

#

It’s a silly language with duplicate words

misty surge
#

Lmao true ;-;

surreal parcel
#

conflicting addons

misty surge
#

Black hole WIP

misty surge
#
shadow shuttle
#

thats gemmy 💎

exotic willow
#

You masterfully fail to notice the inscription NON DLL

wispy quartz
exotic willow
#

The fact that HE ALSO HAS A VANILLA GMOD without any dlls, for example?

wispy quartz
#

That was vanilla gmod

exotic willow
#

him too.

#

no.

wispy quartz
#

He used the same egsm shader, and then patched it to work with screenspace_general

#

My friend helped him to do it basically

exotic willow
#

Okay, it clearly says that this is for the workshop, how do you propose to upload to the workshop what EGSM requires?
Say install dll and violate gmod's TOS?

wispy quartz
#

Most of the shaders.
The screenspace_general ones lack multiple texture inputs (4 is not enough), proper depth support, only 16 bit depth/normal/worldpos buffers at max (and hacky way too)

#

So he only made fxaa, and etc to workshop.
The rest of them will be egsm

finite quarry
#

was doomed to make a boom boom in my panties

wispy quartz
finite quarry
#

i did

wispy quartz
#

Then tell me the output pls

finite quarry
#

still didn't work though, i tried just recompiling one of my working 2.0 shaders to 3.0

#

what output

wispy quartz
#

....Well, what is resulted?
Shader with ps20 postfix or a 30 shader which is not drawing?

finite quarry
#

30

#

not drawing

wispy quartz
#

The problem is that you are probably using ficool's PS_INPUT
You should use the same INPUT as the VS_OUTPUT you've provided

#

I.e like this.

misty surge
#

Black hole was the hardest shader so far to get right.

neat terrace
#

looks very nice

misty surge
neat terrace
#

oooooooooohh that's sexy

#

i love the swirling of tbe accretion disk

misty surge
#

Gravity pulls the light around the blackhole, hopefully I can add some layers to it and have different colors.

zinc sedge
#

"Gravity pulls light around the blackhole"

are you referring to what the accretion disk is?

#

or just the warping effect

misty surge
#

I’m still trying to figure it out myself, but the light casted from the sun should technically be pulled into it? Then the Doppler warping ring. There’s so much to this I still don’t quite understand.

zinc sedge
#

I can try to make it a little less confusing, the accretion disk is just matter from various objects like stars and debris being pulled into the black hole. It glows because it is so hot from all the matter in the disk rubbing and colliding with each other at high speeds as it accelerates into the black hole

#

at least that's what I can summarize from my understanding

misty surge
#

That was very helpful. This is what I’ve been going off of.

zinc sedge
#

some crude drawing to try to illustrate what the light is doing on the far side of the black hole's accretion disk
the gray lines are light from the disk

misty surge
#

That’s crazy if you think about how it just sucks up everything like that.

zinc sedge
#

this section is the bottom of the accretion disk btw

#

so you're seeing both the top and bottom of the accretion disk

misty surge
#

Yeah! So that’s what I think I need to fix, mine is very tiny compared to this, the banding too looks to be improved. Thank you for assisting this is helpful

zinc sedge
#

SpaceEngine has some really nice black hole simulation stuff if you want a real time interactive thing to look at

#

video from when it was being developed

#

the disk rotates faster as the camera gets closer due to seeing more recent light from the disk, and it moves in reverse because you're seeing older light

#

this effect is so obvious due to moving faster than the speed of light iirc

graceful lynx
errant nacelle
#

it's stuff like the bootes void that scares me lol

sacred jackal
finite quarry
#

i didnt

#

that's a post process shader using the full depth buffer

#

i have not gotten (or tried since last time) to get vertex shaders to work for me, and subsequently models for shaders

zinc sedge
misty surge
zinc sedge
# misty surge Yes to this. I can probably do a low quality one easily.

you gotta make the light physically warp to get the effect accurately. Your black hole just distorts the disk from what the camera can see. But the light is actually warped in such a way that appears to bend the disk toward the camera

idk if raytracing or something like it would be possible with these shaders. I'm sure you can figure out something convincing!

misty surge
wispy birch
#

it devours

misty surge
#

Some volumetric fog this time around.

timid pumice
#

It's still graphical expensive to render?

#

This screen space shaders

misty surge
#

Not really expensive, just very tricky to work with direct x 9 and it's memory limitations. 3.0 does a great job of resolving some issues, even implementing 3D samplers, but realistically, if I went full detail, high res textures, it would be too expensive to play on, but the rendering quality would look amazing.

#

256x256x256 would need to be a 512x512x512 or runtime generated for the precision to work how you see unreal. But with DX11, they have quite more resources to produce more detail without moderately sized limits.

finite quarry
errant nacelle
#

never thought I'd see chromatic aberration that was good to look at

finite quarry
#

subtle chromatic aberration on hud elements has always (in my opinion) looked really good

errant nacelle
#

never even seen it on a hud before

finite quarry
#

seems to be getting popular these days with games like lethal company and repo

#

at least i think it's in those

#

i'm sure i've seen it elsewhere but i can't remember

errant nacelle
#

never noticed it on lethal company and I haven't played repo yet

finite quarry
#

not sure about lethal company but repo totally has it, but it looks even more subtle than mine

#

also has that slight bloom

#

and i think it's got the fisheye too

lunar folio
#

I like the hud & UI in repo, the main menu and typing in chat is so satisfying

finite quarry
#

yeah it's nice

finite quarry
#

snapped a pic myself and yeah it definitely has prominent chromatic aberration on the ui

#

seems to about on par with strength as mine

misty surge
#

I decided to post a seperate thread on black holes in WAYWO, I think the blackhole thing is basically done (at least for now).

steep river
#

anyone know how to implement screenspace ambient occlusion

wispy quartz
#

Write a shader that makes SSAO using original Crytek's algorithm which used only the depth buffer

placid stream
#

¿what does $CULL do (it's off by default)? like I understand the concept of culling it's just that I don't know if it means cull as in stop rendering full stop OR cull as in enable culling outside of view

steep river
snow cradle
#

How to fix depth buffer

#

i use $texture1 "_rt_ResolvedFullFrameDepth"

snow cradle
#

not egsm

#

.vcs

wispy birch
misty surge
#

Ima work on an example for you guys, with the help of @snow cradle

#

I’ll publish my SSAO so people can just refer to the example.

#

I use DepthWrite with 16bit depth, helps a lot.

misty surge
#

This is just for higher depth writing, the SSAO shader I use can work with this quite well but it's not finalized yet, so I'll leave it out for now.

#

This should allow anyone to downsample, or upgrade their render-targets.

snow cradle
#

Thansk @misty surge

misty surge
#

You're very welcome sir.

#

Thank you for teaching me.

#

Back to modeling I go! (yay)

snow cradle
#

changing ssao settings

#

@keen coral
Let's work

misty surge
#

Yup that looks amazing

#

Makes me wanna go back into shaders, darn it lmao

snow cradle
#

@misty surge can i upload addon on workshop

#

And add u to autors

shadow shuttle
#

hi that ssao is very good nice

misty surge
#

Yes

#

OFC dude.

snow cradle
#

now i will make video with en lang

graceful lynx
#

It's completely fucked up that you can just make SSAO and put it on the workshop now

#

We live in the future

icy plume
#

its evil almost

#

next thing you'll tell me is that we'll see pbr on the workshop just like that

#

most evil of timelines

shadow shuttle
midnight hatch
raw ferry
#

is it possible to make matcap shader with this custom shader feature? like envmapsphere but not unlit and not broken in dx9

snow cradle
#

it takes 5 min

#

I will make params into q-menu and then upload it today

snow cradle
rain marten
#

Im trying to do shadowmaps but it looks like DepthWrite does not like to render a ortho view from the light

snow cradle
#

i will make now video on en language

rain marten
#

it works fine with a perspective view

misty surge
#

https://wiki.facepunch.com/gmod/Shaders/screenspace_general#VIEWPROJMAT

idk if this works but maybe this can be changed here.

rain marten
#

im basically doing the same thing you did on your gm_depthwrite repo, but modified to render a orthographic view

steep river
#

@snow cradle parallax mapping next?

snow cradle
#

we have uv for lightmap texture

#

but idk how to get lightmap texture for mat/brush etc

steep river
#

maybe you can get a fix from there

snow cradle
#

we have only: 1. LUA. 2. HLSL

#

Data in the vertex shader about the lightmap binding comes from C++

#

Perhaps there is a way to optimally get lightmaps and assign them to each face from scratch. And correctly.

#

How can I calculate all this so that it is simple and easy at the end. And doesn't affect the fps.

#

I know how to get _rt lightmap via RenderView, but it's a hit to fps.

#

But the method is simple

shadow shuttle
#

Did someone say parallax mapping 👁️

snow cradle
#
mat_fullbright 2
Replaces all albedos with a grey tone, leaving just lighting information.
#

idk why it not work on gmod

#

hmmm

#

it work on gmod

#

but it does not work using render.SetLightingMode( 2 )

wispy birch
#

it uses fullbright directly

wispy quartz
turbid crystal
#

Just curious does making shaders require any special software or can it mostly be done in like VSC or something.

#

I've noticed some unfamiliar file types in a shader addon I downloaded to get a rough idea of what a shader addon looks like.

errant nacelle
snow cradle
timid pumice
#

Oh My god that looks so freaking cool, good job m8

#

How is the compiling time or the time it takes to refresh a shader

#

I'm really tempted into trying to do shaders

snow cradle
#

idk why but worldnormals and tangent are black (like 0 0 0)

#

i set normal like float3(0,1,0)

#

like floor

#

idk but worldnormals works 4 week ago

#

mb i need do like this

#
    vNormal = normalize(mul( v.vNormal, ( float3x3 )cModel[0] ));

    o.vWorldNormal.xyz = vNormal;
#

or this

#
bool SKINNING = false;

    float3 vNormal; float4 vTangent;
    DecompressVertex_NormalTangent(v.vNormal, v.vTangentS, vNormal, vTangent);
    float3 worldNormal, worldPos, worldTangentS, worldTangentT;
    SkinPositionNormalAndTangentSpace(SKINNING, v.vPos, vNormal, vTangent, v.vBoneWeights, v.vBoneIndices, worldPos, worldNormal, worldTangentS, worldTangentT);
#

or bool SKINNING = false;

#

idk

#

input:
float4 vNormal : NORMAL;

snow cradle
#

and >1 min+ if cycles using unroll

#

and made like $c0x etc

steep river
#

@snow cradle is that a screenspace effect or actually vertex shaders

#

parallax

#

damn impressive bro

#

how did you scale height

#

u use heightmap or normalmapa?

exotic willow
#

Via shader, no? Screenspace is screenspace, screenspace doesnt have normals
Also we have forward rendring...

neat terrace
wispy quartz
#

Just use writeZ......

#

Literally, in your case you already use lightmap pass, you can already copy it's contents to another RT and just use it's depth and render stuff again

graceful lynx
#

Sounds like you're writing that normal info to the water reflection Render Target

#

I haven't done anything with it yet, but I really think some interesting visual effects could be created by intentionally modifying the reflection and refraction Render Targets

wispy quartz
steep river
#

anyone got example how to use screenspace_general for vertex shader

wispy quartz
#

i mean, there is 2 arguments for DrawOpaque/Translucent, one is for depth (shadows, etc), second one is for 3d skybox, but there are no any way to get that

wispy quartz
wispy quartz
# graceful lynx How do you mean?

For an example, for blur rt creation, which caches for certain amount of time
And in some cases it will literally cache wrong rt (water one), resulting in broken blur

graceful lynx
#

render.GetRenderTarget():GetName() will tell you which Render Target is currently being rendered

steep river
#

instead of the screen

wispy quartz