// Example 2. Create a shader program with explicit attribute indices.var vs = 'attribute vec4 position;' + 'attribute vec3 normal;' + 'void main() { gl_Position = position; }';var fs = 'void main() { gl_FragColor = vec4(1.0); }';var attributes = { position : 0, normal : 1};sp = context.createShaderProgram(vs, fs, attributes);var context = scene.context;
If you want to instantiate your own context, try
var context = new Cesium.Context(...)
attribute vec3 position3DHigh;attribute vec3 position3DLow;attribute vec2 st;
--
You received this message because you are subscribed to a topic in the Google Groups "cesium-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cesium-dev/WmDTD1PU_Mw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cesium-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
...<a href="http://twitter.com/pjcozzi" target="_blank" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Ftwitter.com%2Fpjcozzi\46sa\75D\46sntz\0751\46usg\75AFQjCNHifU1T7z7hyG9Mz35y76-GUMDjOg';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Ftwitter.com%2Fpjcozzi\46sa\75D\46sntz\0751\46usg\75AFQjCNHifU1T7z7hyG9Mz
...For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" onmousedown="this.href='https://groups.google.com/d/optout';return true;" onclick="this.href='https://groups.google.com/d/optout';ret
...'&n
...
...
...
...Attributes are matched by name and geometries do not have attributes called aVertexPosition and <span style="font-family:arial,sans-serif
...
require(['Cesium'], function(Cesium) {
"use strict";
var viewer = new Cesium.Viewer('cesiumContainer');
var scene = viewer.scene;
// CESIUM_1.45
//var ellipsoid = viewer.centralBody.ellipsoid;
var ellipsoid = scene.globe.ellipsoid;
var ExampleAppearance = function() {
this.material = undefined;
this.vertexShaderSource =
// CESIUM_1.45: Added batchId
'attribute float batchId;' +
'attribute vec3 position3DHigh;' +
'attribute vec3 position3DLow;' +
'attribute vec3 normal;' +
'varying vec3 v_positionEC;' +
'varying vec3 v_normalEC;' +
'void main()' +
'{' +
' vec4 p = czm_computePosition();' +
' v_positionEC = (czm_modelViewRelativeToEye * p).xyz;' +
' v_normalEC = czm_normal * normal;' +
' gl_Position = czm_modelViewProjectionRelativeToEye * p;' +
'}';
this.fragmentShaderSource =
'varying vec3 v_positionEC;' +
'varying vec3 v_normalEC;' +
'void main()' +
'{' +
' gl_FragColor = vec4(v_normalEC, 0.5);' +
'}';
this.renderState = Cesium.Appearance.getDefaultRenderState(true, false);
};
ExampleAppearance.prototype.getFragmentShaderSource = Cesium.Appearance.prototype.getFragmentShaderSource;
ExampleAppearance.prototype.isTranslucent = Cesium.Appearance.prototype.isTranslucent;
ExampleAppearance.prototype.getRenderState = Cesium.Appearance.prototype.getRenderState;
// CESIUM_1.45: Extent -> Rectangle.
// CESIUM_1.45: Smaller rectangle region, otherwise normal is computed as NaN.
// Red rectangle
//var rectangle = Cesium.Rectangle.fromDegrees(-180.0, -90.0, 180.0, 90.0);
var rectangle = Cesium.Rectangle.fromDegrees(0, 0, 180.0, 90.0);
var redRectangleInstance = new Cesium.GeometryInstance({
geometry : new Cesium.RectangleGeometry({
rectangle : rectangle,
vertexFormat : Cesium.VertexFormat.POSITION_AND_NORMAL
})
});
// Add rectangle instances to primitives
scene.primitives.add(new Cesium.Primitive({
geometryInstances : [redRectangleInstance],