Normand Briere
2019-09-18 f9325048496d7cdbcad233f8a6b84c88e79adcc2
cMaterial.java
....@@ -34,13 +34,13 @@
3434 shadow = val;
3535 texture = val;
3636 opacity = val;
37
+ parallax = val;
3738 fakedepth = val;
3839 shadowbias = val;
3940 }
4041
4142 public cMaterial(cMaterial mat)
4243 {
43
- this();
4444 if (mat != null)
4545 {
4646 Set(mat);
....@@ -71,6 +71,7 @@
7171 shadow = mat.shadow;
7272 texture = mat.texture;
7373 opacity = mat.opacity;
74
+ parallax = mat.parallax;
7475 fakedepth = mat.fakedepth;
7576 shadowbias = mat.shadowbias;
7677
....@@ -79,7 +80,8 @@
7980
8081 void UpdateMaterial(cMaterial anchor, cMaterial current)
8182 {
82
- color *= Factor(anchor.color, current.color);
83
+ //color *= Factor(anchor.color, current.color);
84
+ color = current.color;
8385 //if (anchor.saturation == 0)
8486 // anchor.saturation = 0.001f;
8587 if (anchor.modulation == 0)
....@@ -104,265 +106,268 @@
104106 shadow *= Factor(anchor.shadow, current.shadow);
105107 texture *= Factor(anchor.texture, current.texture);
106108 opacity *= Factor(anchor.opacity, current.opacity);
109
+// if (anchor.parallax == 0)
110
+// anchor.parallax = 0.001f;
111
+ //parallax *= Factor(anchor.parallax, current.parallax);
112
+ parallax = current.parallax;
107113 fakedepth *= Factor(anchor.fakedepth, current.fakedepth);
108114 shadowbias *= Factor(anchor.shadowbias, current.shadowbias);
109115 }
110116
111117 float Factor(float anchor, float current)
112118 {
113
- if (anchor <= 0)
114
- {
115
- assert anchor > 0;
116
- }
119
+ Grafreed.Assert(anchor > 0);
117120
118121 return current / anchor;
119122 }
120123
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 = GraphreeD.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
- }
124
+// void Draw(iCameraPane display, boolean selected)
125
+// {
126
+// //new Exception().printStackTrace();
127
+//
128
+// if (display.IsFrozen() && !selected || display.IsAmbientOcclusionOn()) // || display.drawMode == display.SHADOW)
129
+// {
130
+// return;
131
+// }
132
+//
133
+// javax.media.opengl.GL gl = display.GetGL();
134
+//
135
+// //Color col = Color.getHSBColor(color,modulation,1);
136
+// //col.getColorComponents(ColorSpace.getInstance(ColorSpace.CS_LINEAR_RGB), CameraPane.modelParams0);
137
+// if (!multiply)
138
+// {
139
+// display.color = color;
140
+// display.saturation = modulation;
141
+// }
142
+// else
143
+// {
144
+// display.color *= color*2;
145
+// display.saturation *= modulation*2;
146
+// }
147
+//
148
+// cColor.HSBtoRGB(display.color, display.saturation, 1, display.modelParams0);
149
+//
150
+// float[] colorV = GrafreeD.colorV;
151
+//
152
+// /**/
153
+// if (display.drawMode == display.DEFAULT) // && display.RENDERPROGRAM == 0)
154
+// {
155
+// colorV[0] = display.modelParams0[0] * diffuse;
156
+// colorV[1] = display.modelParams0[1] * diffuse;
157
+// colorV[2] = display.modelParams0[2] * diffuse;
158
+// colorV[3] = opacity;
159
+//
160
+// gl.glColor4f(colorV[0], colorV[1], colorV[2], opacity);
161
+// //System.out.println("Opacity = " + opacity);
162
+//
163
+// gl.glMaterialfv(gl.GL_FRONT, gl.GL_DIFFUSE, colorV, 0);
164
+// //color[0] /= 2; color[1] /= 2; color[2] /= 2;
165
+// gl.glMaterialfv(gl.GL_BACK, gl.GL_DIFFUSE, colorV, 0);
166
+//
167
+// float amb = ambient;
168
+// if (amb < cameralight)
169
+// {
170
+// amb = cameralight;
171
+// }
172
+// colorV[0] = display.modelParams0[0] * diffuse * amb;
173
+// colorV[1] = display.modelParams0[1] * diffuse * amb;
174
+// colorV[2] = display.modelParams0[2] * diffuse * amb;
175
+// gl.glMaterialfv(gl.GL_FRONT, gl.GL_AMBIENT, colorV, 0);
176
+// //color[0] /= 2; color[1] /= 2; color[2] /= 2;
177
+// gl.glMaterialfv(gl.GL_BACK, gl.GL_AMBIENT, colorV, 0);
178
+//
179
+// /**/
180
+// colorV[0] = ((1 - metalness) + display.modelParams0[0] * metalness) * specular;
181
+// colorV[1] = ((1 - metalness) + display.modelParams0[1] * metalness) * specular;
182
+// colorV[2] = ((1 - metalness) + display.modelParams0[2] * metalness) * specular;
183
+// gl.glMaterialfv(gl.GL_FRONT, gl.GL_SPECULAR, colorV, 0);
184
+// //color[0] /= 2; color[1] /= 2; color[2] /= 2;
185
+// gl.glMaterialfv(gl.GL_BACK, gl.GL_SPECULAR, colorV, 0);
186
+// colorV[0] = 10 / shininess; // 1/0.005f;
187
+// //System.out.println("shininess = " + colorV[0]);
188
+// if (colorV[0] > 128)
189
+// {
190
+// colorV[0] = 128;
191
+// }
192
+// gl.glMaterialfv(gl.GL_FRONT, gl.GL_SHININESS, colorV, 0);
193
+// gl.glMaterialfv(gl.GL_BACK, gl.GL_SHININESS, colorV, 0);
194
+// /**/
195
+// }
196
+// /**/
197
+//
198
+// //selected = false;
199
+// selected = selected && display.flash;
200
+//
201
+// //display.modelParams0[0] = 0; // pigment.r;
202
+// //display.modelParams0[1] = 0; // pigment.g;
203
+// //display.modelParams0[2] = 0; // pigment.b;
204
+// if (!multiply)
205
+// {
206
+// display.modelParams0[3] = metalness;
207
+// display.modelParams1[0] = diffuse;
208
+// display.modelParams1[1] = specular;
209
+// display.modelParams1[2] = 1 / shininess;
210
+// display.modelParams1[3] = shift;
211
+// display.modelParams2[0] = ambient;
212
+// display.modelParams2[1] = lightarea;
213
+// //System.out.println("light area = " + lightarea);
214
+// display.modelParams2[2] = 1 / factor; // diffuseness
215
+// display.modelParams2[3] = velvet;
216
+// display.modelParams3[0] = sheen;
217
+// display.modelParams3[1] = subsurface;
218
+// display.modelParams3[2] = bump; // backlit
219
+// display.modelParams3[3] = aniso;
220
+// display.modelParams4[0] = anisoV;
221
+// display.modelParams4[1] = selected ? 100 : cameralight;
222
+// //System.out.println("selected = " + selected);
223
+// display.modelParams4[2] = diffuseness;
224
+// display.modelParams4[3] = shadow;
225
+// display.modelParams5[0] = texture;
226
+// display.modelParams5[1] = opacity;
227
+// display.modelParams5[2] = fakedepth;
228
+// display.modelParams5[3] = CameraPane.SHADOWCULLFACE ? 0f : (shadowbias - 0.005f) / 10;
229
+// }
230
+// else
231
+// {
232
+// display.modelParams0[3] *= metalness*2;
233
+// display.modelParams1[0] *= diffuse*2;
234
+// display.modelParams1[1] *= specular*2;
235
+// display.modelParams1[2] *= shininess*2;
236
+// display.modelParams1[3] *= shift*2;
237
+// display.modelParams2[0] *= ambient*2;
238
+// display.modelParams2[1] *= lightarea*2;
239
+// display.modelParams2[2] *= factor*2;
240
+// display.modelParams2[3] *= velvet*2;
241
+// display.modelParams3[0] *= sheen*2;
242
+// display.modelParams3[1] *= subsurface*2;
243
+// display.modelParams3[2] *= bump*2;
244
+// display.modelParams3[3] *= aniso*2;
245
+// display.modelParams4[0] *= anisoV*2;
246
+// display.modelParams4[1] *= cameralight*2;
247
+// //System.out.println("selected = " + selected);
248
+// display.modelParams4[2] *= diffuseness*2;
249
+// display.modelParams4[3] *= shadow*2;
250
+// display.modelParams5[0] *= texture*2;
251
+// display.modelParams5[1] *= opacity*2;
252
+// display.modelParams5[2] *= fakedepth*2;
253
+// display.modelParams5[3] *= shadowbias*2;
254
+// }
255
+//
256
+// display.modelParams6[0] = 0;
257
+// display.modelParams6[1] = 0;
258
+// display.modelParams6[2] = 0;
259
+// display.modelParams6[3] = 0;
260
+//
261
+// display.modelParams7[0] = 0;
262
+// display.modelParams7[1] = 1000;
263
+// display.modelParams7[2] = 0;
264
+// display.modelParams7[3] = 0;
265
+//
266
+// display.modelParams6[0] = 100; // criss de bug de bump
267
+//
268
+// Object3D.cVector2[] extparams = display.vector2buffer;
269
+// if (extparams != null && extparams.length > 0 && extparams[0] != null)
270
+// {
271
+// display.modelParams6[0] = extparams[0].x / 1000.0f; // bump
272
+// display.modelParams6[1] = extparams[0].y / 1000.0f; // noise
273
+// if (extparams.length > 1)
274
+// {
275
+// display.modelParams6[2] = extparams[1].x / 1000.0f; // borderfade
276
+// display.modelParams6[3] = extparams[1].y / 1000.0f; // (float)Math.exp(-extparams[1].y / 1000.0f); // fog punchthrough
277
+// if (extparams.length > 2)
278
+// {
279
+// display.modelParams7[0] = extparams[2].x / 1000.0f; // noise power
280
+// float x = extparams[2].y / 1000.0f;
281
+// //if (x == 0)
282
+// // x = 1f;
283
+// 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
284
+// if (extparams[2].y > 0)
285
+// {
286
+// //System.out.println("extparams[1].y = " + extparams[1].y);
287
+// //System.out.println("extparams[2].y = " + extparams[2].y);
288
+// //System.out.println("opacity power = " + display.modelParams7[1]);
289
+// }
290
+// }
291
+// }
292
+// }
293
+//
294
+// //if (display.modelParams6[2] != 0)
295
+// /*
296
+// System.out.println("modelParams0[0] = " + display.modelParams0[0]);
297
+// System.out.println("modelParams0[1] = " + display.modelParams0[1]);
298
+// System.out.println("modelParams0[2] = " + display.modelParams0[2]);
299
+// System.out.println("modelParams0[3] = " + display.modelParams0[3]);
300
+// System.out.println("modelParams1[0] = " + display.modelParams1[0]);
301
+// System.out.println("modelParams1[1] = " + display.modelParams1[1]);
302
+// System.out.println("modelParams1[2] = " + display.modelParams1[2]);
303
+// System.out.println("modelParams1[3] = " + display.modelParams1[3]);
304
+// System.out.println("modelParams2[0] = " + display.modelParams2[0]);
305
+// System.out.println("modelParams2[1] = " + display.modelParams2[1]);
306
+// System.out.println("modelParams2[2] = " + display.modelParams2[2]);
307
+// System.out.println("modelParams2[3] = " + display.modelParams2[3]);
308
+// System.out.println("modelParams3[0] = " + display.modelParams3[0]);
309
+// System.out.println("modelParams3[1] = " + display.modelParams3[1]);
310
+// System.out.println("modelParams3[2] = " + display.modelParams3[2]);
311
+// System.out.println("modelParams3[3] = " + display.modelParams3[3]);
312
+// System.out.println("modelParams4[0] = " + display.modelParams4[0]);
313
+// System.out.println("modelParams4[1] = " + display.modelParams4[1]);
314
+// System.out.println("modelParams4[2] = " + display.modelParams4[2]);
315
+// System.out.println("modelParams4[3] = " + display.modelParams4[3]);
316
+// System.out.println("modelParams5[0] = " + display.modelParams5[0]);
317
+// System.out.println("modelParams5[1] = " + display.modelParams5[1]);
318
+// System.out.println("modelParams5[2] = " + display.modelParams5[2]);
319
+// System.out.println("modelParams5[3] = " + display.modelParams5[3]);
320
+// System.out.println("modelParams6[0] = " + display.modelParams6[0]);
321
+// System.out.println("modelParams6[1] = " + display.modelParams6[1]);
322
+// System.out.println("modelParams6[2] = " + display.modelParams6[2]);
323
+// System.out.println("modelParams6[3] = " + display.modelParams6[3]);
324
+// System.out.println("modelParams7[0] = " + display.modelParams7[0]);
325
+// System.out.println("modelParams7[1] = " + display.modelParams7[1]);
326
+// System.out.println("modelParams7[2] = " + display.modelParams7[2]);
327
+// System.out.println("modelParams7[3] = " + display.modelParams7[3]);
328
+// /**/
329
+// //assert (display.modelParams6[2] == 0);
330
+//
331
+// //System.out.println("noise power = " + display.modelParams7[0]);
332
+// //System.out.println("shadowbias = " + shadowbias);
333
+//
334
+// gl.glProgramEnvParameter4fvARB(gl.GL_FRAGMENT_PROGRAM_ARB, 0, display.modelParams0, 0);
335
+// gl.glProgramEnvParameter4fvARB(gl.GL_FRAGMENT_PROGRAM_ARB, 1, display.modelParams1, 0);
336
+// gl.glProgramEnvParameter4fvARB(gl.GL_FRAGMENT_PROGRAM_ARB, 2, display.modelParams2, 0);
337
+// gl.glProgramEnvParameter4fvARB(gl.GL_FRAGMENT_PROGRAM_ARB, 3, display.modelParams3, 0);
338
+// gl.glProgramEnvParameter4fvARB(gl.GL_FRAGMENT_PROGRAM_ARB, 4, display.modelParams4, 0);
339
+// gl.glProgramEnvParameter4fvARB(gl.GL_FRAGMENT_PROGRAM_ARB, 5, display.modelParams5, 0);
340
+// gl.glProgramEnvParameter4fvARB(gl.GL_FRAGMENT_PROGRAM_ARB, 6, display.modelParams6, 0);
341
+// gl.glProgramEnvParameter4fvARB(gl.GL_FRAGMENT_PROGRAM_ARB, 7, display.modelParams7, 0);
342
+//
343
+// int mode = display.FP_SHADER;
344
+//
345
+// if (aniso != anisoV || aniso > 0.002)
346
+// {
347
+// mode |= display.FP_ANISO;
348
+// }
349
+//
350
+// display.EnableProgram(mode);
351
+//
352
+// //System.out.println("opacity power = " + display.modelParams7[1]);
353
+//
354
+// if (!multiply)
355
+// {
356
+// if (display.drawMode == CameraPane.SHADOW)
357
+// gl.glDepthMask(opacity >= 0.9 && display.modelParams7[1] > 0.1);
358
+// else
359
+// gl.glDepthMask(opacity >= 0.99);
360
+// }
361
+// }
359362
360363 float color = 0.5f, modulation /*SATURATION*/ = 0.001f, metalness = 0.001f;
361
- float diffuse = 0.75f, specular = 0.25f, shininess = 0.75f, shift = 1;
362
- float ambient = 0.001f, lightarea = 0.025f, factor = 0.001f, velvet = 0.001f;
364
+ float diffuse = 1f, specular = 0.25f, shininess = 0.75f, shift = 1;
365
+ float ambient = 0.001f, lightarea = 0.005f, factor = 0.001f, velvet = 0.001f;
363366 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;
367
+ float cameralight = 0.5f, diffuseness = 0.001f, shadow = 5f, texture = 1f, opacity = 1;
365368 float fakedepth = 0.5f, shadowbias = 0.01f; // 0.001f;
369
+
370
+ float parallax = 0;
366371
367372 boolean multiply;
368373