HDK
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
skydomeTask.h
Go to the documentation of this file.
1
//
2
// Copyright 2021 Pixar
3
//
4
// Licensed under the terms set forth in the LICENSE.txt file available at
5
// https://openusd.org/license.
6
//
7
#ifndef HDX_SKYDOME_TASK_H
8
#define HDX_SKYDOME_TASK_H
9
10
#include "
pxr/pxr.h
"
11
#include "
pxr/imaging/hdx/api.h
"
12
#include "
pxr/imaging/hdx/renderSetupTask.h
"
13
#include "
pxr/imaging/hdx/task.h
"
14
15
#include "
pxr/base/gf/matrix4f.h
"
16
#include "
pxr/base/gf/vec2f.h
"
17
#include "
pxr/usd/sdf/path.h
"
18
#include "
pxr/imaging/hgi/graphicsCmds.h
"
19
20
#include "
pxr/imaging/glf/simpleLightingContext.h
"
21
22
PXR_NAMESPACE_OPEN_SCOPE
23
24
/// \class HdxSkydomeTask
25
///
26
/// If we have a domelight present in the lighting context the SkydomeTask
27
/// will render the associated environment map as a Skydome. Otherwise, it
28
/// will simply clear the AOVs.
29
///
30
/// Note that this task is intended to be the first "Render Task" in the
31
/// HdxTaskController so that the AOV's are properly cleared, however it
32
/// does not spawn a HdRenderPass.
33
///
34
class
HdxSkydomeTask
:
public
HdxTask
35
{
36
public
:
37
using
TaskParams
=
HdxRenderTaskParams
;
38
39
HDX_API
40
HdxSkydomeTask
(
HdSceneDelegate
* delegate,
SdfPath
const
&
id
);
41
42
HDX_API
43
~HdxSkydomeTask
()
override
;
44
45
/// Prepare the tasks resources
46
HDX_API
47
void
Prepare
(
HdTaskContext
* ctx,
48
HdRenderIndex
* renderIndex)
override
;
49
50
/// Execute render pass task
51
HDX_API
52
void
Execute
(
HdTaskContext
* ctx)
override
;
53
54
protected
:
55
/// Sync the render pass resources
56
HDX_API
57
void
_Sync
(
HdSceneDelegate
* delegate,
58
HdTaskContext
* ctx,
59
HdDirtyBits
* dirtyBits)
override
;
60
61
private
:
62
HdRenderIndex
* _renderIndex;
63
HgiTextureHandle
_skydomeTexture;
64
HgiSamplerHandle
_skydomeSampler;
65
// Optional internal render setup task, for params unpacking.
66
// This is used for aov bindings, camera matrices and framing
67
HdxRenderSetupTaskSharedPtr
_setupTask;
68
unsigned
int
_settingsVersion;
69
bool
_skydomeVisibility;
70
71
HdxSkydomeTask
() =
delete
;
72
HdxSkydomeTask
(
const
HdxSkydomeTask
&) =
delete
;
73
HdxSkydomeTask
&operator =(
const
HdxSkydomeTask
&) =
delete
;
74
75
HdRenderPassStateSharedPtr
_GetRenderPassState(
HdTaskContext
*ctx)
const
;
76
bool
_GetSkydomeTexture(
HdTaskContext
* ctx);
77
void
_SetFragmentShader();
78
79
// Utility function to update the shader uniform parameters.
80
// Returns true if the values were updated. False if unchanged.
81
bool
_UpdateParameterBuffer(
82
const
GfMatrix4f
& invProjMatrix,
83
const
GfMatrix4f
& viewToWorldMatrix,
84
const
GfMatrix4f
& lightTransform);
85
86
// This struct must match ParameterBuffer in Skydome.glslfx.
87
// Be careful to remember the std430 rules.
88
struct
_ParameterBuffer
89
{
90
GfMatrix4f
invProjMatrix;
91
GfMatrix4f
viewToWorldMatrix;
92
GfMatrix4f
lightTransform;
93
};
94
95
std::unique_ptr<class HdxFullscreenShader> _compositor;
96
_ParameterBuffer _parameterData;
97
};
98
99
100
PXR_NAMESPACE_CLOSE_SCOPE
101
102
#endif
GfMatrix4f
Definition:
matrix4f.h:70
HdRenderIndex
Definition:
renderIndex.h:104
HdRenderPassStateSharedPtr
std::shared_ptr< class HdRenderPassState > HdRenderPassStateSharedPtr
Definition:
engine.h:25
HdDirtyBits
uint32_t HdDirtyBits
Definition:
types.h:143
renderSetupTask.h
HdxSkydomeTask::_Sync
HDX_API void _Sync(HdSceneDelegate *delegate, HdTaskContext *ctx, HdDirtyBits *dirtyBits) override
Sync the render pass resources.
HgiTextureHandle
int HgiHandle< class HgiTexture > HgiTextureHandle
Definition:
ptexTextureObject.h:36
HDX_API
#define HDX_API
Definition:
api.h:23
vec2f.h
HdxRenderTaskParams
Definition:
renderSetupTask.h:120
HdxSkydomeTask::~HdxSkydomeTask
HDX_API ~HdxSkydomeTask() override
pxr.h
HdSceneDelegate
Definition:
sceneDelegate.h:404
simpleLightingContext.h
SdfPath
Definition:
path.h:273
matrix4f.h
HdTaskContext
std::unordered_map< TfToken, VtValue, TfToken::HashFunctor > HdTaskContext
Definition:
renderIndex.h:61
path.h
task.h
HdxTask
Definition:
task.h:27
HdxSkydomeTask::Execute
HDX_API void Execute(HdTaskContext *ctx) override
Execute render pass task.
PXR_NAMESPACE_OPEN_SCOPE
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition:
path.h:1425
api.h
HdxSkydomeTask
Definition:
skydomeTask.h:34
HdxRenderSetupTaskSharedPtr
std::shared_ptr< class HdxRenderSetupTask > HdxRenderSetupTaskSharedPtr
Definition:
renderSetupTask.h:30
PXR_NAMESPACE_CLOSE_SCOPE
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition:
pxr.h:74
HdxSkydomeTask::Prepare
HDX_API void Prepare(HdTaskContext *ctx, HdRenderIndex *renderIndex) override
Prepare the tasks resources.
graphicsCmds.h
HgiHandle< class HgiSampler >
pxr
imaging
hdx
skydomeTask.h
Generated on Wed Aug 27 2025 03:07:56 for HDK by
1.8.6