Live data from Hacker News

3D Game Shaders for Beginners

github.com

1–10 of 46 posts

Re: 3D Game Shaders for Beginners

#3
That's a very cool intro to a variety of shader techniques, especially post-processing effects.

What's even more wild, is that modern engines include all of this stuff out of the box, you just have to tick a few check boxes to enable them in your game. :) For example, check out these postprocessing filters built into Unity and Unreal - a ton of person-hours went into these:

https://docs.unity3d.com/Manual/PostProcessingOverview.html

https://docs.unrealengine.com/en-us/Engine/Rendering/PostPro...

Re: 3D Game Shaders for Beginners

#4
Am I just out of touch with what the kids today are doing, or is this formatting really as bonkers as it seems?

  int main
    ( int argc
    , char *argv[]
    ) {
  
    // ...
  
    LColor backgroundColor =
      LColor
        ( generateLightColorPart(207, 1)
        , generateLightColorPart(154, 1)
        , generateLightColorPart(108, 1)
        , 1
        );
  
    // ...
  
  }
I can (sort of) see that this makes it easy to comment out parameters - except for the first one...

Re: 3D Game Shaders for Beginners

#5
post #4

Am I just out of touch with what the kids today are doing, or is this formatting really as bonkers as it seems? int main ( int argc , char *argv[] ) { // ... LColor backgroundColor = LColor ( generateLightColorPart(207, 1) , generateLightColorPart(154, 1) , generateLightColorPart(108, 1) , 1 ); // ... } I can (sort of) see that this makes it easy to comment out parameters - except for the first one...

Reminds me of how Elm lists are formatted; I have a hunch it may be something more common in Haskell, but that's pretty much a shot in the dark.

Re: 3D Game Shaders for Beginners

#6
post #4

Am I just out of touch with what the kids today are doing, or is this formatting really as bonkers as it seems? int main ( int argc , char *argv[] ) { // ... LColor backgroundColor = LColor ( generateLightColorPart(207, 1) , generateLightColorPart(154, 1) , generateLightColorPart(108, 1) , 1 ); // ... } I can (sort of) see that this makes it easy to comment out parameters - except for the first one...

I write this way to make it easier to see when I’ve missed a comma, and also for editor macros.

I’ll often reformat when I’m done so it fits our code review style.

Also I’m usually working systemverilog so 5-10 parameters are common and 50 or more isn’t rare.

Re: 3D Game Shaders for Beginners

#8
post #4

Am I just out of touch with what the kids today are doing, or is this formatting really as bonkers as it seems? int main ( int argc , char *argv[] ) { // ... LColor backgroundColor = LColor ( generateLightColorPart(207, 1) , generateLightColorPart(154, 1) , generateLightColorPart(108, 1) , 1 ); // ... } I can (sort of) see that this makes it easy to comment out parameters - except for the first one...

I've noticed this formatting in sql scripts before too - the biggest benefit I see is making source control diffs only show one line changed rather than two when adding/removing lines.

Re: 3D Game Shaders for Beginners

#10
post #4

Am I just out of touch with what the kids today are doing, or is this formatting really as bonkers as it seems? int main ( int argc , char *argv[] ) { // ... LColor backgroundColor = LColor ( generateLightColorPart(207, 1) , generateLightColorPart(154, 1) , generateLightColorPart(108, 1) , 1 ); // ... } I can (sort of) see that this makes it easy to comment out parameters - except for the first one...

It's a hacky workaround for languages that don't support trailing commas
Post reply on HN