Skip to content

Unique Modern shader language compiling to GLSL shaders

License

Notifications You must be signed in to change notification settings

dont-doubt/Neodym

Repository files navigation

Neodym - Unique Modern shader language compiling to GLSL shader



What is Neodym?

Neodym is a new programming language. It can be compiled into GLSL shaders.


Important

Neodym shader language uses .neo file extension.

Note

For now, Neodym shader language compiler is written only in Java
You can use this code in Java:

String code = /* ... Code in Neodym shader language */

Neodym result = Neodym.compile(code);
String fragment = result.getFragmentShader();
String vector = result.getVectorShader();

And this code in Kotlin:

val code: String = /* ... Code in Neodym shader language */

val (fragment, vector) = Neodym.compile(code)

to compile get both fragment and vector GLSL shader representations as String


Why Neodym?

Neodym is just much more flexible and readable language rather than GLSL.

GLSL do have some annoying syntax flaws. So, we decided to fix them:

We have replaced

1 2 3 4
float vec2 vec3 vec4
int ivec2 ivec3 ivec4
bool bvec2 bvec3 bvec4

by these types:

1 2 3 4
float float2 float3 float4
int int2 int3 int4
bool bool2 bool3 bool4

Also, you can omit ; at the end of code statements.

You have no longer define version for each shader. It will automatically be compiled to #version 330, so

Warning

This chapter is not finished yet...



Examples

The shader might be optionally used with single vector statement to declare vector shader behaviour:

vector {
    /* Vector shader */
}

/* Fragment shader */

If there's no vector statement, then default vector shader is being used:

main {
    gl_TexCoord[0] = gl_MultiTexCoord0
    gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex
}

Warning

This chapter is not finished yet...


Have a question? Got an issue?

You can leave an issue or a question by following link: <Click Here>

Author

rivta (GitHub: @dont-doubt)


Contibuting Neodym language:

Thanks for everyone who will help us to contribute our project.

Note

Neodym uses Lombok annotation processor in code

Special thanks to:

About

Unique Modern shader language compiling to GLSL shaders

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages