Skip to content

Commit

Permalink
Merge pull request #8805 from CesiumGS/highp-batch-tables-fix
Browse files Browse the repository at this point in the history
Fixing highp issue - Batch Tables
  • Loading branch information
likangning93 authored Apr 29, 2020
2 parents ecdea14 + 586a6ef commit 63dea9c
Show file tree
Hide file tree
Showing 13 changed files with 153 additions and 944 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
- Fixed a bug with very long view ranges requiring multiple frustums even with the logarithmic depth buffer enabled. Previously, such scenes could resolve depth incorrectly. [#8727](https://github.com/CesiumGS/cesium/pull/8727)
- Fixed a bug where the elevation contour material's alpha was not being applied. [#8749](https://github.com/CesiumGS/cesium/pull/8749)
- Fix potential memory leak when destroying `CesiumWidget` instances.
- Geometry instance floats now work for high precision floats on newer iOS devices. [#8805](https://github.com/CesiumGS/cesium/pull/8805)

### 1.68.0 - 2020-04-01

Expand Down
15 changes: 0 additions & 15 deletions Source/Renderer/Context.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import RuntimeError from "../Core/RuntimeError.js";
import WebGLConstants from "../Core/WebGLConstants.js";
import ViewportQuadVS from "../Shaders/ViewportQuadVS.js";
import BufferUsage from "./BufferUsage.js";
import checkFloatTexturePrecision from "./checkFloatTexturePrecision.js";
import ClearCommand from "./ClearCommand.js";
import ContextLimits from "./ContextLimits.js";
import CubeMap from "./CubeMap.js";
Expand Down Expand Up @@ -507,8 +506,6 @@ function Context(canvas, options) {
this.cache = {};

RenderState.apply(gl, rs, ps);

this._floatTexSixPlaces = checkFloatTexturePrecision(this);
}

var defaultFramebufferMarker = {};
Expand Down Expand Up @@ -663,18 +660,6 @@ Object.defineProperties(Context.prototype, {
},
},

/**
* Returns <code>true</code> if the context's floating point textures support 6 decimal places of precision.
* @memberof Context.prototype
* @type {Boolean}
* @see {@link https://www.khronos.org/registry/webgl/extensions/OES_texture_float/}
*/
floatTextureSixPlaces: {
get: function () {
return this._floatTexSixPlaces;
},
},

/**
* <code>true</code> if OES_texture_half_float is supported. This extension provides
* access to floating point textures that, for example, can be attached to framebuffers for high dynamic range.
Expand Down
88 changes: 0 additions & 88 deletions Source/Renderer/checkFloatTexturePrecision.js

This file was deleted.

2 changes: 1 addition & 1 deletion Source/Scene/BatchTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ BatchTable.prototype.getVertexShaderCallback = function () {
};
}

var batchTableShader = "uniform sampler2D batchTexture; \n";
var batchTableShader = "uniform highp sampler2D batchTexture; \n";
batchTableShader += getGlslComputeSt(this) + "\n";

var length = attributes.length;
Expand Down
3 changes: 1 addition & 2 deletions Source/Scene/ClassificationPrimitive.js
Original file line number Diff line number Diff line change
Expand Up @@ -589,8 +589,7 @@ function createShaderProgram(classificationPrimitive, frameState) {
var shadowVolumeAppearance = new ShadowVolumeAppearance(
cullFragmentsUsingExtents,
planarExtents,
classificationPrimitive.appearance,
context.floatTextureSixPlaces
classificationPrimitive.appearance
);

classificationPrimitive._spStencil = ShaderProgram.replaceCache({
Expand Down
5 changes: 1 addition & 4 deletions Source/Scene/GroundPrimitive.js
Original file line number Diff line number Diff line change
Expand Up @@ -805,23 +805,20 @@ GroundPrimitive.prototype.update = function (frameState) {
var textureCoordinateRotationPoints =
geometry.textureCoordinateRotationPoints;

var useFloatBatchTable = frameState.context.floatTextureSixPlaces;
if (usePlanarExtents) {
attributes = ShadowVolumeAppearance.getPlanarTextureCoordinateAttributes(
boundingRectangle,
textureCoordinateRotationPoints,
ellipsoid,
frameState.mapProjection,
useFloatBatchTable,
this._maxHeight
);
} else {
attributes = ShadowVolumeAppearance.getSphericalExtentGeometryInstanceAttributes(
boundingRectangle,
textureCoordinateRotationPoints,
ellipsoid,
frameState.mapProjection,
useFloatBatchTable
frameState.mapProjection
);
}

Expand Down
Loading

0 comments on commit 63dea9c

Please sign in to comment.