MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/MaterialX / Viewer

Method Viewer

source/MaterialXView/Viewer.cpp:160–281  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

158//
159
160Viewer::Viewer(const std::string& materialFilename,
161 const std::string& meshFilename,
162 const std::string& envRadianceFilename,
163 const mx::FileSearchPath& searchPath,
164 const mx::FilePathVec& libraryFolders,
165 int screenWidth,
166 int screenHeight,
167 const mx::Color3& screenColor) :
168 ng::Screen(ng::Vector2i(screenWidth, screenHeight), "MaterialXView",
169 true, false, true, true, USE_FLOAT_BUFFER, 4, 0),
170 _materialFilename(materialFilename),
171 _meshFilename(meshFilename),
172 _envRadianceFilename(envRadianceFilename),
173 _searchPath(searchPath),
174 _libraryFolders(libraryFolders),
175 _meshScale(1.0f),
176 _turntableEnabled(false),
177 _turntableSteps(360),
178 _turntableStep(0),
179 _cameraPosition(DEFAULT_CAMERA_POSITION),
180 _cameraUp(0.0f, 1.0f, 0.0f),
181 _cameraViewAngle(DEFAULT_CAMERA_VIEW_ANGLE),
182 _cameraNearDist(0.05f),
183 _cameraFarDist(5000.0f),
184 _cameraZoom(DEFAULT_CAMERA_ZOOM),
185 _userCameraEnabled(true),
186 _userTranslationActive(false),
187 _lightRotation(0.0f),
188 _normalizeEnvironment(false),
189 _splitDirectLight(false),
190 _generateReferenceIrradiance(false),
191 _saveGeneratedLights(false),
192 _shadowSoftness(1),
193 _ambientOcclusionGain(0.6f),
194 _selectedGeom(0),
195 _selectedMaterial(0),
196 _identityCamera(mx::Camera::create()),
197 _viewCamera(mx::Camera::create()),
198 _envCamera(mx::Camera::create()),
199 _shadowCamera(mx::Camera::create()),
200 _lightHandler(mx::LightHandler::create()),
201 _typeSystem(mx::TypeSystem::create()),
202#ifndef MATERIALXVIEW_METAL_BACKEND
203 _genContext(mx::GlslShaderGenerator::create(_typeSystem)),
204 _genContextEssl(mx::EsslShaderGenerator::create(_typeSystem)),
205#else
206 _genContext(mx::MslShaderGenerator::create(_typeSystem)),
207#endif
208#if MATERIALX_BUILD_GEN_OSL
209 _genContextOsl(mx::OslShaderGenerator::create(_typeSystem)),
210#endif
211#if MATERIALX_BUILD_GEN_MDL
212 _genContextMdl(mx::MdlShaderGenerator::create(_typeSystem)),
213#endif
214 _unitRegistry(mx::UnitConverterRegistry::create()),
215 _drawEnvironment(false),
216 _outlineSelection(false),
217 _renderTransparency(true),

Callers

nothing calls this directly

Calls 4

createFunction · 0.50
appendMethod · 0.45
findMethod · 0.45
initializeMethod · 0.45

Tested by

no test coverage detected