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
Neodym is just much more flexible and readable language rather than GLSL.
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...
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...
You can leave an issue or a question by following link: <Click Here>
rivta (GitHub: @dont-doubt)
Thanks for everyone who will help us to contribute our project.
Note
Neodym uses Lombok annotation processor in code