Shader Cheat Sheet?

I’m looking at making a shader for my project to help me debug my shape. The I formed after reading a bit about shaders is that I should use a fragment shader that calculates the distance from the center of the shape out (my shape is a sphere that I’ve made).

I was hoping to use this exercise to learn a bit more about shaders in JME in general but I’ve hit a bit of a roadblock.

Every resource I’m reading seems to assume that I know the reasons that they’re using certain variables in their shader inputs and which GLSL version to use.

Is there a cheat sheet/tutorial that’ll go over what the input variables are and why I’d want to use certain versions of GLSL over another?

Ok. Nevermind. Found what I wanted.

There IS a cheat sheet out there and it immediately answered everything…

https://www.opengl.org/wiki/Built-in_Variable_(GLSL)

:musical_score: I can see cleeeeeeeeeeearly now the rain is gone. :microphone:

3 Likes

While youtube videos are not my own preferred way to learn to code… a nice monkey put these together some time back:
https://jmonkeyengine.github.io/wiki/jme3/shader_video_tutorials.html

4 Likes

I think I saw the link to those… But I have the same issue with tutorials. I kinda prefer searchable text so I can quickly search after the fact. I’ll check these out though as well!

Thanks!

My preferred way for learning shaders was to take an existing working one and then repeatedly “break and fix it” with purpose.

4 Likes

Check also the pdf posted here: Global uniforms cheatsheet

2 Likes

Whoa. Ok. That helps out a lot too! Thanks!

Nice videos
@pspeed thanks for sharing the link. :slight_smile:

nice is an overstatement ;), but thanks Paul :slight_smile:, hope you’ve been doing ok. I remember the weekend I made those very ‘clearly’. Someone said it couldn’t be done, so I crammed in the Orange book the day before (and online articles), then the next day I was knackered and delirious from having both the flu and being slightly intoxicated on Jack Daniels and coke, while recording all of them. Dam those were good times haha.

2 Likes