Auburn / FastNoiseLite

Fast Portable Noise Library - C# C++ C Java HLSL GLSL JavaScript Rust Go
http://auburn.github.io/FastNoiseLite/
MIT License
2.73k stars 320 forks source link

Adding glsl support #99

Closed dotlogix closed 2 years ago

dotlogix commented 2 years ago

This PR adds GLSL support to this library. It is a 1:1 port based on the HLSL shader version with some slight adjustments.

A working example can be found here: https://www.shadertoy.com/view/sttBz8

Solves #98

Auburn commented 2 years ago

Thanks! The example usage in the README.md looks to be a copy of the C++ example. Should it not be something more similar to mainImage() in the ShaderToy you linked?

dotlogix commented 2 years ago

It is valid glsl code and was copied from the HLSL example. I guess you would never really want to use this library outside of compute shaders anyway. And else you can easily transform it to a fragment shader.

I could add the fragment shader as an additional example if you like but i wanted to keep it consistent to the HLSL shader version :)