Switched back to GLSL 1.20 because my laptop is a brick

This commit is contained in:
OLEGSHA 2020-08-09 11:40:41 +03:00
parent 1362dab2c1
commit 45b0ad2888
11 changed files with 31 additions and 20 deletions

View File

@ -44,7 +44,7 @@ public class CombinedShader extends Shader {
} }
private static String combine(String[] resources) { private static String combine(String[] resources) {
StringBuilder accumulator = new StringBuilder("#version 140\n"); StringBuilder accumulator = new StringBuilder("#version 120\n");
for (String resourceName : resources) { for (String resourceName : resources) {
Resource resource = getShaderResource(resourceName); Resource resource = getShaderResource(resourceName);

View File

@ -1,9 +1,20 @@
#version 140 #version 120
uniform int maskCount; uniform int maskCount;
uniform vec2 masks[3 * 2 * 16]; uniform vec2 masks[3 * 2 * 16];
mat2 inverse(mat2 matrix) {
mat2 result = mat2(
+matrix[1][1], -matrix[1][0],
-matrix[0][1], +matrix[0][0]
);
float det = matrix[0][0] * matrix[1][1] - matrix[1][0] * matrix[0][1];
return result / det;
}
bool isInMaskPrimitive(int primitive) { bool isInMaskPrimitive(int primitive) {
vec2 origin = masks[3 * primitive + 0]; vec2 origin = masks[3 * primitive + 0];
vec2 width = masks[3 * primitive + 1]; vec2 width = masks[3 * primitive + 1];

View File

@ -1,4 +1,4 @@
#version 140 #version 120
void flatTransferToFragment() { void flatTransferToFragment() {
shapeTransferToFragment(); shapeTransferToFragment();

View File

@ -1,4 +1,4 @@
#version 140 #version 120
void main(void) { void main(void) {
applyTexture(); applyTexture();

View File

@ -1,4 +1,4 @@
#version 140 #version 120
void main(void) { void main(void) {
gl_Position = applyFinalTransform(vec4(inputPositions, 1.0)); gl_Position = applyFinalTransform(vec4(inputPositions, 1.0));

View File

@ -1,4 +1,4 @@
#version 140 #version 120
varying vec3 varyingColorMultiplier; varying vec3 varyingColorMultiplier;
varying vec2 varyingTextureCoords; varying vec2 varyingTextureCoords;

View File

@ -1,4 +1,4 @@
#version 140 #version 120
attribute vec3 inputPositions; attribute vec3 inputPositions;

View File

@ -1,4 +1,4 @@
#version 140 #version 120
varying vec3 varyingNormals; varying vec3 varyingNormals;

View File

@ -1,4 +1,4 @@
#version 140 #version 120
attribute vec3 inputNormals; attribute vec3 inputNormals;
varying vec3 varyingNormals; varying vec3 varyingNormals;

View File

@ -1,4 +1,4 @@
#version 140 #version 120
void main(void) { void main(void) {
applyTexture(); applyTexture();

View File

@ -1,4 +1,4 @@
#version 140 #version 120
void main(void) { void main(void) {
gl_Position = applyFinalTransform(vec4(inputPositions, 1.0)); gl_Position = applyFinalTransform(vec4(inputPositions, 1.0));