Electric Turnip
  • Blog
  • Stories
    • Story 000
    • Story 001
    • Story 002
    • Story 004
    • Story 007 - Unfinished
    • Story 008
    • Story 010 - BattleWagon
    • Story 012
  • Images
    • Adventure Caddie concept gallery
    • Page Design Gallery
    • Older Work
  • 5FEAT Video
  • Videos
  • Game Experiments
    • Climb
    • Super Shapetoy
    • TurboGarbageTruck
    • 031 - Best Games - Enchanter
    • 033 - Shader Test
  • Contact

128

4/13/2015

0 Comments

 
I know almost nothing about the intricacies of graphics programming. I don’t know how to swizzle a matrix or whatever it is graphics programmers do. I know that swizzling is a real thing, and I think I may have even done it once or twice, but I’m not sure I could tell you exactly how or why. I don’t have the words.

I recently updated a shader I had created so that it would work in Unity 5. There were some small bugs that previous version of Unity were fine with, but the latest version just could not abide. Every object using this shader would come up fuchsia. Fuchsia is a terrible color. That’s why it is used to spotlight an error. No one would ever willingly use fuchsia. To some part of our lizard brain, fuchsia means broken.

The bugs were relatively minor, but it still took me quite a while to track them down and fix them. Not because the shader is particularly complex. It isn’t. It was because, even though I had created this shader entirely from scratch, adjusted and set each variable, and used elements of the render engine in ways that, at least I, think are somewhat clever, I had never actually looked at the code.

I used a visual, node based shader editing tool to author the shader. I can already picture the indignant sneers of the coding grognards out there. There is a contingent of the game dev community who even regard a pre made game engine, Unity Unreal and the like, as if it were an especially pungent cheese. I may not have made the most inventive or precision tuned shader ever, but It creates a look that was not available through any simple means. It is unique, and while it may be a problem that a very few people have, the shader solves a problem. That’s what good tools do.

I occasionally drift into the wonderful world of linux, unix, dos, and command line interfaces. I grew up using the command line. My childhood was populated with computers that were completely impenetrable to the uninitiated. Flashing cursor boxes and arcane commands like LOAD “*”,8,1 were common. I still habitually type ls when I mean to type dir. Z80 basic is a major part of my construction as a human. I have it in me to be the uber geek that looks down his nose at gui based tools, yet I bristle at the comment that using the command line is more efficient.

I have driven many stick shift vehicles. They are not more efficient than driving an automatic. A practiced driver can accomplish things with a manual transmission that an automatic vehicle might not be capable of. They have more options available, but I think it is important to never mistake options for skill or efficiency. The learning curve of an automatic vehicle is significantly smoother. It lets the driver get better faster. Knowing how and when to shift gears is much less important than learning to be a good driver.

I view writing code in much the same way. I often find that variances in syntax hold me back more than the actual problems I’m trying to solve. Since I’m not hip deep in the programming language of the day, I spend most of my time looking at documentation, and a small amount of time actually writing code. Gui based development tools are like an automatic transmission for code. The learning curve is smoothed out. That doesn’t mean that it’s not important to know what is going on under the hood.

Since I had created the shader, even if it was with a gui based editor, I was able to walk through the code looking for landmarks that I had placed to ferret out the offending bits. Creating the program in a streamlined way allowed me to better understand what was actually going on in there. If I had sat down with openGL documentation and a book on shader programming, I would probably still be sitting there with no shader to show for it. As it stands, I have it running in two versions of the engine and I’m well on my way to making it work with the new Unity lighting model.

Even now I feel like I’m being overly defensive of visual scripting and programming systems. There is a part of me that use to set up batch renders using small unix scripts that feels like shader editors and node based graphical programming is a cop out. It’s coding for babies. Maybe it is, but babies learn faster than any other human, and they learn by testing the world and getting feedback. They don’t learn by building up layers of theory that they eventually employ in one triumphant effort. Test, receive feedback, adjust, test receive feedback, adjust. That is what these tools let you do.

Mostly I am just trying to justify buying Shader Forge, since the free shader editors don’t work in in Unity 5.

0 Comments



Leave a Reply.

    Archives

    December 2022
    November 2022
    October 2022
    September 2022
    August 2022
    July 2022
    June 2022
    May 2022
    April 2022
    March 2022
    February 2022
    January 2022
    December 2021
    November 2021
    October 2021
    September 2021
    August 2021
    July 2021
    June 2021
    May 2021
    April 2021
    March 2021
    February 2021
    January 2021
    December 2020
    November 2020
    October 2020
    September 2020
    August 2020
    July 2020
    June 2020
    May 2020
    April 2020
    March 2020
    February 2020
    January 2020
    December 2019
    November 2019
    October 2019
    September 2019
    August 2019
    July 2019
    June 2019
    May 2019
    April 2019
    March 2019
    February 2019
    January 2019
    December 2018
    November 2018
    October 2018
    September 2018
    August 2018
    July 2018
    June 2018
    May 2018
    April 2018
    March 2018
    February 2018
    January 2018
    December 2017
    November 2017
    October 2017
    September 2017
    August 2017
    July 2017
    June 2017
    May 2017
    April 2017
    March 2017
    February 2017
    January 2017
    December 2016
    November 2016
    October 2016
    September 2016
    August 2016
    July 2016
    June 2016
    May 2016
    April 2016
    March 2016
    February 2016
    January 2016
    December 2015
    November 2015
    October 2015
    September 2015
    August 2015
    July 2015
    June 2015
    May 2015
    April 2015
    March 2015
    February 2015
    January 2015
    December 2014
    November 2014
    October 2014
    September 2014
    August 2014
    July 2014
    June 2014
    May 2014
    April 2014
    March 2014
    February 2014
    January 2014
    December 2013
    November 2013
    October 2013
    September 2013
    August 2013
    July 2013
    June 2013
    May 2013
    April 2013
    March 2013
    February 2013
    January 2013
    December 2012
    November 2012
    June 2012
    October 2011
    July 2011
    June 2011
    May 2011
    April 2011
    March 2011
    November 2010
    October 2010
    August 2010
    July 2010
    June 2010
    May 2010
    April 2010

    Categories

    All
    Adventure Caddie
    Best Games

    RSS Feed

Owen McManus
  • Blog
  • Stories
    • Story 000
    • Story 001
    • Story 002
    • Story 004
    • Story 007 - Unfinished
    • Story 008
    • Story 010 - BattleWagon
    • Story 012
  • Images
    • Adventure Caddie concept gallery
    • Page Design Gallery
    • Older Work
  • 5FEAT Video
  • Videos
  • Game Experiments
    • Climb
    • Super Shapetoy
    • TurboGarbageTruck
    • 031 - Best Games - Enchanter
    • 033 - Shader Test
  • Contact