# Candera Engine 3D

#### Shader: Support for precompiled shaders on all enabled platforms.

Uploading shader programs using [Shader::Upload](http://dev.doc.cgistudio.at/APILINK/class_candera_1_1_device_object.html#a844bff65eb133e28e8cfb4132b12d840) can now be done in a more flexible way. Until now it was only possible to upload either shader source or pre-compiled binaries, through a target-specific implementation of RenderDevice::CompileAndLoadShaderPair.

Now it is possible to upload (and compile if necessary) either shader source or shader binary objects. It is even possible to upload complete shader programs in order to avoid shader linking. How shader upload is done depends on the kind of data that is available in the asset and the capabilities of the target platform, however at runtime this is done completely transparent to the user.

Advantage is that the more flexible way of runtime created shader source code (as used in Candera2D implementations over OpenGL ES) is supported as well as using pre-compiled shaders to save execution time for compiling them. While using pre-compiled shaders on enabled platform is recommended due to performance reasons, still backward compatibility to existing solutions using uncompiled shaders is given.

<div class="contents" id="bkmrk-"><div class="contents"><div class="textblock">---

</div></div></div>#### OpenGL ES 2 Reference Shaders relocated

The [Candera](http://dev.doc.cgistudio.at/APILINK/namespace_candera.html "[DataBinding_RefTypeSample]") OpenGL ES 2.0 [Shader](http://dev.doc.cgistudio.at/APILINK/class_candera_1_1_shader.html "The class Shader is an Appearance component representing a graphical processing unit (GPU) program...") language reference Shaders have been moved from   
 `<cgi_studio_candera>/src/Candera/Engine3D/ReferenceShaders`   
to `<cgi_studio_candera>/src/Candera/Engine3D/RefShaders/ESSL1`

<div class="contents" id="bkmrk--0"><div class="contents"><div class="textblock">---

</div></div></div>#### OpenGL ES 3 Reference Shaders

[Candera](http://dev.doc.cgistudio.at/APILINK/namespace_candera.html "[DataBinding_RefTypeSample]") now contains a set of reference Shaders for the OpenGL ES 3.0 [Shader](http://dev.doc.cgistudio.at/APILINK/class_candera_1_1_shader.html "The class Shader is an Appearance component representing a graphical processing unit (GPU) program...") language.   
`<cgi_studio_candera>/src/Candera/Engine3D/RefShaders/ESSL3`

<div class="contents" id="bkmrk--1"><div class="contents"><div class="textblock">---

</div></div></div>#### Shader Resource Objects.

Fragment and vertex shader data or access information is stored in the new [ResourceDataHandle](http://dev.doc.cgistudio.at/APILINK/struct_candera_1_1_resource_data_handle.html "Object that stores information about access to large data buffers.") structure. See migration guide for an example on how it can be used.

<div class="contents" id="bkmrk--2"><div class="contents"><div class="textblock">---

</div></div></div>#### VertexGeometry Resource Objects.

The vertex, index and element format arrays are stored in the new [ResourceDataHandle](http://dev.doc.cgistudio.at/APILINK/struct_candera_1_1_resource_data_handle.html "Object that stores information about access to large data buffers.") structure. See migration guide for an example on how it can be used.

<div class="contents" id="bkmrk--3"><div class="contents"><div class="textblock">---

</div></div></div>#### VertexBuffer primitive iteration.

Iteration over triangles is replaced by primitive iteration using a forward iterator, which is more performant, allows iteration over point and line primitives and supports multiple parallel iterations. See migration guide for an example on how it can be used.

<div class="contents" id="bkmrk--4"><div class="contents"><div class="textblock">---

</div></div></div>#### VertexBuffer vertex access.

Vertex access interface is moved from the [VertexBuffer](http://dev.doc.cgistudio.at/APILINK/class_candera_1_1_vertex_buffer.html "The VertexBuffer encapsulates the attributes of an uploaded VertexGeometry. It holds the actual handl...") to a separate class for better performance in case of vertex data accessed from assets. See migration guide for an example on how it can be used.

<div class="contents" id="bkmrk--5"><div class="contents"><div class="textblock">---

</div></div></div>#### 8/16/32 bit indexed array buffers.

[VertexGeometry](http://dev.doc.cgistudio.at/APILINK/class_candera_1_1_vertex_geometry.html "The VertexGeometry holds all vertex data of a mesh. VertexGeometry may be used also for multiple Vert...") accepts index buffers that consist of 8, 16 or 32 bit indexes. The configuration of index size can be set through the new values of BufferType enumeration: UInt8IndexedArrayBuffer, UInt16IndexedArrayBuffer and UInt32IndexedArrayBuffer.

<div class="contents" id="bkmrk--6"><div class="contents"><div class="textblock">---

</div></div></div>#### VertexElementFormat access.

VertexElementFormat access interface is moved from the [VertexGeometry](http://dev.doc.cgistudio.at/APILINK/class_candera_1_1_vertex_geometry.html "The VertexGeometry holds all vertex data of a mesh. VertexGeometry may be used also for multiple Vert...") to a separate class for better performance in case of vertex data accessed from assets. See migration guide for an example on how it can be used.

<div class="contents" id="bkmrk--7"><div class="contents"><div class="textblock">---

</div></div></div>#### VertexGeometryBuilder support for 8/16/32 bit index buffers.

[VertexGeometryBuilder](http://dev.doc.cgistudio.at/APILINK/class_candera_1_1_vertex_geometry_builder.html "The VertexGeometryBuilder helps effectively build VertexGeometry objects.") can create index buffers with values on 8, 16 or 32 bit, depending on the number of vetices, or on the configured format if explicitly set.

<div class="contents" id="bkmrk--8"><div class="contents"><div class="textblock">---

</div></div></div>#### BlendEquation Min/Max support.

Min/Max options were added to the [RenderMode](http://dev.doc.cgistudio.at/APILINK/class_candera_1_1_render_mode.html "The class RenderMode is an Appearance component that encapsulates polygon-level and per-fragment comp...") BlendEquation, which specifies how a new pixel is combined with previously rendered pixels in the frame buffer.

---