OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2010, Google Inc. | 2 * Copyright 2010, Google Inc. |
3 * All rights reserved. | 3 * All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 case o3d.Sampler.WRAP: | 173 case o3d.Sampler.WRAP: |
174 gl_mode = this.gl.REPEAT; | 174 gl_mode = this.gl.REPEAT; |
175 break; | 175 break; |
176 case o3d.Sampler.MIRROR: | 176 case o3d.Sampler.MIRROR: |
177 gl_mode = this.gl.MIRRORED_REPEAT; | 177 gl_mode = this.gl.MIRRORED_REPEAT; |
178 break; | 178 break; |
179 case o3d.Sampler.CLAMP: | 179 case o3d.Sampler.CLAMP: |
180 gl_mode = this.gl.CLAMP_TO_EDGE; | 180 gl_mode = this.gl.CLAMP_TO_EDGE; |
181 break; | 181 break; |
182 case o3d.Sampler.BORDER: | 182 case o3d.Sampler.BORDER: |
183 gl_mode = this.gl.CLAMP_TO_BORDER; | 183 // This is not supported in WebGL. |
184 break; | |
185 default: | 184 default: |
186 this.gl.client.error_callback("Unknown Address mode"); | 185 this.gl.client.error_callback("Unknown/Unavailable Address mode"); |
187 break; | 186 break; |
188 } | 187 } |
189 return gl_mode; | 188 return gl_mode; |
190 } | 189 } |
191 | 190 |
192 | 191 |
193 /** | 192 /** |
194 * Converts the min filter mode of the sampler from an o3d constant to a webgl | 193 * Converts the min filter mode of the sampler from an o3d constant to a webgl |
195 * constant. | 194 * constant. |
196 * @param {!o3d.Sampler.FilterType} o3d_filter, the O3D filter. | 195 * @param {!o3d.Sampler.FilterType} o3d_filter, the O3D filter. |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 if (currentTexture.levels == 1) { | 276 if (currentTexture.levels == 1) { |
278 mip_filter = o3d.Sampler.NONE; | 277 mip_filter = o3d.Sampler.NONE; |
279 } | 278 } |
280 currentTexture.bindAndSetParameters_( | 279 currentTexture.bindAndSetParameters_( |
281 this.convertAddressMode_(this.addressModeU), | 280 this.convertAddressMode_(this.addressModeU), |
282 this.convertAddressMode_(this.addressModeV), | 281 this.convertAddressMode_(this.addressModeV), |
283 this.convertMinFilter_(this.minFilter, mip_filter), | 282 this.convertMinFilter_(this.minFilter, mip_filter), |
284 this.convertMagFilter_(this.magFilter)); | 283 this.convertMagFilter_(this.magFilter)); |
285 } | 284 } |
286 | 285 |
OLD | NEW |