Normand Briere
2019-08-20 564f4d12d93813b5d680fc24d4f118c3886d96ed
cMaterial.java
....@@ -34,6 +34,7 @@
3434 shadow = val;
3535 texture = val;
3636 opacity = val;
37
+ parallax = val;
3738 fakedepth = val;
3839 shadowbias = val;
3940 }
....@@ -71,6 +72,7 @@
7172 shadow = mat.shadow;
7273 texture = mat.texture;
7374 opacity = mat.opacity;
75
+ parallax = mat.parallax;
7476 fakedepth = mat.fakedepth;
7577 shadowbias = mat.shadowbias;
7678
....@@ -79,7 +81,8 @@
7981
8082 void UpdateMaterial(cMaterial anchor, cMaterial current)
8183 {
82
- color *= Factor(anchor.color, current.color);
84
+ //color *= Factor(anchor.color, current.color);
85
+ color = current.color;
8386 //if (anchor.saturation == 0)
8487 // anchor.saturation = 0.001f;
8588 if (anchor.modulation == 0)
....@@ -104,265 +107,268 @@
104107 shadow *= Factor(anchor.shadow, current.shadow);
105108 texture *= Factor(anchor.texture, current.texture);
106109 opacity *= Factor(anchor.opacity, current.opacity);
110
+// if (anchor.parallax == 0)
111
+// anchor.parallax = 0.001f;
112
+ //parallax *= Factor(anchor.parallax, current.parallax);
113
+ parallax = current.parallax;
107114 fakedepth *= Factor(anchor.fakedepth, current.fakedepth);
108115 shadowbias *= Factor(anchor.shadowbias, current.shadowbias);
109116 }
110117
111118 float Factor(float anchor, float current)
112119 {
113
- if (anchor <= 0)
114
- {
115
- assert anchor > 0;
116
- }
120
+ Grafreed.Assert(anchor > 0);
117121
118122 return current / anchor;
119123 }
120124
121
- void Draw(CameraPane display, boolean selected)
122
- {
123
- //new Exception().printStackTrace();
124
-
125
- if (display.IsFrozen() && !selected || display.ambientOcclusion) // || display.drawMode == display.SHADOW)
126
- {
127
- return;
128
- }
129
-
130
- javax.media.opengl.GL gl = display.GetGL();
131
-
132
- //Color col = Color.getHSBColor(color,modulation,1);
133
- //col.getColorComponents(ColorSpace.getInstance(ColorSpace.CS_LINEAR_RGB), CameraPane.modelParams0);
134
- if (!multiply)
135
- {
136
- display.color = color;
137
- display.saturation = modulation;
138
- }
139
- else
140
- {
141
- display.color *= color*2;
142
- display.saturation *= modulation*2;
143
- }
144
-
145
- cColor.HSBtoRGB(display.color, display.saturation, 1, display.modelParams0);
146
-
147
- float[] colorV = GrafreeD.colorV;
148
-
149
- /**/
150
- if (display.drawMode == display.DEFAULT) // && display.RENDERPROGRAM == 0)
151
- {
152
- colorV[0] = display.modelParams0[0] * diffuse;
153
- colorV[1] = display.modelParams0[1] * diffuse;
154
- colorV[2] = display.modelParams0[2] * diffuse;
155
- colorV[3] = opacity;
156
-
157
- gl.glColor4f(colorV[0], colorV[1], colorV[2], opacity);
158
- //System.out.println("Opacity = " + opacity);
159
-
160
- gl.glMaterialfv(gl.GL_FRONT, gl.GL_DIFFUSE, colorV, 0);
161
- //color[0] /= 2; color[1] /= 2; color[2] /= 2;
162
- gl.glMaterialfv(gl.GL_BACK, gl.GL_DIFFUSE, colorV, 0);
163
-
164
- float amb = ambient;
165
- if (amb < cameralight)
166
- {
167
- amb = cameralight;
168
- }
169
- colorV[0] = display.modelParams0[0] * diffuse * amb;
170
- colorV[1] = display.modelParams0[1] * diffuse * amb;
171
- colorV[2] = display.modelParams0[2] * diffuse * amb;
172
- gl.glMaterialfv(gl.GL_FRONT, gl.GL_AMBIENT, colorV, 0);
173
- //color[0] /= 2; color[1] /= 2; color[2] /= 2;
174
- gl.glMaterialfv(gl.GL_BACK, gl.GL_AMBIENT, colorV, 0);
175
-
176
- /**/
177
- colorV[0] = ((1 - metalness) + display.modelParams0[0] * metalness) * specular;
178
- colorV[1] = ((1 - metalness) + display.modelParams0[1] * metalness) * specular;
179
- colorV[2] = ((1 - metalness) + display.modelParams0[2] * metalness) * specular;
180
- gl.glMaterialfv(gl.GL_FRONT, gl.GL_SPECULAR, colorV, 0);
181
- //color[0] /= 2; color[1] /= 2; color[2] /= 2;
182
- gl.glMaterialfv(gl.GL_BACK, gl.GL_SPECULAR, colorV, 0);
183
- colorV[0] = 10 / shininess; // 1/0.005f;
184
- //System.out.println("shininess = " + colorV[0]);
185
- if (colorV[0] > 128)
186
- {
187
- colorV[0] = 128;
188
- }
189
- gl.glMaterialfv(gl.GL_FRONT, gl.GL_SHININESS, colorV, 0);
190
- gl.glMaterialfv(gl.GL_BACK, gl.GL_SHININESS, colorV, 0);
191
- /**/
192
- }
193
- /**/
194
-
195
- //selected = false;
196
- selected = selected && display.flash;
197
-
198
- //display.modelParams0[0] = 0; // pigment.r;
199
- //display.modelParams0[1] = 0; // pigment.g;
200
- //display.modelParams0[2] = 0; // pigment.b;
201
- if (!multiply)
202
- {
203
- display.modelParams0[3] = metalness;
204
- display.modelParams1[0] = diffuse;
205
- display.modelParams1[1] = specular;
206
- display.modelParams1[2] = 1 / shininess;
207
- display.modelParams1[3] = shift;
208
- display.modelParams2[0] = ambient;
209
- display.modelParams2[1] = lightarea;
210
- //System.out.println("light area = " + lightarea);
211
- display.modelParams2[2] = 1 / factor; // diffuseness
212
- display.modelParams2[3] = velvet;
213
- display.modelParams3[0] = sheen;
214
- display.modelParams3[1] = subsurface;
215
- display.modelParams3[2] = bump; // backlit
216
- display.modelParams3[3] = aniso;
217
- display.modelParams4[0] = anisoV;
218
- display.modelParams4[1] = selected ? 100 : cameralight;
219
- //System.out.println("selected = " + selected);
220
- display.modelParams4[2] = diffuseness;
221
- display.modelParams4[3] = shadow;
222
- display.modelParams5[0] = texture;
223
- display.modelParams5[1] = opacity;
224
- display.modelParams5[2] = fakedepth;
225
- display.modelParams5[3] = CameraPane.SHADOWCULLFACE ? 0f : (shadowbias - 0.005f) / 10;
226
- }
227
- else
228
- {
229
- display.modelParams0[3] *= metalness*2;
230
- display.modelParams1[0] *= diffuse*2;
231
- display.modelParams1[1] *= specular*2;
232
- display.modelParams1[2] *= shininess*2;
233
- display.modelParams1[3] *= shift*2;
234
- display.modelParams2[0] *= ambient*2;
235
- display.modelParams2[1] *= lightarea*2;
236
- display.modelParams2[2] *= factor*2;
237
- display.modelParams2[3] *= velvet*2;
238
- display.modelParams3[0] *= sheen*2;
239
- display.modelParams3[1] *= subsurface*2;
240
- display.modelParams3[2] *= bump*2;
241
- display.modelParams3[3] *= aniso*2;
242
- display.modelParams4[0] *= anisoV*2;
243
- display.modelParams4[1] *= cameralight*2;
244
- //System.out.println("selected = " + selected);
245
- display.modelParams4[2] *= diffuseness*2;
246
- display.modelParams4[3] *= shadow*2;
247
- display.modelParams5[0] *= texture*2;
248
- display.modelParams5[1] *= opacity*2;
249
- display.modelParams5[2] *= fakedepth*2;
250
- display.modelParams5[3] *= shadowbias*2;
251
- }
252
-
253
- display.modelParams6[0] = 0;
254
- display.modelParams6[1] = 0;
255
- display.modelParams6[2] = 0;
256
- display.modelParams6[3] = 0;
257
-
258
- display.modelParams7[0] = 0;
259
- display.modelParams7[1] = 1000;
260
- display.modelParams7[2] = 0;
261
- display.modelParams7[3] = 0;
262
-
263
- display.modelParams6[0] = 100; // criss de bug de bump
264
-
265
- Object3D.cVector2[] extparams = display.vector2buffer;
266
- if (extparams != null && extparams.length > 0 && extparams[0] != null)
267
- {
268
- display.modelParams6[0] = extparams[0].x / 1000.0f; // bump
269
- display.modelParams6[1] = extparams[0].y / 1000.0f; // noise
270
- if (extparams.length > 1)
271
- {
272
- display.modelParams6[2] = extparams[1].x / 1000.0f; // borderfade
273
- display.modelParams6[3] = extparams[1].y / 1000.0f; // (float)Math.exp(-extparams[1].y / 1000.0f); // fog punchthrough
274
- if (extparams.length > 2)
275
- {
276
- display.modelParams7[0] = extparams[2].x / 1000.0f; // noise power
277
- float x = extparams[2].y / 1000.0f;
278
- //if (x == 0)
279
- // x = 1f;
280
- display.modelParams7[1] = 1 / x / x / x / x / x / x / x / x / x / x / x / x / x; // (float)Math.pow(-Math.log((extparams[2].y+0.00) / 1000.0f), 1); // opacity power
281
- if (extparams[2].y > 0)
282
- {
283
- //System.out.println("extparams[1].y = " + extparams[1].y);
284
- //System.out.println("extparams[2].y = " + extparams[2].y);
285
- //System.out.println("opacity power = " + display.modelParams7[1]);
286
- }
287
- }
288
- }
289
- }
290
-
291
- //if (display.modelParams6[2] != 0)
292
- /*
293
- System.out.println("modelParams0[0] = " + display.modelParams0[0]);
294
- System.out.println("modelParams0[1] = " + display.modelParams0[1]);
295
- System.out.println("modelParams0[2] = " + display.modelParams0[2]);
296
- System.out.println("modelParams0[3] = " + display.modelParams0[3]);
297
- System.out.println("modelParams1[0] = " + display.modelParams1[0]);
298
- System.out.println("modelParams1[1] = " + display.modelParams1[1]);
299
- System.out.println("modelParams1[2] = " + display.modelParams1[2]);
300
- System.out.println("modelParams1[3] = " + display.modelParams1[3]);
301
- System.out.println("modelParams2[0] = " + display.modelParams2[0]);
302
- System.out.println("modelParams2[1] = " + display.modelParams2[1]);
303
- System.out.println("modelParams2[2] = " + display.modelParams2[2]);
304
- System.out.println("modelParams2[3] = " + display.modelParams2[3]);
305
- System.out.println("modelParams3[0] = " + display.modelParams3[0]);
306
- System.out.println("modelParams3[1] = " + display.modelParams3[1]);
307
- System.out.println("modelParams3[2] = " + display.modelParams3[2]);
308
- System.out.println("modelParams3[3] = " + display.modelParams3[3]);
309
- System.out.println("modelParams4[0] = " + display.modelParams4[0]);
310
- System.out.println("modelParams4[1] = " + display.modelParams4[1]);
311
- System.out.println("modelParams4[2] = " + display.modelParams4[2]);
312
- System.out.println("modelParams4[3] = " + display.modelParams4[3]);
313
- System.out.println("modelParams5[0] = " + display.modelParams5[0]);
314
- System.out.println("modelParams5[1] = " + display.modelParams5[1]);
315
- System.out.println("modelParams5[2] = " + display.modelParams5[2]);
316
- System.out.println("modelParams5[3] = " + display.modelParams5[3]);
317
- System.out.println("modelParams6[0] = " + display.modelParams6[0]);
318
- System.out.println("modelParams6[1] = " + display.modelParams6[1]);
319
- System.out.println("modelParams6[2] = " + display.modelParams6[2]);
320
- System.out.println("modelParams6[3] = " + display.modelParams6[3]);
321
- System.out.println("modelParams7[0] = " + display.modelParams7[0]);
322
- System.out.println("modelParams7[1] = " + display.modelParams7[1]);
323
- System.out.println("modelParams7[2] = " + display.modelParams7[2]);
324
- System.out.println("modelParams7[3] = " + display.modelParams7[3]);
325
- /**/
326
- //assert (display.modelParams6[2] == 0);
327
-
328
- //System.out.println("noise power = " + display.modelParams7[0]);
329
- //System.out.println("shadowbias = " + shadowbias);
330
-
331
- gl.glProgramEnvParameter4fvARB(gl.GL_FRAGMENT_PROGRAM_ARB, 0, display.modelParams0, 0);
332
- gl.glProgramEnvParameter4fvARB(gl.GL_FRAGMENT_PROGRAM_ARB, 1, display.modelParams1, 0);
333
- gl.glProgramEnvParameter4fvARB(gl.GL_FRAGMENT_PROGRAM_ARB, 2, display.modelParams2, 0);
334
- gl.glProgramEnvParameter4fvARB(gl.GL_FRAGMENT_PROGRAM_ARB, 3, display.modelParams3, 0);
335
- gl.glProgramEnvParameter4fvARB(gl.GL_FRAGMENT_PROGRAM_ARB, 4, display.modelParams4, 0);
336
- gl.glProgramEnvParameter4fvARB(gl.GL_FRAGMENT_PROGRAM_ARB, 5, display.modelParams5, 0);
337
- gl.glProgramEnvParameter4fvARB(gl.GL_FRAGMENT_PROGRAM_ARB, 6, display.modelParams6, 0);
338
- gl.glProgramEnvParameter4fvARB(gl.GL_FRAGMENT_PROGRAM_ARB, 7, display.modelParams7, 0);
339
-
340
- int mode = display.FP_SHADER;
341
-
342
- if (aniso != anisoV || aniso > 0.002)
343
- {
344
- mode |= display.FP_ANISO;
345
- }
346
-
347
- display.EnableProgram(mode);
348
-
349
- //System.out.println("opacity power = " + display.modelParams7[1]);
350
-
351
- if (!multiply)
352
- {
353
- if (display.drawMode == CameraPane.SHADOW)
354
- gl.glDepthMask(opacity >= 0.9 && display.modelParams7[1] > 0.1);
355
- else
356
- gl.glDepthMask(opacity >= 0.99);
357
- }
358
- }
125
+// void Draw(iCameraPane display, boolean selected)
126
+// {
127
+// //new Exception().printStackTrace();
128
+//
129
+// if (display.IsFrozen() && !selected || display.IsAmbientOcclusionOn()) // || display.drawMode == display.SHADOW)
130
+// {
131
+// return;
132
+// }
133
+//
134
+// javax.media.opengl.GL gl = display.GetGL();
135
+//
136
+// //Color col = Color.getHSBColor(color,modulation,1);
137
+// //col.getColorComponents(ColorSpace.getInstance(ColorSpace.CS_LINEAR_RGB), CameraPane.modelParams0);
138
+// if (!multiply)
139
+// {
140
+// display.color = color;
141
+// display.saturation = modulation;
142
+// }
143
+// else
144
+// {
145
+// display.color *= color*2;
146
+// display.saturation *= modulation*2;
147
+// }
148
+//
149
+// cColor.HSBtoRGB(display.color, display.saturation, 1, display.modelParams0);
150
+//
151
+// float[] colorV = GrafreeD.colorV;
152
+//
153
+// /**/
154
+// if (display.drawMode == display.DEFAULT) // && display.RENDERPROGRAM == 0)
155
+// {
156
+// colorV[0] = display.modelParams0[0] * diffuse;
157
+// colorV[1] = display.modelParams0[1] * diffuse;
158
+// colorV[2] = display.modelParams0[2] * diffuse;
159
+// colorV[3] = opacity;
160
+//
161
+// gl.glColor4f(colorV[0], colorV[1], colorV[2], opacity);
162
+// //System.out.println("Opacity = " + opacity);
163
+//
164
+// gl.glMaterialfv(gl.GL_FRONT, gl.GL_DIFFUSE, colorV, 0);
165
+// //color[0] /= 2; color[1] /= 2; color[2] /= 2;
166
+// gl.glMaterialfv(gl.GL_BACK, gl.GL_DIFFUSE, colorV, 0);
167
+//
168
+// float amb = ambient;
169
+// if (amb < cameralight)
170
+// {
171
+// amb = cameralight;
172
+// }
173
+// colorV[0] = display.modelParams0[0] * diffuse * amb;
174
+// colorV[1] = display.modelParams0[1] * diffuse * amb;
175
+// colorV[2] = display.modelParams0[2] * diffuse * amb;
176
+// gl.glMaterialfv(gl.GL_FRONT, gl.GL_AMBIENT, colorV, 0);
177
+// //color[0] /= 2; color[1] /= 2; color[2] /= 2;
178
+// gl.glMaterialfv(gl.GL_BACK, gl.GL_AMBIENT, colorV, 0);
179
+//
180
+// /**/
181
+// colorV[0] = ((1 - metalness) + display.modelParams0[0] * metalness) * specular;
182
+// colorV[1] = ((1 - metalness) + display.modelParams0[1] * metalness) * specular;
183
+// colorV[2] = ((1 - metalness) + display.modelParams0[2] * metalness) * specular;
184
+// gl.glMaterialfv(gl.GL_FRONT, gl.GL_SPECULAR, colorV, 0);
185
+// //color[0] /= 2; color[1] /= 2; color[2] /= 2;
186
+// gl.glMaterialfv(gl.GL_BACK, gl.GL_SPECULAR, colorV, 0);
187
+// colorV[0] = 10 / shininess; // 1/0.005f;
188
+// //System.out.println("shininess = " + colorV[0]);
189
+// if (colorV[0] > 128)
190
+// {
191
+// colorV[0] = 128;
192
+// }
193
+// gl.glMaterialfv(gl.GL_FRONT, gl.GL_SHININESS, colorV, 0);
194
+// gl.glMaterialfv(gl.GL_BACK, gl.GL_SHININESS, colorV, 0);
195
+// /**/
196
+// }
197
+// /**/
198
+//
199
+// //selected = false;
200
+// selected = selected && display.flash;
201
+//
202
+// //display.modelParams0[0] = 0; // pigment.r;
203
+// //display.modelParams0[1] = 0; // pigment.g;
204
+// //display.modelParams0[2] = 0; // pigment.b;
205
+// if (!multiply)
206
+// {
207
+// display.modelParams0[3] = metalness;
208
+// display.modelParams1[0] = diffuse;
209
+// display.modelParams1[1] = specular;
210
+// display.modelParams1[2] = 1 / shininess;
211
+// display.modelParams1[3] = shift;
212
+// display.modelParams2[0] = ambient;
213
+// display.modelParams2[1] = lightarea;
214
+// //System.out.println("light area = " + lightarea);
215
+// display.modelParams2[2] = 1 / factor; // diffuseness
216
+// display.modelParams2[3] = velvet;
217
+// display.modelParams3[0] = sheen;
218
+// display.modelParams3[1] = subsurface;
219
+// display.modelParams3[2] = bump; // backlit
220
+// display.modelParams3[3] = aniso;
221
+// display.modelParams4[0] = anisoV;
222
+// display.modelParams4[1] = selected ? 100 : cameralight;
223
+// //System.out.println("selected = " + selected);
224
+// display.modelParams4[2] = diffuseness;
225
+// display.modelParams4[3] = shadow;
226
+// display.modelParams5[0] = texture;
227
+// display.modelParams5[1] = opacity;
228
+// display.modelParams5[2] = fakedepth;
229
+// display.modelParams5[3] = CameraPane.SHADOWCULLFACE ? 0f : (shadowbias - 0.005f) / 10;
230
+// }
231
+// else
232
+// {
233
+// display.modelParams0[3] *= metalness*2;
234
+// display.modelParams1[0] *= diffuse*2;
235
+// display.modelParams1[1] *= specular*2;
236
+// display.modelParams1[2] *= shininess*2;
237
+// display.modelParams1[3] *= shift*2;
238
+// display.modelParams2[0] *= ambient*2;
239
+// display.modelParams2[1] *= lightarea*2;
240
+// display.modelParams2[2] *= factor*2;
241
+// display.modelParams2[3] *= velvet*2;
242
+// display.modelParams3[0] *= sheen*2;
243
+// display.modelParams3[1] *= subsurface*2;
244
+// display.modelParams3[2] *= bump*2;
245
+// display.modelParams3[3] *= aniso*2;
246
+// display.modelParams4[0] *= anisoV*2;
247
+// display.modelParams4[1] *= cameralight*2;
248
+// //System.out.println("selected = " + selected);
249
+// display.modelParams4[2] *= diffuseness*2;
250
+// display.modelParams4[3] *= shadow*2;
251
+// display.modelParams5[0] *= texture*2;
252
+// display.modelParams5[1] *= opacity*2;
253
+// display.modelParams5[2] *= fakedepth*2;
254
+// display.modelParams5[3] *= shadowbias*2;
255
+// }
256
+//
257
+// display.modelParams6[0] = 0;
258
+// display.modelParams6[1] = 0;
259
+// display.modelParams6[2] = 0;
260
+// display.modelParams6[3] = 0;
261
+//
262
+// display.modelParams7[0] = 0;
263
+// display.modelParams7[1] = 1000;
264
+// display.modelParams7[2] = 0;
265
+// display.modelParams7[3] = 0;
266
+//
267
+// display.modelParams6[0] = 100; // criss de bug de bump
268
+//
269
+// Object3D.cVector2[] extparams = display.vector2buffer;
270
+// if (extparams != null && extparams.length > 0 && extparams[0] != null)
271
+// {
272
+// display.modelParams6[0] = extparams[0].x / 1000.0f; // bump
273
+// display.modelParams6[1] = extparams[0].y / 1000.0f; // noise
274
+// if (extparams.length > 1)
275
+// {
276
+// display.modelParams6[2] = extparams[1].x / 1000.0f; // borderfade
277
+// display.modelParams6[3] = extparams[1].y / 1000.0f; // (float)Math.exp(-extparams[1].y / 1000.0f); // fog punchthrough
278
+// if (extparams.length > 2)
279
+// {
280
+// display.modelParams7[0] = extparams[2].x / 1000.0f; // noise power
281
+// float x = extparams[2].y / 1000.0f;
282
+// //if (x == 0)
283
+// // x = 1f;
284
+// display.modelParams7[1] = 1 / x / x / x / x / x / x / x / x / x / x / x / x / x; // (float)Math.pow(-Math.log((extparams[2].y+0.00) / 1000.0f), 1); // opacity power
285
+// if (extparams[2].y > 0)
286
+// {
287
+// //System.out.println("extparams[1].y = " + extparams[1].y);
288
+// //System.out.println("extparams[2].y = " + extparams[2].y);
289
+// //System.out.println("opacity power = " + display.modelParams7[1]);
290
+// }
291
+// }
292
+// }
293
+// }
294
+//
295
+// //if (display.modelParams6[2] != 0)
296
+// /*
297
+// System.out.println("modelParams0[0] = " + display.modelParams0[0]);
298
+// System.out.println("modelParams0[1] = " + display.modelParams0[1]);
299
+// System.out.println("modelParams0[2] = " + display.modelParams0[2]);
300
+// System.out.println("modelParams0[3] = " + display.modelParams0[3]);
301
+// System.out.println("modelParams1[0] = " + display.modelParams1[0]);
302
+// System.out.println("modelParams1[1] = " + display.modelParams1[1]);
303
+// System.out.println("modelParams1[2] = " + display.modelParams1[2]);
304
+// System.out.println("modelParams1[3] = " + display.modelParams1[3]);
305
+// System.out.println("modelParams2[0] = " + display.modelParams2[0]);
306
+// System.out.println("modelParams2[1] = " + display.modelParams2[1]);
307
+// System.out.println("modelParams2[2] = " + display.modelParams2[2]);
308
+// System.out.println("modelParams2[3] = " + display.modelParams2[3]);
309
+// System.out.println("modelParams3[0] = " + display.modelParams3[0]);
310
+// System.out.println("modelParams3[1] = " + display.modelParams3[1]);
311
+// System.out.println("modelParams3[2] = " + display.modelParams3[2]);
312
+// System.out.println("modelParams3[3] = " + display.modelParams3[3]);
313
+// System.out.println("modelParams4[0] = " + display.modelParams4[0]);
314
+// System.out.println("modelParams4[1] = " + display.modelParams4[1]);
315
+// System.out.println("modelParams4[2] = " + display.modelParams4[2]);
316
+// System.out.println("modelParams4[3] = " + display.modelParams4[3]);
317
+// System.out.println("modelParams5[0] = " + display.modelParams5[0]);
318
+// System.out.println("modelParams5[1] = " + display.modelParams5[1]);
319
+// System.out.println("modelParams5[2] = " + display.modelParams5[2]);
320
+// System.out.println("modelParams5[3] = " + display.modelParams5[3]);
321
+// System.out.println("modelParams6[0] = " + display.modelParams6[0]);
322
+// System.out.println("modelParams6[1] = " + display.modelParams6[1]);
323
+// System.out.println("modelParams6[2] = " + display.modelParams6[2]);
324
+// System.out.println("modelParams6[3] = " + display.modelParams6[3]);
325
+// System.out.println("modelParams7[0] = " + display.modelParams7[0]);
326
+// System.out.println("modelParams7[1] = " + display.modelParams7[1]);
327
+// System.out.println("modelParams7[2] = " + display.modelParams7[2]);
328
+// System.out.println("modelParams7[3] = " + display.modelParams7[3]);
329
+// /**/
330
+// //assert (display.modelParams6[2] == 0);
331
+//
332
+// //System.out.println("noise power = " + display.modelParams7[0]);
333
+// //System.out.println("shadowbias = " + shadowbias);
334
+//
335
+// gl.glProgramEnvParameter4fvARB(gl.GL_FRAGMENT_PROGRAM_ARB, 0, display.modelParams0, 0);
336
+// gl.glProgramEnvParameter4fvARB(gl.GL_FRAGMENT_PROGRAM_ARB, 1, display.modelParams1, 0);
337
+// gl.glProgramEnvParameter4fvARB(gl.GL_FRAGMENT_PROGRAM_ARB, 2, display.modelParams2, 0);
338
+// gl.glProgramEnvParameter4fvARB(gl.GL_FRAGMENT_PROGRAM_ARB, 3, display.modelParams3, 0);
339
+// gl.glProgramEnvParameter4fvARB(gl.GL_FRAGMENT_PROGRAM_ARB, 4, display.modelParams4, 0);
340
+// gl.glProgramEnvParameter4fvARB(gl.GL_FRAGMENT_PROGRAM_ARB, 5, display.modelParams5, 0);
341
+// gl.glProgramEnvParameter4fvARB(gl.GL_FRAGMENT_PROGRAM_ARB, 6, display.modelParams6, 0);
342
+// gl.glProgramEnvParameter4fvARB(gl.GL_FRAGMENT_PROGRAM_ARB, 7, display.modelParams7, 0);
343
+//
344
+// int mode = display.FP_SHADER;
345
+//
346
+// if (aniso != anisoV || aniso > 0.002)
347
+// {
348
+// mode |= display.FP_ANISO;
349
+// }
350
+//
351
+// display.EnableProgram(mode);
352
+//
353
+// //System.out.println("opacity power = " + display.modelParams7[1]);
354
+//
355
+// if (!multiply)
356
+// {
357
+// if (display.drawMode == CameraPane.SHADOW)
358
+// gl.glDepthMask(opacity >= 0.9 && display.modelParams7[1] > 0.1);
359
+// else
360
+// gl.glDepthMask(opacity >= 0.99);
361
+// }
362
+// }
359363
360364 float color = 0.5f, modulation /*SATURATION*/ = 0.001f, metalness = 0.001f;
361365 float diffuse = 0.75f, specular = 0.25f, shininess = 0.75f, shift = 1;
362366 float ambient = 0.001f, lightarea = 0.025f, factor = 0.001f, velvet = 0.001f;
363367 float sheen = 1f, subsurface = 0.001f, bump = 0.75f, aniso = 0.001f, anisoV = 0.001f;
364
- float cameralight = 0.2f, diffuseness = 0.001f, shadow = 5f, texture = 1f, opacity = 1;
368
+ float cameralight = 0.3f, diffuseness = 0.001f, shadow = 5f, texture = 1f, opacity = 1;
365369 float fakedepth = 0.5f, shadowbias = 0.01f; // 0.001f;
370
+
371
+ float parallax = 0;
366372
367373 boolean multiply;
368374