Ocean
Loading...
Searching...
No Matches
GLESPhantomAttribute.h
Go to the documentation of this file.
1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 */
7
8#ifndef META_OCEAN_RENDERING_GLES_PHANTOM_ATTRIBUTE_H
9#define META_OCEAN_RENDERING_GLES_PHANTOM_ATTRIBUTE_H
10
13
16
17namespace Ocean
18{
19
20namespace Rendering
21{
22
23namespace GLESceneGraph
24{
25
27 virtual public GLESAttribute,
28 virtual public DynamicObject,
29 virtual public PhantomAttribute
30{
31 friend class GLESFactory;
32
33 public:
34
35 /**
36 * Binds this attribute.
37 * @param framebuffer Framebuffer initiated the rendering process
38 * @param shaderProgram Shader program to be applied
39 */
40 void bindAttribute(const GLESFramebuffer& framebuffer, GLESShaderProgram& shaderProgram) override;
41
42 /**
43 * Unbindes this attribute.
44 */
45 void unbindAttribute() override;
46
47 /**
48 * Update function called by the framebuffer.
49 * @param view Associated view
50 * @param timestamp Update timestamp
51 */
52 void onDynamicUpdate(const ViewRef& view, const Timestamp timestamp) override;
53
54 /**
55 * Returns the shader type necessary to render an object with this attribute.
56 * @return Shader program type
57 */
59
60 protected:
61
62 /**
63 * Constructor
64 */
66
67 /**
68 * Destructor
69 */
71
72 /**
73 * Update matrices and texture related to the background image.
74 * @param view Associated view
75 * @param timestamp Update timestamp
76 * @see onDynamicUpdate()
77 */
78 void updateBackgroundInformation(const ViewRef& view, const Timestamp timestamp);
79
80 protected:
81
82 /// Timestamp of the last video camera type change.
84
85 /// Timestamp of the last color change.
87
88
89 /// Currently set background color; used for PM_COLOR
91
92 /// Texture transformation matrix (required for moveable object with fixed texture on them)
94
95 /// Normalized camera frustum matrix (required to convert vertex positions into texture coordinates)
97
98 /// Reference to the (undistorted) background texture.
100
101 /// Reference to the (undistorted) background offset texture.
103};
104
105} // namespace GLESceneGraph
106
107} // namespace Rendering
108
109} // namespace Ocean
110
111#endif // META_OCEAN_RENDERING_GLES_PHANTOM_ATTRIBUTE_H
This class implements a color defined by red, green, blue and alpha parameters.
Definition RGBAColor.h:41
DynamicObject()
Creates a new dynamic object.
ProgramType
Definition of different shader functionalities.
Definition GLESAttribute.h:43
GLESAttribute()
Creates a new GLESceneGraph attribute object.
This class implements a base for all GLESceneGraph framebuffers.
Definition rendering/glescenegraph/GLESFramebuffer.h:34
friend class GLESFactory
Definition GLESPhantomAttribute.h:31
Timestamp phantomVideoTimestamp
Timestamp of the last video camera type change.
Definition GLESPhantomAttribute.h:83
SquareMatrix4 phantomTextureCoordinateTransform
Texture transformation matrix (required for moveable object with fixed texture on them).
Definition GLESPhantomAttribute.h:93
void onDynamicUpdate(const ViewRef &view, const Timestamp timestamp) override
Update function called by the framebuffer.
SquareMatrix4 phantomNormalizedCameraFrustumMatrix
Normalized camera frustum matrix (required to convert vertex positions into texture coordinates).
Definition GLESPhantomAttribute.h:96
Timestamp phantomColorTimestamp
Timestamp of the last color change.
Definition GLESPhantomAttribute.h:86
RGBAColor phantomBackgroundColor
Currently set background color; used for PM_COLOR.
Definition GLESPhantomAttribute.h:90
Texture2DRef phantomUndistortedBackgroundTexture
Reference to the (undistorted) background texture.
Definition GLESPhantomAttribute.h:99
void updateBackgroundInformation(const ViewRef &view, const Timestamp timestamp)
Update matrices and texture related to the background image.
GLESAttribute::ProgramType necessaryShader() const override
Returns the shader type necessary to render an object with this attribute.
Texture2DRef phantomUndistortedBackgroundOffsetTexture
Reference to the (undistorted) background offset texture.
Definition GLESPhantomAttribute.h:102
void bindAttribute(const GLESFramebuffer &framebuffer, GLESShaderProgram &shaderProgram) override
Binds this attribute.
void unbindAttribute() override
Unbindes this attribute.
This class implements a container for an OpenGL ES shader program.
Definition GLESShaderProgram.h:53
PhantomAttribute()
Creates a new phantom attribute.
This class implements a timestamp.
Definition Timestamp.h:64
SquareMatrixT4< Scalar > SquareMatrix4
Definition of the SquareMatrix4 object, depending on the OCEAN_MATH_USE_SINGLE_PRECISION either with ...
Definition SquareMatrix4.h:39
SmartObjectRef< View > ViewRef
Definition of a smart object reference holding a view node.
Definition View.h:39
SmartObjectRef< Texture2D > Texture2DRef
Definition of a smart object reference holding a 2D texture.
Definition Texture2D.h:32
Namespace of the Rendering GLESceneGraph library.
Definition rendering/glescenegraph/android/Android.h:20
Namespace of the Rendering library.
Definition AbsoluteTransform.h:18
The namespace covering the entire Ocean framework.
Definition Accessor.h:15