-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy pathNtcMaterial.h
More file actions
74 lines (63 loc) · 2.64 KB
/
Copy pathNtcMaterial.h
File metadata and controls
74 lines (63 loc) · 2.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/*
* SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: LicenseRef-NvidiaProprietary
*
* NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
* property and proprietary rights in and to this material, related
* documentation and any modifications thereto. Any use, reproduction,
* disclosure or distribution of this material and related documentation
* without an express license agreement from NVIDIA CORPORATION or
* its affiliates is strictly prohibited.
*/
#pragma once
#include <donut/engine/SceneGraph.h>
#include <libntc/ntc.h>
#include "feedbackmanager/include/FeedbackManager.h"
struct NtcMaterial;
struct TextureTranscodeTask
{
ntc::ITextureMetadata* metadata = nullptr;
ntc::BlockCompressedFormat bcFormat = ntc::BlockCompressedFormat::None;
nvrhi::TextureHandle color;
nvrhi::TextureHandle blocks;
nvrhi::TextureHandle compressed;
nvrhi::Format nvrhiBcFormat = nvrhi::Format::UNKNOWN;
nvrhi::BufferHandle bc7ModeBuffer;
int firstChannel = 0;
int numChannels = 0;
int mipZeroDescriptor = 0;
bool sRGB = false;
char const* name = nullptr;
std::shared_ptr<donut::engine::LoadedTexture> NtcMaterial::* pMaterialTexture = nullptr;
nvrhi::RefCountPtr<nvfeedback::FeedbackTexture> NtcMaterial::* pFeedbackTexture = nullptr;
std::vector<nvrhi::BufferRange> bc7ModeBufferMipRanges;
void ReleaseTextures()
{
color = nullptr;
blocks = nullptr;
compressed = nullptr;
}
};
struct NtcMaterial : public donut::engine::Material
{
nvrhi::BufferHandle ntcConstantBuffer;
nvrhi::BufferHandle ntcWeightsBuffer;
nvrhi::TextureHandle ntcLatentsTexture;
int weightType = 0;
size_t transcodedMemorySize = 0;
size_t ntcMemorySize = 0;
nvrhi::RefCountPtr<nvfeedback::FeedbackTexture> baseOrDiffuseTextureFeedback;
nvrhi::RefCountPtr<nvfeedback::FeedbackTexture> metalRoughOrSpecularTextureFeedback;
nvrhi::RefCountPtr<nvfeedback::FeedbackTexture> normalTextureFeedback;
nvrhi::RefCountPtr<nvfeedback::FeedbackTexture> emissiveTextureFeedback;
nvrhi::RefCountPtr<nvfeedback::FeedbackTexture> occlusionTextureFeedback;
nvrhi::RefCountPtr<nvfeedback::FeedbackTexture> transmissionTextureFeedback;
nvrhi::RefCountPtr<nvfeedback::FeedbackTexture> opacityTextureFeedback;
std::shared_ptr<ntc::TextureSetMetadataWrapper> textureSetMetadata;
std::vector<TextureTranscodeTask> transcodeMapping;
};
class NtcSceneTypeFactory : public donut::engine::SceneTypeFactory
{
public:
std::shared_ptr<donut::engine::Material> CreateMaterial() override;
};