splitshockvirus,
@splitshockvirus@mstdn.starnix.network avatar

Hey man whatever this is that you're doing can you do that some other time.

crunklord420,
@crunklord420@clubcyberia.co avatar

@splitshockvirus new csgo skins just dropped, need to compile shaders for hours.

gentoobro,
@gentoobro@gleasonator.com avatar

@crunklord420 @splitshockvirus What the fuck is in their shaders that takes so long? Mine compile in a couple seconds. Must be some sort of bloated middleware.

crunklord420,
@crunklord420@clubcyberia.co avatar

@gentoobro @splitshockvirus I don't know 100% but I assume it has to do with giant ubershaders full of compile-time ifdefs. Every new skin requires X number of minor variation shader recompiles. Every minor change requires you recompile every variation. It's just an ugly interdependence mess for the sake of run-time optimization.

gentoobro,
@gentoobro@gleasonator.com avatar

@crunklord420 @splitshockvirus Things that complicated are seldom truly optimized.

It's insane to have special shaders for each skin. There aren't that many ways you can make light reflect, even with oil-slick effects and such.

icedquinn,
@icedquinn@blob.cat avatar

@gentoobro @crunklord420 @splitshockvirus usually the point of an ubershader is it does all of your shit so you aren't having to change shader programs during the render

gentoobro,
@gentoobro@gleasonator.com avatar

@icedquinn @crunklord420 @splitshockvirus Yeah. I have one for GUI rendering. Whether you swap shader programs or not during rendering is not the point. (In CS they could swap shaders for the guns without much problem. There aren't many guns on screen at any given point in time.) The insane part is that they have special shader code for each skin, or even many skins.

icedquinn,
@icedquinn@blob.cat avatar

@gentoobro @crunklord420 @splitshockvirus each shader change is a draw call, though, which is a scarce resource on PC.

gentoobro,
@gentoobro@gleasonator.com avatar

@icedquinn @crunklord420 @splitshockvirus Draw calls are different. You need to have a shader bound already to issue a draw call. Shader changes go into the graphics queue, yes, but they aren't that scarce, and can be even cheaper if you do it carefully. Swapping the executable code is rather fast; reconfiguring the layout of the cache (uniforms) is the expensive part. In Vulkan you can carefully manage these costs independently. In OpenGL you can do some voodoo and the driver will probably hopefully maybe get it right. (Dunno about DirectX. Fuck Microshaft.)

A modern game might have a dozen shader changes each frame just due to the render pipeline alone. The main thing is to not just change shaders willy-nilly between each model or primitive.

On a side note, draw calls themselves aren't that expensive per-se. There can be some CPU overhead, but the main thing to remember is that the GPU is extremely pipelined and you want to let it crunch on as much data at one time as you can. You also don't want to cross the driver barrier too much with OpenGL, but that's a different story.

icedquinn,
@icedquinn@blob.cat avatar

@gentoobro @crunklord420 @splitshockvirus a lot of modern games are also designed for a console first, where gpu interactions are cheap. this is partly why all of the ports run like shit, even the good ones, because the platforms they design for have cheaper state management.

gentoobro,
@gentoobro@gleasonator.com avatar

@icedquinn @crunklord420 @splitshockvirus Consoles also usually have extremely fast main memory and hard guarantees about core scheduling. It's my understanding that most cross-platform games use some sort of rendering abstraction where they create a command list in their own format then translate it into whatever API is being used underneath. That sort of thing is extremely difficult to optimize for.

As for my game, users will have the option of Vulkan or Vulkan. 😆

icedquinn,
@icedquinn@blob.cat avatar

@gentoobro @crunklord420 @splitshockvirus i would like to learn vulkan :ablobcatohlookaround: i was stuck on old GL for a very long time, esp. to be compatible with very old potato.

now the discount 200$ mini pcs run vulkan, so its time to move on.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • kavyap
  • mdbf
  • khanakhh
  • tacticalgear
  • modclub
  • DreamBathrooms
  • thenastyranch
  • magazineikmin
  • InstantRegret
  • Youngstown
  • osvaldo12
  • slotface
  • rosin
  • cubers
  • megavids
  • cisconetworking
  • tester
  • anitta
  • ngwrru68w68
  • everett
  • ethstaker
  • Durango
  • normalnudes
  • provamag3
  • Leos
  • GTA5RPClips
  • JUstTest
  • lostlight
  • All magazines