.. | .. |
---|
34 | 34 | shadow = val; |
---|
35 | 35 | texture = val; |
---|
36 | 36 | opacity = val; |
---|
| 37 | + parallax = val; |
---|
37 | 38 | fakedepth = val; |
---|
38 | 39 | shadowbias = val; |
---|
39 | 40 | } |
---|
40 | 41 | |
---|
41 | 42 | public cMaterial(cMaterial mat) |
---|
42 | 43 | { |
---|
43 | | - this(); |
---|
44 | 44 | if (mat != null) |
---|
45 | 45 | { |
---|
46 | 46 | Set(mat); |
---|
.. | .. |
---|
71 | 71 | shadow = mat.shadow; |
---|
72 | 72 | texture = mat.texture; |
---|
73 | 73 | opacity = mat.opacity; |
---|
| 74 | + parallax = mat.parallax; |
---|
74 | 75 | fakedepth = mat.fakedepth; |
---|
75 | 76 | shadowbias = mat.shadowbias; |
---|
76 | 77 | |
---|
.. | .. |
---|
79 | 80 | |
---|
80 | 81 | void UpdateMaterial(cMaterial anchor, cMaterial current) |
---|
81 | 82 | { |
---|
82 | | - color *= Factor(anchor.color, current.color); |
---|
| 83 | + //color *= Factor(anchor.color, current.color); |
---|
| 84 | + color = current.color; |
---|
83 | 85 | //if (anchor.saturation == 0) |
---|
84 | 86 | // anchor.saturation = 0.001f; |
---|
85 | 87 | if (anchor.modulation == 0) |
---|
.. | .. |
---|
104 | 106 | shadow *= Factor(anchor.shadow, current.shadow); |
---|
105 | 107 | texture *= Factor(anchor.texture, current.texture); |
---|
106 | 108 | 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; |
---|
107 | 113 | fakedepth *= Factor(anchor.fakedepth, current.fakedepth); |
---|
108 | 114 | shadowbias *= Factor(anchor.shadowbias, current.shadowbias); |
---|
109 | 115 | } |
---|
110 | 116 | |
---|
111 | 117 | float Factor(float anchor, float current) |
---|
112 | 118 | { |
---|
113 | | - if (anchor <= 0) |
---|
114 | | - { |
---|
115 | | - assert anchor > 0; |
---|
116 | | - } |
---|
| 119 | + Grafreed.Assert(anchor > 0); |
---|
117 | 120 | |
---|
118 | 121 | return current / anchor; |
---|
119 | 122 | } |
---|
.. | .. |
---|
358 | 361 | // } |
---|
359 | 362 | |
---|
360 | 363 | 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; |
---|
363 | 366 | 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; |
---|
365 | 368 | float fakedepth = 0.5f, shadowbias = 0.01f; // 0.001f; |
---|
| 369 | + |
---|
| 370 | + float parallax = 0; |
---|
366 | 371 | |
---|
367 | 372 | boolean multiply; |
---|
368 | 373 | |
---|