From 6266c8a4b2485b29a7d5bcb217460d7aad3e1c4a Mon Sep 17 00:00:00 2001 From: Normand Briere <nbriere@noware.ca> Date: Sun, 25 Aug 2019 20:58:10 -0400 Subject: [PATCH] Proto version slider. --- CameraPane.java | 68 +++++++++++++++++++-------------- 1 files changed, 39 insertions(+), 29 deletions(-) diff --git a/CameraPane.java b/CameraPane.java index f2785e4..b983dd6 100644 --- a/CameraPane.java +++ b/CameraPane.java @@ -881,7 +881,7 @@ //// tris.postdraw(this); } - static Camera localcamera = new Camera(); + static Camera localAOcamera = new Camera(); static cVector from = new cVector(); static cVector to = new cVector(); @@ -890,7 +890,7 @@ CameraPane cp = this; Camera keep = cp.RenderCamera(); - cp.renderCamera = localcamera; + cp.renderCamera = localAOcamera; if (br.trimmed) { @@ -908,7 +908,7 @@ br.positions[i3 + 2] + br.normals[i3 + 2]); LA.xformPos(from, transform, from); LA.xformPos(to, transform, to); // RIGID ONLY - localcamera.setAim(from, to); + localAOcamera.setAim(from, to); CameraPane.occlusionbuffer.display(); @@ -942,7 +942,7 @@ to.set(v.x+v.norm.x, v.y+v.norm.y, v.z+v.norm.z); LA.xformPos(from, transform, from); LA.xformPos(to, transform, to); // RIGID ONLY - localcamera.setAim(from, to); + localAOcamera.setAim(from, to); CameraPane.occlusionbuffer.display(); @@ -12514,8 +12514,9 @@ String programmin = // Min shader "!!ARBfp1.0\n" + - "PARAM zero123 = { 0.0, 1.0, 2, 1.25 };" + - "PARAM pow2 = { 0.5, 0.25, 0.125, 0.0 };" + + "PARAM zero12t = { 0.0, 1.0, 2, 1.25 };" + + "PARAM pow_2 = { 0.5, 0.25, 0.125, 0.0 };" + + "PARAM pow2 = { 2, 4, 8, 0.0 };" + "PARAM one = { 1.0, 1.0, 1.0, 1.0 };" + "PARAM eps = { 0.001, 0.001, 0.001, 1.0 };" + "PARAM infinity = { 100000000, 100000000, 100000000, 1.0 };" + @@ -12530,10 +12531,11 @@ "TEMP eye;" + "TEMP pos;" + - "MAD normal, fragment.color, zero123.z, -zero123.y;" + + "MAD normal, fragment.color, zero12t.z, -zero12t.y;" + Normalize("normal") + "MOV light, state.light[0].position;" + "DP3 ndotl.x, light, normal;" + + "MAX ndotl.x, ndotl.x, zero12t.x;" + // shadow "MOV pos, fragment.texcoord[1];" + @@ -12549,7 +12551,7 @@ "MUL ndotl.x, ndotl.x, ndotl.z;" + // Shadow // Backlit - "MOV pos.w, zero123.y;" + + "MOV pos.w, zero12t.y;" + // one "DP4 eye.x, pos, light2cam0;" + "DP4 eye.y, pos, light2cam1;" + "DP4 eye.z, pos, light2cam2;" + @@ -12557,24 +12559,28 @@ "DP3 ndotl.y, -eye, normal;" + //"MUL ndotl.y, ndotl.y, pow2.x;" + - "POW ndotl.y, ndotl.y, pow2.z;" + // backlit - "SUB ndotl.y, zero123.y, ndotl.y;" + + "POW ndotl.y, ndotl.y, pow2.x;" + // backlit + "SUB ndotl.y, zero12t.y, ndotl.y;" + // 1 - y + //"POW ndotl.y, ndotl.y, pow2.z;" + // backlit //"SUB ndotl.y, zero123.y, ndotl.y;" + //"MUL ndotl.y, ndotl.y, pow2.z;" + + "ADD ndotl.y, ndotl.y, one.x;" + + "MUL ndotl.y, ndotl.y, pow_2.x;" + //"MAX ndotl.x, ndotl.x, ndotl.y;" + // Ambient //"MAX ndotl.x, ndotl.x, pow2.y;" + // Ambient // Pigment "TEX temp, fragment.texcoord[0], texture[0], 2D;" + - "LRP temp, zero123.w, temp, one;" + // texture proportion - "MUL temp, temp, ndotl.x;" + - - "MUL temp, temp, zero123.z;" + + "LRP temp, zero12t.w, temp, one;" + // texture proportion + "MUL temp, temp, zero12t.w;" + // Times x //"MUL temp, temp, ndotl.y;" + + "MAD ndotl.x, pow_2.xxxx, ndotl.yyyy, ndotl.x;" + - "MOV temp.w, zero123.y;" + // reset alpha + "MUL temp, temp, ndotl.x;" + // lambert + + "MOV temp.w, zero12t.y;" + // reset alpha "MOV result.color, temp;" + "END"; @@ -12946,12 +12952,7 @@ "ADD temp.x, temp.x, one.x;" + "MUL normal, normal, temp.xxxx;":"" ) + - /**/ -//// Normalize("normal") + -//// "MAX normal.z, eps.x, normal.z;" + -// Normalize("normal") + - "MOV normald, normal;" + - "MOV normals, normal;" + + /**/ "MOV temp, fragment.texcoord[4];" + @@ -12969,6 +12970,17 @@ "XPD U, V, normal;" + Normalize("U") + + "MOV temp, fragment.texcoord[0];" + + +// "MAD normal, -temp.x, U, normal;" + +// "MAD normal, -temp.y, V, normal;" + +// Normalize("normal") + + +//// "MAX normal.z, eps.x, normal.z;" + +// Normalize("normal") + + "MOV normald, normal;" + + "MOV normals, normal;" + + // parallax mapping "DP3 temp2.x, V, eye;" + @@ -12981,17 +12993,15 @@ "RCP temp2.w, temp2.w;" + "SUB temp2.w, temp2.w, half;" + -// "SGE temp.x, temp2.w, eps.x;" + -// "MUL temp2.w, temp2.w, temp.x;" + + // "SGE temp.x, temp2.w, eps.x;" + + // "MUL temp2.w, temp2.w, temp.x;" + - //"MOV texSamp, U;" + + // "MOV texSamp, U;" + "MUL temp2.z, temp2.z, temp2.w;" + "MUL temp2.z, temp2.z, params7.z;" + // parallax "MUL temp2, temp2, temp2.z;" + - - "MOV temp, fragment.texcoord[0];" + "SUB temp, temp, temp2;" + @@ -14726,8 +14736,8 @@ } } PingThread pingthread = new PingThread(); - int delta = 5; - int speed = 5; + int delta = 2; + int speed = 10; boolean autorepeat = false; void GoDown(int mod) @@ -15504,7 +15514,7 @@ repaint(); break; case 'O': - Globals.drawMode = OCCLUSION; // WARNING + // Too dangerous. Use menu. Globals.drawMode = OCCLUSION; // WARNING repaint(); break; case 'o': -- Gitblit v1.6.2