What's the reason Garry's Mod won't get any new shaders at all?
36 replies, posted
I've dug deep into this knowing that there's multiple threads, but none of the threads really received a definitive answer.
From what I understand, Garry has been quoted as saying this:
[QUOTE=garry;38396931]This is totally awesome.
I did consider doing something similar - with automatically compiling HLSL.. but the shader system is so mammoth, and I didn't wnat features to not work on OSX.. I am impressed you've managed to do anything![/QUOTE]
[QUOTE=garry;38399135]With the OSX/Linux versions it automatically converts the compiled hlsl into glsl (it uses the same shader files as the pc).[/QUOTE]
But there's also this:
[QUOTE=Jinto;19581557]All I did was send garry the sobel shader code and he was kind enough to add it.
So just write and test your shader then send him the shader source and the interfacing code for it.[/QUOTE]
So shaders have been added to Garry's Mod in the past, apparently, and code can be compatible for all platforms, and yet:
[QUOTE=Robotboy655;52180978]It's not going to be added anytime soon, if ever.[/QUOTE]
[QUOTE=Robotboy655;52181022]We obviously don't have the source code of those shaders for the engine to "know how to use them".[/QUOTE]
This has always confused me. There's people on the 2006 branch of Half-Life 2 who have managed to get parallax working in Half-Life 2 Deathmatch and Counter-Strike (defunct of course). There's people on the 2007 branch and the 2013 branch who get to use the [url=https://developer.valvesoftware.com/wiki/Category:SourceShaderEditor]Source Shader Editor[/url]. (both of which have a tutorial for installation and usage) And it really doesn't end there - there's code for [url=https://www.youtube.com/watch?v=ZH6s1hbwoQQ]parallax corrected cubemaps[/url] floating around for anyone to use, and shaders already made for the Source Shader Editor as well for people to use.
So what's the problem? When you get right down to it, it doesn't have to involve Lua at all - it could just be fixing and adding features (like parallax corrected cubemaps) to existing shaders. It could involve people making their own shaders and sending them in to be added to a future update. I don't know why the answer has to be "can't and won't be done".
This is not me shaking my fist angrily with demands, either. If it is honestly too much of a task to be dealt with, I can completely understand that. If it's just something no one wants to do, I can completely understand that. I've just become confused looking at these multiple statements that don't necessarily agree with each other.
Imagine garrysmod getting a feature
rubat is too busy removing the shit from the workshop to implement shaders :v:
There's is a big difference between getting NEW shaders, and making existing ones function the way they do in CS:GO/Portal 2/Whatever.
The latter cannot be done because we obviously don't have any sources from those games.
What NEW shaders do you want, that wouldn't be used by 1 or 2 mods/people or whatever?
I don't see how spending time making new shaders on any modders whim is a good idea.
As for Parallax Corrected Cubemaps, don't they only work under very specific circumstances (i.e. the room has to be a box basically) and require every cubemap on every map to be rebuilt to actually work? Doesn't seem like a reasonable thing to bother with to me.
And with Source Shader Editor, I personally haven't looked into it at all. It's can be a good idea/solution if it actually works.
A lot of mappers would totally love having fixed shaders. It wouldn't be just one or two people.
Lots of rooms are generally box-shaped because of how Source and vis works. You could break plenty of maps into boxes.
And with Source Shader Editor and the stuff people have already finished, a lot of the work is already done for you. There's code in my post for PCCM. Last I tinkered with SSE there were example shaders as well, which I believe also includes ambient occlusion.
Ultimately, a lot of people either don't say anything about shaders because they're convinced they're never going to happen, or don't really know about them and how useful they can be. A person who hasn't heard of classes, for instance, probably doesn't see a lot of value in it out right but will find them a useful tool after exposure. Therefore, I don't think it's fair to say "hey, no one cares about X" or "hey, no one would use X" because I think you're biased to not wanting to use your time on uncertain things. And just so you know, I do think that's an understandable fear to have and sympathize. But seriously ask the mappers we have in this forum and I'm sure they can come up with lots of ideas for shaders and use them.
I stumbled into this post somehow but
Shaders can be a bitch when it comes to cross-platform stuff, and since HLSL is used on Windows and GLSL is used on Mac there will undoubtedly by potential incompatibilities. Especially because Mac OpenGL support is so piss-poor. It looks like the shader editor might export compiled shader bytecode, though?
That would make things worse, I believe. You can't take shader bytecode made for HLSL and hope to run it on a different OS with a different API on different graphics hardware running different graphics drivers. This sounds like it'd be a nightmare for the devs to implement, but I'm not familiar with Source, GMod, or any graphics API (anymore) besides Vulkan. Its too bad you can't use something like SPIR-V and [URL="https://github.com/KhronosGroup/SPIRV-Cross"]that ecosystem[/URL] of tools, which would maybe simplify supporting custom shaders on different platforms + rendering APIs. Mac supposed supports OpenGL 4.1 (Nominal support, ugh) and there's a [URL="https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_gl_spirv.txt"]SPIR-V extension for OpenGL 3.3[/URL] that could maybe work? Windows shaders would still require something like SPIR-V cross to get them into an HLSL-like format. not sure how the rendering backend works for Garry's Mod at all tbh. [URL="https://github.com/Unity-Technologies/HLSLcc"]Unity seems to have figured something out though[/URL]?
[sp]this is why I love Vulkan and SPIR-V tbh, even using MoltenVK (vulkan-to-metal shim for mac) I'm able to use the same set of compiled SPIR-V shaders everywhere[/sp]
My main concern with shaders would be security. I'm not sure how it works in source engine but assuming it's just straight forward HLSL shaders with some extensions you can do things like read textures out of bounds and end up showing the contents of a browser running in the background.
You can also of course stall the GPU and make it do hard work (I'm sure someone will make a server that mines cryptocurrency) but maybe this is not so bad or different from being able to do the same in lua.
As for shader use cases I can think of many things. I would love to make a 2d effect library for instance if it was added to gmod. Could even play with new ways of rendering 3d geometry (depending on how it's implemented)
[QUOTE=paindoc;52791503]Shaders can be a bitch when it comes to cross-platform stuff[/QUOTE]
Source engine is a cross platform engine so I'm sure it handles this. Your concern here is for making an engine from scratch. According to [url=https://github.com/ValveSoftware/ToGL]ToGL[/url] it translates HLSL to GLSL at bytecode level. So I assume the workflow is to just to write HLSL and compile it with the tools the valve wiki says you should.
I think adding already available and written shaders would be a good thing because it would further diversify Garry's Mod as a content platform. Things such as Tower Unite started off on Gmod as Gmod Tower, and it would be good to keep such content on Garry's Mod rather than it moving away due to limitations with the game.
I feel shaders such as those used in Portal 2 and CSGO could likely be acquired if a dialogue was opened with Valve. After all Garry's Mod already takes advantage of the content of those games.
Though I can also understand not wanting to add more things to Garry's Mod what with Gmod 2 under development.
I think something like Phong for materials, corrected cubemaps, parallax, and SSAO would go a long way.
IIRC first requirement for parallax mapping is directx 11 implementation into source, not sure about SSAO, but i've seen some SSAO implementations on source shader editor, but it looked pretty bad, maybe once again, due engine limitations...
But as content creator, you can create pretty good looking models and materials with actual source engine with the correct material parameters, but the only thing we really lack is a base PBR shader
[QUOTE=Robotboy655;52790297]What NEW shaders do you want, that wouldn't be used by 1 or 2 mods/people or whatever?
I don't see how spending time making new shaders on any modders whim is a good idea.
[/QUOTE]
One thing that makes Garry's Mod such a great platform is it has a [i]ton[/i] of content for the [I]modders[/I] to tap into - not the game developers. If anything, Garry's Mod is a platform for new content. The argument (usually) isn't "raise your hand if you might use this, we can't think of too many options so we don't want to add it", but instead "here's some tools, go make some shit with them."
[QUOTE=gonzalolog;52794222]IIRC first requirement for parallax mapping is directx 11 implementation into source, not sure about SSAO, but i've seen some SSAO implementations on source shader editor, but it looked pretty bad, maybe once again, due engine limitations...
But as content creator, you can create pretty good looking models and materials with actual source engine with the correct material parameters, but the only thing we really lack is a base PBR shader[/QUOTE]
PBR is another one that I thought would be cool, but I think might take a lot of work, right?
[QUOTE=wauterboi;52794618]PBR is another one that I thought would be cool, but I think might take a lot of work, right?[/QUOTE]
I've seen working deffered lighting in both ASW, and a, well, "forward port" of 2013 SP/MP onto the ASW platform. Of course I've no idea if this is within the bounds of the Source shader editor.
Not to mention it was pretty dang buggy a lot of the time.
I think I've misunderstood the point of this thread, in WAYWO there was talks of adding a shader API so I kinda wrote my post with context from that thread.
If gmod has a shader API, you can do some of these things by yourself. SSAO for instance is very simple, but you need access to the depth buffer to do that. (which we have already)
If you want to do PBR you'll need to modify VertexLitGeneric and I'm not sure how an API for doing that in lua is possible. But even if it was, it's not just about "making a PBR shader", you'll need to replace materials and textures in game as well and just revamp the whole system. You might get something easily going for 1 model and a cubemap, but you need to think about how to do this for an entire map and all of its assets. You can't just apply this type of shading on an existing source engine map for instance.
I'm not sure what kind of buffers you get access to when writing shader code with the shader API, but typically in forward shading most of the stuff is done in one big shader (VertexLitGeneric) as much of the information you want to use is only available there.
So if you want to make SSR for instance you'll need access to at least a position buffer and normal buffer which I don't think sure exists in this system. (a position buffer is just like a depth buffer except it contains a position (xyz) per pixel, same goes with normal)
If source engine was deferred it would be a lot easier to write effects for.
[QUOTE=CapsAdmin;52795458]I think I've misunderstood the point of this thread, in WAYWO there was talks of adding a shader API so I kinda wrote my post with context from that thread.
If gmod has a shader API, you can do some of these things by yourself. SSAO for instance is very simple, but you need access to the depth buffer to do that. (which we have already)
If you want to do PBR you'll need to modify VertexLitGeneric and I'm not sure how an API for doing that in lua is possible. But even if it was, it's not just about "making a PBR shader", you'll need to replace materials and textures in game as well and just revamp the whole system. You might get something easily going for 1 model and a cubemap, but you need to think about how to do this for an entire map and all of its assets. You can't just apply this type of shading on an existing source engine map for instance.
I'm not sure what kind of buffers you get access to when writing shader code with the shader API, but typically in forward shading most of the stuff is done in one big shader (VertexLitGeneric) as much of the information you want to use is only available there.
So if you want to make SSR for instance you'll need access to at least a position buffer and normal buffer which I don't think sure exists in this system. (a position buffer is just like a depth buffer except it contains a position (xyz) per pixel, same goes with normal)
If source engine was deferred it would be a lot easier to write effects for.[/QUOTE]
That's what I thought. I originally thought PBR was just making materials on the fly with pre-made materials and settings, but it appears it's way, way more complicated than that which is why I didn't mention it. I don't think we need it either.
Well...Unity 5 main feature was pbr rendering pipeline, it's a master material, just like VertexLitGeneric
I've seen someone in programming waywo implementing pbr in a source ask 2013 project although, merging it would be way satisfying
[QUOTE=gonzalolog;52797477]Well...Unity 5 main feature was pbr rendering pipeline, it's a master material, just like VertexLitGeneric
I've seen someone in programming waywo implementing pbr in a source ask 2013 project although, merging it would be way satisfying[/QUOTE]
[video=youtube;aE8tVpHAAso]https://www.youtube.com/watch?v=aE8tVpHAAso[/video]
You mean like this?
This one
[video=youtube;ct9mp9xfsVc]https://www.youtube.com/watch?v=ct9mp9xfsVc[/video]
Everything looks too not-source
Can anyone explain what they mean by 'new' shaders? Surely we're not talking about things like Color Correction/Bloom/Sobel, right? How are 'new' shaders coded, how are they made, and what is their limit? Hoping someone could enlighten me.
Shader as it means, is how an object (Can be a model, a quad, a hud) is drawn in the screen, how the light affects it, how it shines, how it reacts to maths and properties
Like you can animate something by using a degree
Take as example pokemon battle start animation, that's a shader, it uses a black texture and another image as sampler to animate the screen, so you don't have to create every frame of animation
This guy teach about how shader works and how you can write those
[video=youtube;LnAoD7hgDxw]https://www.youtube.com/watch?v=LnAoD7hgDxw[/video]
Everything is most likely code, the limits are the graphic engine, like direct x version, open gl, platform, etc
[QUOTE=Sam Za Nemesis;52798326]I actually had discussed with 1/4 Life about a theoretical way to add a flexible shader helper for garry's mod that can load arbritary shaders into the game, or even a fixed one that exposes enough data to the shader to do something interesting, separated between brush, model or postproc
I would love to work on something like this if the developers want to do something like that[/QUOTE]
I love watching your Source videos, by the way. If you were to work on Garry's Mod I'd be incredibly happy.
[QUOTE=Sam Za Nemesis;52798326]I actually had discussed with 1/4 Life about a theoretical way to add a flexible shader helper for garry's mod that can load arbritary shaders into the game, or even a fixed one that exposes enough data to the shader to do something interesting, separated between brush, model or postproc
I would love to work on something like this if the developers want to do something like that
I had made another quick implementation of a simple quick and very dirty PBR shader for a lecture I gave about shader programming, anything is within the bounds of the source shader editor, although the editor is not very practical
[thumb]http://image.noelshack.com/fichiers/2017/42/5/1508456549-untitled.png[/thumb][/QUOTE]
because im curious, what does the source shader compiler output? compiled stuff, intermediary representations, etc? how is compatibility between apis and api versions maintained?
It outputs pure hsls code, but the editor handles nodes
But the engine itself compiles itself and make it ready for source
It's been a couple days and there hasn't been a response from a developer. To recap, there are now a list of shaders people want to be accepted or rejected, as well as someone who has experience working with shaders who has offered help in the past and is interested. What more is needed of the community before a response can be made? Just a response.
User defined shaders would be interesting. Security aside, it could be easier to create a domain specific language for writing them in gmod which is then translated to the underlying graphics API (HLSL or GLSL).
That aside, new shaders for gmod would be nice but ultimately it still runs on source. Unless gmod is moved to a new engine, I don't see it being worth the time.
I would be really exited to get custom shaders into gmod. Mostly because i write shaders for living. :v:
There would be so much potential.
[QUOTE=wauterboi;52794134]I think something like Phong for materials, corrected cubemaps, parallax, and SSAO would go a long way.[/QUOTE]
Don't forget CSM!
Edit: Adding onto my comment, it's ridiculous that there hasn't been any sort of graphical update. The potential for garrysmod could be increased if the devs had even bothered to add this stuff.
Simply saying no because "1 or 2 people will use it" is such a fucking lazy ass move.
[QUOTE=BlueSkilly;52832047]a fucking lazy ass move.[/QUOTE]
Careful, this [I]is[/I] their forum. Valid criticism or not, some people take critiques like dicks, and I don't know any of the developers to make a judgement one way or another.
[QUOTE=Deathking15;52832196]Careful, this [I]is[/I] their forum. Valid criticism or not, some people take critiques like dicks, and I don't know any of the developers to make a judgement one way or another.[/QUOTE]
developers don't moderate nearly ever
[QUOTE=Deathking15;52832196]Careful, this [I]is[/I] their forum. Valid criticism or not, some people take critiques like dicks, and I don't know any of the developers to make a judgement one way or another.[/QUOTE]
Then don't post. Making non constructive posts is more likely to get you banned than posting your opinion.
Sorry, you need to Log In to post a reply to this thread.