Skip to content

Various shaders that I wrote within the past few years. All tested and run using a openGL 4.0 Core profile.

Notifications You must be signed in to change notification settings

TheRealNox/glsl-shaders

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

GLSL Shader code:

There is 2 different vertex shaders in this repo: passthrough1VT.v.glsl passthrough1VT1Matrix.v.glsl

There should be pretty self explanatory but the former is only using 2 attributes, one vec2 for the vertices and one for the texture coordinate. The later add a ModelViewProjection matrix to be apply on the input vertex.

Regarding the fragment shaders, you will find: colorConverter.f.glsl

This shader will allow to decode/encode on the GPU YUY2 footage (please see here for a good description of YUY2 format: https://www.loc.gov/preservation/digital/formats/fdd/fdd000364.shtml)

It's using subroutines for easier modularity (you can use a single openGL program even if you have different format, just change the subroutines on runtime). In order to change subroutine, on can do as follow:

GLuint indices[this->_colourSubroutines.totalSubroutines]; // Query using openGL glGetProgramStageiv(COLOUR_PROGRAM_ID, GL_FRAGMENT_SHADER, GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS, &this->_colourSubroutines.totalSubroutines);

indices[this->_colourSubroutines.colourConversion.loc] = this->getAppropriateShaderRoutineFromMetadata(metadata, this->_colourSubroutines.colourConversion);	
//We now set our subroutines index table to the shader stage.
glUniformSubroutinesuiv(GL_FRAGMENT_SHADER, this->_colourSubroutines.totalSubroutines, indices);

At the moment, this shader allows you to encode/decode from to:

  • LimitedYUY2ToComputerRGB
  • ComputerRGBToLimitedYUY2
  • FullYUY2ToComputerRGB
  • ComputerRGBToFullYUY2
  • SRGBToComputerRGB
  • PassthroughComputerRGB

About

Various shaders that I wrote within the past few years. All tested and run using a openGL 4.0 Core profile.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages