diff for Griff_HighPoly_CobraIII_multiDecal:
Code: Select all
--- Griff_HighPoly_CobraIII_multiDecal.oxp/Shaders/griff_HP_CobraIII_PLAYER_multidecal.fragment 2025-12-28 02:48:46.497941289 +0100
+++ "Griff_HighPoly_CobraIII_multiDecal.oxp/Shaders/griff_HP_CobraIII_PLAYER_multidecal copy.fragment" 2025-12-28 02:48:31.354529098 +0100
@@ -1,30 +1,34 @@
#define SUN_RADIANCE 3.0
-const vec3 PRIMARY_COLOR[12] = vec3[](vec3(1.0, 0.2176, 0.1889),
- vec3(0.6090, 0.0484, 0.0),
- vec3(1.0, 0.4109, 0.0),
- vec3(0.8271, 0.6382, 0.0),
- vec3(0.1880, 0.5414, 0.3770),
- vec3(0.0, 0.2707, 0.0557),
- vec3(0.2133, 0.5105, 0.6617),
- vec3(0.1662, 0.0, 0.6617),
- vec3(0.5392, 0.1448, 0.6617),
- vec3(0.0, 0.0889, 0.2707),
- vec3(0.8571, 0.8150, 0.6510),
- vec3(0.2588,0.3083,0.2193));
-
-const vec3 SECONDARY_COLOR[12] = vec3[](vec3(0.5176, 0.0069, 0.0),
- vec3(0.1805, 0.0, 0.0053),
- vec3(0.3910, 0.0260, 0.0),
- vec3(0.8, 0.1846, 0.2315),
- vec3(0.0484, 0.1486, 0.3083),
- vec3(0.0, 0.0016, 0.3233),
- vec3(0.1974, 0.2537, 0.5113),
- vec3(0.0, 0.0333, 0.3233),
- vec3(0.0, 0.0637, 0.5113),
- vec3(0.0, 0.3097, 0.3233),
- vec3(0.2331, 0.2242, 0.2282),
- vec3(0.0, 0.1265, 0.2331));
+vec3 getPrimaryColor(int index) {
+ if (index == 0) return vec3(1.0, 0.2176, 0.1889);
+ if (index == 1) return vec3(0.6090, 0.0484, 0.0);
+ if (index == 2) return vec3(1.0, 0.4109, 0.0);
+ if (index == 3) return vec3(0.8271, 0.6382, 0.0);
+ if (index == 4) return vec3(0.1880, 0.5414, 0.3770);
+ if (index == 5) return vec3(0.0, 0.2707, 0.0557);
+ if (index == 6) return vec3(0.2133, 0.5105, 0.6617);
+ if (index == 7) return vec3(0.1662, 0.0, 0.6617);
+ if (index == 8) return vec3(0.5392, 0.1448, 0.6617);
+ if (index == 9) return vec3(0.0, 0.0889, 0.2707);
+ if (index == 10) return vec3(0.8571, 0.8150, 0.6510);
+ if (index == 11) return vec3(0.2588,0.3083,0.2193);
+}
+
+vec3 getSecondaryColor(int index) {
+ if (index == 0) return vec3(0.5176, 0.0069, 0.0);
+ if (index == 1) return vec3(0.1805, 0.0, 0.0053);
+ if (index == 2) return vec3(0.3910, 0.0260, 0.0);
+ if (index == 3) return vec3(0.8, 0.1846, 0.2315);
+ if (index == 4) return vec3(0.0484, 0.1486, 0.3083);
+ if (index == 5) return vec3(0.0, 0.0016, 0.3233);
+ if (index == 6) return vec3(0.1974, 0.2537, 0.5113);
+ if (index == 7) return vec3(0.0, 0.0333, 0.3233);
+ if (index == 8) return vec3(0.0, 0.0637, 0.5113);
+ if (index == 9) return vec3(0.0, 0.3097, 0.3233);
+ if (index == 10) return vec3(0.2331, 0.2242, 0.2282);
+ if (index == 11) return vec3(0.0, 0.1265, 0.2331);
+}
// Information from vertex shader
varying vec2 vTexCoord, scrollvTexCoord;
@@ -358,8 +362,8 @@
// Begin repaint the colour texture - Select the paint scheme from the two arrays
int PaintIndex = int(uPaintColScheme);
- vec4 PaintPrimaryCol = vec4(vec3(PRIMARY_COLOR[PaintIndex]), 1.0);
- vec4 PaintSecondaryCol = vec4(vec3(SECONDARY_COLOR[PaintIndex]), 1.00);
+ vec4 PaintPrimaryCol = vec4(vec3(getPrimaryColor(PaintIndex)), 1.0);
+ vec4 PaintSecondaryCol = vec4(vec3(getSecondaryColor(PaintIndex)), 1.00);
// Calculate the mixing effect for the two paint colours, we'll run the paintMap (diffuseMapColor A) texture through the increse contrast function to get a map we can use to control the mix
float paintmixmap = contrast(vec4(0.5, 0.8, 0.2, 1.0), diffuseMapColor.a);
diff for the NPC shader Sidewinder:
Code: Select all
--- griff_SpecGloss_Sidewinder_with_shaders.oxp/Shaders/griff_SpecGloss_Sidewinder_NPC.fragment 2025-12-28 02:48:51.741930457 +0100
+++ "griff_SpecGloss_Sidewinder_with_shaders.oxp/Shaders/griff_SpecGloss_Sidewinder_NPC copy.fragment" 2025-12-28 02:48:24.962284568 +0100
@@ -54,40 +54,45 @@
const vec4 kEngineMisFireFlashCol = vec4(4.5947, 4.5947, 0.0, 1.0);
const vec4 kRedExhaustGlow = vec4(2.0, 0.4, 0.0, 1.0);
-// Paint scheme colour arrays
- vec3 PRIMARY_COLOR[16] = vec3[](vec3(0.0243,0.0551,0.0180),
- vec3(0.1037,0.0,0.0038),
- vec3(0.1550,0.0,0.1081),
- vec3(0.3668,0.1114,0.0),
- vec3(0.3783,0.0502,0.0),
- vec3(0.0039,0.0404,0.0473),
- vec3(0.0246,0.0102,0.0337),
- vec3(0.1112,0.1155,0.1155),
- vec3(0.0090,0.1037,0.0847),
- vec3(0.0002,0.0466,0.1037),
- vec3(0.0,0.1550,0.0022),
- vec3(0.0,0.0633,0.1037),
- vec3(0.1096,0.0001,0.0),
- vec3(0.0005,0.0002,0.1037),
- vec3(0.0,0.0679,0.0150),
- vec3(0.2441,0.1339,0.0));
-
- vec3 SECONDARY_COLOR[16] = vec3[](vec3(0.0735,0.0764,0.0530),
- vec3(0.0759,0.0817,0.0704),
- vec3(0.0144,0.0006,0.0930),
- vec3(0.0487,0.0663,0.0511),
- vec3(0.0388,0.0764,0.0528),
- vec3(0.0,0.0615,0.0548),
- vec3(0.0394,0.0394,0.0394),
- vec3(0.0525,0.0087,0.0095),
- vec3(0.1038,0.1180,0.1176),
- vec3(0.0,0.0,0.0817),
- vec3(0.7432,0.0601,0.0),
- vec3(0.0423,0.0651,0.0712),
- vec3(0.0764,0.0,0.0),
- vec3(0.0083,0.0030,0.0712),
- vec3(0.0,0.0443,0.0042),
- vec3(0.3510,0.0843,0.0));
+// Paint scheme colour functions
+
+ vec3 getPrimaryColor(int index) {
+ if (index == 0) return vec3(0.0243,0.0551,0.0180);
+ if (index == 1) return vec3(0.1037,0.0,0.0038);
+ if (index == 2) return vec3(0.1550,0.0,0.1081);
+ if (index == 3) return vec3(0.3668,0.1114,0.0);
+ if (index == 4) return vec3(0.3783,0.0502,0.0);
+ if (index == 5) return vec3(0.0039,0.0404,0.0473);
+ if (index == 6) return vec3(0.0246,0.0102,0.0337);
+ if (index == 7) return vec3(0.1112,0.1155,0.1155);
+ if (index == 8) return vec3(0.0090,0.1037,0.0847);
+ if (index == 9) return vec3(0.0002,0.0466,0.1037);
+ if (index == 10) return vec3(0.0,0.1550,0.0022);
+ if (index == 11) return vec3(0.0,0.0633,0.1037);
+ if (index == 12) return vec3(0.1096,0.0001,0.0);
+ if (index == 13) return vec3(0.0005,0.0002,0.1037);
+ if (index == 14) return vec3(0.0,0.0679,0.0150);
+ if (index == 15) return vec3(0.2441,0.1339,0.0);
+ }
+
+ vec3 getSecondaryColor(int index) {
+ if (index == 0) return vec3(0.0735,0.0764,0.0530);
+ if (index == 1) return vec3(0.0759,0.0817,0.0704);
+ if (index == 2) return vec3(0.0144,0.0006,0.0930);
+ if (index == 3) return vec3(0.0487,0.0663,0.0511);
+ if (index == 4) return vec3(0.0388,0.0764,0.0528);
+ if (index == 5) return vec3(0.0,0.0615,0.0548);
+ if (index == 6) return vec3(0.0394,0.0394,0.0394);
+ if (index == 7) return vec3(0.0525,0.0087,0.0095);
+ if (index == 8) return vec3(0.1038,0.1180,0.1176);
+ if (index == 9) return vec3(0.0,0.0,0.0817);
+ if (index == 10) return vec3(0.7432,0.0601,0.0);
+ if (index == 11) return vec3(0.0423,0.0651,0.0712);
+ if (index == 12) return vec3(0.0764,0.0,0.0);
+ if (index == 13) return vec3(0.0083,0.0030,0.0712);
+ if (index == 14) return vec3(0.0,0.0443,0.0042);
+ if (index == 15) return vec3(0.3510,0.0843,0.0);
+ }
// all the lighting code taken from Oolite's default fragment shader
float diffuseOrenNayar(vec3 lightVector, vec3 eyeVector, vec3 normal, float gloss, float albedoFactor)
@@ -303,8 +308,8 @@
// Begin repainting the colour texture - select the paint scheme from the two color scheme arrays
int uPaintIndex = int(uPaintColScheme);
- vec4 PaintPrimaryCol = vec4(vec3(PRIMARY_COLOR[uPaintIndex]), 1.0); // the base hull colour
- vec4 PaintSecondaryCol = vec4(vec3(SECONDARY_COLOR[uPaintIndex]), 1.00);// the overlayed painted stripes colour
+ vec4 PaintPrimaryCol = vec4(vec3(getPrimaryColor(uPaintIndex)), 1.0); // the base hull colour
+ vec4 PaintSecondaryCol = vec4(vec3(getSecondaryColor(uPaintIndex)), 1.00);// the overlayed painted stripes colour
// Mix the base paint layer and the overlayed second paint layer together
vec4 paintlayer = mix(PaintSecondaryCol, PaintPrimaryCol, PaintMask.x);
diff for the player shader Sidewinder:
Code: Select all
--- griff_SpecGloss_Sidewinder_with_shaders.oxp/Shaders/griff_SpecGloss_Sidewinder_PLAYER.fragment 2025-12-28 02:48:58.984915495 +0100
+++ "griff_SpecGloss_Sidewinder_with_shaders.oxp/Shaders/griff_SpecGloss_Sidewinder_PLAYER copy.fragment" 2025-12-28 02:48:18.409237853 +0100
@@ -53,40 +53,45 @@
const vec4 kBareMetalSpecCol = vec4(0.0301, 0.0214, 0.0106, 1.0); //blueish = 0.0201, 0.0301, 0.0296, 1.0)
const vec4 kPaintUndercoatColor = vec4(0.0031, 0.0078, 0.0133, 1.0); // a dark grey/blue 'undercoat' colour
-// Paint scheme colour arrays
- vec3 PRIMARY_COLOR[16] = vec3[](vec3(0.0243,0.0551,0.0180),
- vec3(0.1037,0.0,0.0038),
- vec3(0.1550,0.0,0.1081),
- vec3(0.3668,0.1114,0.0),
- vec3(0.3783,0.0502,0.0),
- vec3(0.0039,0.0404,0.0473),
- vec3(0.0246,0.0102,0.0337),
- vec3(0.1112,0.1155,0.1155),
- vec3(0.0090,0.1037,0.0847),
- vec3(0.0002,0.0466,0.1037),
- vec3(0.0,0.1550,0.0022),
- vec3(0.0,0.0633,0.1037),
- vec3(0.1096,0.0001,0.0),
- vec3(0.0005,0.0002,0.1037),
- vec3(0.0,0.0679,0.0150),
- vec3(0.2441,0.1339,0.0));
-
- vec3 SECONDARY_COLOR[16] = vec3[](vec3(0.0735,0.0764,0.0530),
- vec3(0.0759,0.0817,0.0704),
- vec3(0.0144,0.0006,0.0930),
- vec3(0.0487,0.0663,0.0511),
- vec3(0.0388,0.0764,0.0528),
- vec3(0.0,0.0615,0.0548),
- vec3(0.0394,0.0394,0.0394),
- vec3(0.0525,0.0087,0.0095),
- vec3(0.1038,0.1180,0.1176),
- vec3(0.0,0.0,0.0817),
- vec3(0.7432,0.0601,0.0),
- vec3(0.0423,0.0651,0.0712),
- vec3(0.0764,0.0,0.0),
- vec3(0.0083,0.0030,0.0712),
- vec3(0.0,0.0443,0.0042),
- vec3(0.3510,0.0843,0.0));
+// Paint scheme colour functions
+
+ vec3 getPrimaryColor(int index) {
+ if (index == 0) return vec3(0.0243,0.0551,0.0180);
+ if (index == 1) return vec3(0.1037,0.0,0.0038);
+ if (index == 2) return vec3(0.1550,0.0,0.1081);
+ if (index == 3) return vec3(0.3668,0.1114,0.0);
+ if (index == 4) return vec3(0.3783,0.0502,0.0);
+ if (index == 5) return vec3(0.0039,0.0404,0.0473);
+ if (index == 6) return vec3(0.0246,0.0102,0.0337);
+ if (index == 7) return vec3(0.1112,0.1155,0.1155);
+ if (index == 8) return vec3(0.0090,0.1037,0.0847);
+ if (index == 9) return vec3(0.0002,0.0466,0.1037);
+ if (index == 10) return vec3(0.0,0.1550,0.0022);
+ if (index == 11) return vec3(0.0,0.0633,0.1037);
+ if (index == 12) return vec3(0.1096,0.0001,0.0);
+ if (index == 13) return vec3(0.0005,0.0002,0.1037);
+ if (index == 14) return vec3(0.0,0.0679,0.0150);
+ if (index == 15) return vec3(0.2441,0.1339,0.0);
+ }
+
+ vec3 getSecondaryColor(int index) {
+ if (index == 0) return vec3(0.0735,0.0764,0.0530);
+ if (index == 1) return vec3(0.0759,0.0817,0.0704);
+ if (index == 2) return vec3(0.0144,0.0006,0.0930);
+ if (index == 3) return vec3(0.0487,0.0663,0.0511);
+ if (index == 4) return vec3(0.0388,0.0764,0.0528);
+ if (index == 5) return vec3(0.0,0.0615,0.0548);
+ if (index == 6) return vec3(0.0394,0.0394,0.0394);
+ if (index == 7) return vec3(0.0525,0.0087,0.0095);
+ if (index == 8) return vec3(0.1038,0.1180,0.1176);
+ if (index == 9) return vec3(0.0,0.0,0.0817);
+ if (index == 10) return vec3(0.7432,0.0601,0.0);
+ if (index == 11) return vec3(0.0423,0.0651,0.0712);
+ if (index == 12) return vec3(0.0764,0.0,0.0);
+ if (index == 13) return vec3(0.0083,0.0030,0.0712);
+ if (index == 14) return vec3(0.0,0.0443,0.0042);
+ if (index == 15) return vec3(0.3510,0.0843,0.0);
+ }
// all the lighting code taken from Oolite's default fragment shader
float diffuseOrenNayar(vec3 lightVector, vec3 eyeVector, vec3 normal, float gloss, float albedoFactor)
@@ -295,8 +300,8 @@
// Begin repainting the colour texture - select the paint scheme from the two color scheme arrays
int uPaintIndex = int(uPaintColScheme);
- vec4 PaintPrimaryCol = vec4(vec3(PRIMARY_COLOR[uPaintIndex]), 1.0); // the base hull colour
- vec4 PaintSecondaryCol = vec4(vec3(SECONDARY_COLOR[uPaintIndex]), 1.00);// the overlayed painted stripes colour
+ vec4 PaintPrimaryCol = vec4(vec3(getPrimaryColor(uPaintIndex)), 1.0); // the base hull colour
+ vec4 PaintSecondaryCol = vec4(vec3(getSecondaryColor(uPaintIndex)), 1.00);// the overlayed painted stripes colour
// Mix the base paint layer and the overlayed second paint layer together
vec4 paintlayer = mix(PaintSecondaryCol, PaintPrimaryCol, PaintMask.x);