Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing highp issue - Batch Tables #8805

Merged
merged 7 commits into from
Apr 29, 2020
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -506,8 +505,6 @@ function Context(canvas, options) {
this.cache = {};

RenderState.apply(gl, rs, ps);

this._floatTexSixPlaces = checkFloatTexturePrecision(this);
}

var defaultFramebufferMarker = {};
Expand Down Expand Up @@ -662,18 +659,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