Qt 6.x
The Qt SDK
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
QSSGMaterialShaderGenerator Struct Reference

#include <qssgrenderdefaultmaterialshadergenerator_p.h>

+ Collaboration diagram for QSSGMaterialShaderGenerator:

Classes

struct  LightVariableNames
 
struct  ShadowVariableNames
 

Public Member Functions

 ~QSSGMaterialShaderGenerator ()=default
 

Static Public Member Functions

static const char * getSamplerName (QSSGRenderableImage::Type type)
 
static QSSGRhiShaderPipelinePtr generateMaterialRhiShader (const QByteArray &inShaderKeyPrefix, QSSGMaterialVertexPipeline &vertexGenerator, const QSSGShaderDefaultMaterialKey &key, QSSGShaderDefaultMaterialKeyProperties &inProperties, const QSSGShaderFeatures &inFeatureSet, const QSSGRenderGraphObject &inMaterial, const QSSGShaderLightListView &inLights, QSSGRenderableImage *inFirstImage, QSSGShaderLibraryManager &shaderLibraryManager, QSSGShaderCache &theCache)
 
static void setRhiMaterialProperties (const QSSGRenderContextInterface &, QSSGRhiShaderPipeline &shaders, char *ubufData, QSSGRhiGraphicsPipelineState *inPipelineState, const QSSGRenderGraphObject &inMaterial, const QSSGShaderDefaultMaterialKey &inKey, QSSGShaderDefaultMaterialKeyProperties &inProperties, const QSSGRenderCamera &inCamera, const QMatrix4x4 &inModelViewProjection, const QMatrix3x3 &inNormalMatrix, const QMatrix4x4 &inGlobalTransform, const QMatrix4x4 &clipSpaceCorrMatrix, const QMatrix4x4 &localInstanceTransform, const QMatrix4x4 &globalInstanceTransform, const QSSGDataView< float > &inMorphWeights, QSSGRenderableImage *inFirstImage, float inOpacity, const QSSGLayerGlobalRenderProperties &inRenderProperties, const QSSGShaderLightListView &inLights, const QSSGShaderReflectionProbe &reflectionProbe, bool receivesShadows, bool receivesReflections, const QVector2D *shadowDepthAdjust, QRhiTexture *lightmapTexture)
 
static const char * directionalLightProcessorArgumentList ()
 
static const char * pointLightProcessorArgumentList ()
 
static const char * spotLightProcessorArgumentList ()
 
static const char * ambientLightProcessorArgumentList ()
 
static const char * specularLightProcessorArgumentList ()
 
static const char * shadedFragmentMainArgumentList ()
 
static const char * postProcessorArgumentList ()
 
static const char * iblProbeProcessorArgumentList ()
 
static const char * vertexMainArgumentList ()
 
static const char * vertexInstancedMainArgumentList ()
 

Detailed Description

Definition at line 34 of file qssgrenderdefaultmaterialshadergenerator_p.h.

Constructor & Destructor Documentation

◆ ~QSSGMaterialShaderGenerator()

QSSGMaterialShaderGenerator::~QSSGMaterialShaderGenerator ( )
default

Member Function Documentation

◆ ambientLightProcessorArgumentList()

const char * QSSGMaterialShaderGenerator::ambientLightProcessorArgumentList ( )
static

Definition at line 434 of file qssgrenderdefaultmaterialshadergenerator.cpp.

Referenced by insertAmbientLightProcessorArgs().

+ Here is the caller graph for this function:

◆ directionalLightProcessorArgumentList()

const char * QSSGMaterialShaderGenerator::directionalLightProcessorArgumentList ( )
static

Definition at line 419 of file qssgrenderdefaultmaterialshadergenerator.cpp.

Referenced by insertDirectionalLightProcessorArgs().

+ Here is the caller graph for this function:

◆ generateMaterialRhiShader()

QSSGRhiShaderPipelinePtr QSSGMaterialShaderGenerator::generateMaterialRhiShader ( const QByteArray inShaderKeyPrefix,
QSSGMaterialVertexPipeline vertexGenerator,
const QSSGShaderDefaultMaterialKey key,
QSSGShaderDefaultMaterialKeyProperties inProperties,
const QSSGShaderFeatures inFeatureSet,
const QSSGRenderGraphObject inMaterial,
const QSSGShaderLightListView inLights,
QSSGRenderableImage inFirstImage,
QSSGShaderLibraryManager shaderLibraryManager,
QSSGShaderCache theCache 
)
static

Definition at line 1815 of file qssgrenderdefaultmaterialshadergenerator.cpp.

References QSSGMaterialVertexPipeline::beginVertexGeneration(), QSSGProgramGenerator::compileGeneratedRhiShader(), QSSGMaterialVertexPipeline::endFragmentGeneration(), QSSGMaterialVertexPipeline::endVertexGeneration(), QSSGMaterialVertexPipeline::fragment(), generateFragmentShader(), and QSSGMaterialVertexPipeline::programGenerator().

Referenced by QSSGRenderer::generateRhiShaderPipelineImpl(), and QSSGCustomMaterialSystem::shadersForCustomMaterial().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSamplerName()

const char * QSSGMaterialShaderGenerator::getSamplerName ( QSSGRenderableImage::Type  type)
static

Definition at line 116 of file qssgrenderdefaultmaterialshadergenerator.cpp.

References QT_BEGIN_NAMESPACE::ImageStringSet::imageSampler.

Referenced by addOpaqueDepthPrePassBindings(), RenderHelpers::rhiPrepareRenderable(), and QSSGCustomMaterialSystem::rhiPrepareRenderable().

+ Here is the caller graph for this function:

◆ iblProbeProcessorArgumentList()

const char * QSSGMaterialShaderGenerator::iblProbeProcessorArgumentList ( )
static

Definition at line 454 of file qssgrenderdefaultmaterialshadergenerator.cpp.

Referenced by insertIblProbeProcessorArgs().

+ Here is the caller graph for this function:

◆ pointLightProcessorArgumentList()

const char * QSSGMaterialShaderGenerator::pointLightProcessorArgumentList ( )
static

Definition at line 424 of file qssgrenderdefaultmaterialshadergenerator.cpp.

Referenced by insertPointLightProcessorArgs().

+ Here is the caller graph for this function:

◆ postProcessorArgumentList()

const char * QSSGMaterialShaderGenerator::postProcessorArgumentList ( )
static

Definition at line 449 of file qssgrenderdefaultmaterialshadergenerator.cpp.

Referenced by insertPostProcessorArgs().

+ Here is the caller graph for this function:

◆ setRhiMaterialProperties()

void QSSGMaterialShaderGenerator::setRhiMaterialProperties ( const QSSGRenderContextInterface renderContext,
QSSGRhiShaderPipeline shaders,
char *  ubufData,
QSSGRhiGraphicsPipelineState inPipelineState,
const QSSGRenderGraphObject inMaterial,
const QSSGShaderDefaultMaterialKey inKey,
QSSGShaderDefaultMaterialKeyProperties inProperties,
const QSSGRenderCamera inCamera,
const QMatrix4x4 inModelViewProjection,
const QMatrix3x3 inNormalMatrix,
const QMatrix4x4 inGlobalTransform,
const QMatrix4x4 clipSpaceCorrMatrix,
const QMatrix4x4 localInstanceTransform,
const QMatrix4x4 globalInstanceTransform,
const QSSGDataView< float > &  inMorphWeights,
QSSGRenderableImage inFirstImage,
float  inOpacity,
const QSSGLayerGlobalRenderProperties inRenderProperties,
const QSSGShaderLightListView inLights,
const QSSGShaderReflectionProbe reflectionProbe,
bool  receivesShadows,
bool  receivesReflections,
const QVector2D shadowDepthAdjust,
QRhiTexture lightmapTexture 
)
static

Definition at line 1843 of file qssgrenderdefaultmaterialshadergenerator.cpp.

References QSSGShaderMaterialAdapter::alphaCutOff(), QList< T >::append(), QSSGShaderMaterialAdapter::attenuationColor(), QSSGShaderMaterialAdapter::attenuationDistance(), QSSGRenderContextInterface::bufferManager(), QSSGShaderMaterialAdapter::bumpAmount(), QSSGRenderCamera::calculateViewProjectionMatrix(), QSSGLayerGlobalRenderProperties::cameraData, QSSGRhiShaderPipeline::CommonUniformIndices::cameraDirectionIdx, QSSGRhiShaderPipeline::CommonUniformIndices::cameraPositionIdx, QSSGRhiShaderPipeline::CommonUniformIndices::cameraPropertiesIdx, QSSGShaderMaterialAdapter::clearcoatAmount(), QSSGShaderMaterialAdapter::clearcoatRoughnessAmount(), QSSGRenderCamera::clipFar, QSSGRenderCamera::clipNear, QSSGRenderLayer::FogOptions::color, QSSGShaderMaterialAdapter::color(), QSSGShaderLightData::coneAngle, QSSGShaderLightData::constantAttenuation, QGenericMatrix< N, M, T >::constData(), QMatrix4x4::constData(), QList< T >::constData(), QSSGShaderLightsUniformData::count, QSSGRenderLayer::FogOptions::density, QSSGRenderLayer::FogOptions::depthBegin, QSSGRenderLayer::FogOptions::depthCurve, QSSGRenderLayer::FogOptions::depthEnabled, QSSGRenderLayer::FogOptions::depthEnd, QSSGShaderLightData::diffuse, QSSGShaderMaterialAdapter::diffuseLightWrap(), direction, QSSGShaderLightData::direction, QSSGShaderMaterialAdapter::emissiveColor(), QSSGRenderLayer::FogOptions::enabled, QSSGShaderReflectionProbe::enabled, Float, QSSGRenderLayer::fog, QSSGRhiShaderPipeline::CommonUniformIndices::fogColorIdx, QSSGRhiShaderPipeline::CommonUniformIndices::fogDepthPropertiesIdx, QSSGRhiShaderPipeline::CommonUniformIndices::fogHeightPropertiesIdx, QSSGRhiShaderPipeline::CommonUniformIndices::fogTransmitPropertiesIdx, QSSGShaderMaterialAdapter::fresnelPower(), QSSGRenderNode::getGlobalPos(), getMaterialAdapter(), QSSGShaderKeyBoolean::getValue(), QSSGShaderKeyUnsigned< TBitWidth >::getValue(), QSSGRenderNode::globalTransform, QSSGShaderMaterialAdapter::hasLighting(), QSSGShaderMaterialAdapter::heightAmount(), QSSGRenderLayer::FogOptions::heightCurve, QSSGRenderLayer::FogOptions::heightEnabled, QSSGRenderLayer::FogOptions::heightMax, QSSGRenderLayer::FogOptions::heightMin, QSSGShaderMaterialAdapter::iblProbe(), QSSGRhiShaderPipeline::CommonUniformIndices::imageIndices, QSSGShaderLightData::innerConeAngle, QSSGRenderCustomMaterial::InverseProjectionMatrix, QSSGRhiShaderPipeline::CommonUniformIndices::inverseProjectionMatrixIdx, QMatrix4x4::inverted(), QSSGShaderMaterialAdapter::ior(), QSSGLayerGlobalRenderProperties::isClipDepthZeroToOne, QGenericMatrix< N, M, T >::isIdentity(), QSSGShaderMaterialAdapter::isPrincipled(), QSSGShaderMaterialAdapter::isTransmissionEnabled(), QSSGLayerGlobalRenderProperties::isYUpInFramebuffer, QSSGLayerGlobalRenderProperties::isYUpInNDC, QSSGLayerGlobalRenderProperties::layer, QSSGRhiShaderPipeline::CommonUniformIndices::light_ambient_totalIdx, QSSGShaderLightsUniformData::lightData, QSSGLayerGlobalRenderProperties::lightProbe, QSSGRhiShaderPipeline::CommonUniformIndices::lightProbeOrientationIdx, QSSGRhiShaderPipeline::CommonUniformIndices::lightProbePropertiesIdx, QSSGShaderLightData::linearAttenuation, QSSGRhiGraphicsPipelineState::lineWidth, QSSGShaderMaterialAdapter::lineWidth(), QSSGRenderLight::m_ambientColor, QSSGRenderLight::m_brightness, QSSGRenderLight::m_coneAngle, QSSGRenderLight::m_constantFade, QSSGRenderLight::m_diffuseColor, QSSGRenderImage::m_horizontalTilingMode, QSSGRenderLight::m_innerConeAngle, QSSGShadowMapEntry::m_lightView, QSSGShadowMapEntry::m_lightVP, QSSGRenderLight::m_linearFade, QSSGRenderImageTexture::m_mipmapCount, QSSGRenderableImage::m_nextImage, QSSGRenderLight::m_quadraticFade, QSSGRenderCustomMaterial::m_renderFlags, QSSGShadowMapEntry::m_rhiDepthCube, QSSGShadowMapEntry::m_rhiDepthMap, QSSGRenderLight::m_shadowBias, QSSGRenderLight::m_shadowFactor, QSSGRenderLight::m_shadowMapFar, QSSGRenderLight::m_specularColor, QSSGShaderDefaultMaterialKeyProperties::m_targetCount, QSSGRenderImageTexture::m_texture, QSSGShaderDefaultMaterialKeyProperties::m_usesInstancing, QSSGShaderDefaultMaterialKeyProperties::m_usesPointsTopology, QSSGRenderImage::m_verticalTilingMode, QSSGRhiShaderPipeline::Mat3, QSSGRhiShaderPipeline::CommonUniformIndices::material_attenuationIdx, QSSGRhiShaderPipeline::CommonUniformIndices::material_baseColorIdx, QSSGRhiShaderPipeline::CommonUniformIndices::material_emissiveColorIdx, QSSGRhiShaderPipeline::CommonUniformIndices::material_properties2Idx, QSSGRhiShaderPipeline::CommonUniformIndices::material_properties3Idx, QSSGRhiShaderPipeline::CommonUniformIndices::material_properties4Idx, QSSGRhiShaderPipeline::CommonUniformIndices::material_propertiesIdx, QSSGRhiShaderPipeline::CommonUniformIndices::material_specularIdx, QSSGShaderMaterialAdapter::maxHeightSamples(), QSSGDataView< T >::mData, QSSGShaderMaterialAdapter::metalnessAmount(), QSSGShaderMaterialAdapter::minHeightSamples(), QSSGBufferManager::MipModeBsdf, QSSGRhiShaderPipeline::CommonUniformIndices::modelMatrixIdx, QSSGRhiShaderPipeline::CommonUniformIndices::modelViewProjectionIdx, QSSGRhiShaderPipeline::CommonUniformIndices::morphWeightsIdx, QSSGDataView< T >::mSize, QSSGRhiShaderPipeline::CommonUniformIndices::normalMatrixIdx, QSSGShaderMaterialAdapter::occlusionAmount(), QSSGShaderReflectionProbe::parallaxCorrection, QSSGShaderMaterialAdapter::pointSize(), QSSGRhiShaderPipeline::CommonUniformIndices::pointSizeIdx, QSSGShaderLightData::position, QSSGShaderReflectionProbe::probeBoxMax, QSSGShaderReflectionProbe::probeBoxMin, QSSGShaderReflectionProbe::probeCubeMapCenter, QSSGLayerGlobalRenderProperties::probeExposure, QSSGLayerGlobalRenderProperties::probeHorizon, QSSGLayerGlobalRenderProperties::probeOrientation, QSSGRenderCamera::projection, QSSGRenderCustomMaterial::ProjectionMatrix, QSSGRhiShaderPipeline::CommonUniformIndices::projectionMatrixIdx, Q_ASSERT, qCos(), qDegreesToRadians(), QSSG_MAX_NUM_LIGHTS, QSSG_MAX_NUM_SHADOW_MAPS, QSSGShaderLightData::quadraticAttenuation, QSSGRhiShaderPipeline::CommonUniformIndices::reflectionProbeBoxMax, QSSGRhiShaderPipeline::CommonUniformIndices::reflectionProbeBoxMin, QSSGRhiShaderPipeline::CommonUniformIndices::reflectionProbeCorrection, QSSGRhiShaderPipeline::CommonUniformIndices::reflectionProbeCubeMapCenter, QSSGLayerGlobalRenderProperties::rhiDepthTexture, QSSGRhiShaderPipeline::CommonUniformIndices::rhiPropertiesIdx, QSSGLayerGlobalRenderProperties::rhiScreenTexture, QSSGLayerGlobalRenderProperties::rhiSsaoTexture, QSSGShaderMaterialAdapter::setCustomPropertyUniforms(), setupShadowMapVariableNames(), QSSGRhiShaderPipeline::CommonUniformIndices::shadowDepthAdjustIdx, QSSGRenderShadowMap::shadowMapEntry(), QSSGLayerGlobalRenderProperties::shadowMapManager, QSSGRhiShadowMapProperties::shadowMapTexture, QSSGRhiShadowMapProperties::shadowMapTextureUniformName, QSSGDataView< T >::size(), QSSGShaderLightData::specular, QSSGShaderMaterialAdapter::specularAmount(), QSSGShaderMaterialAdapter::specularRoughness(), QSSGShaderMaterialAdapter::specularTint(), QSSGShaderMaterialAdapter::thicknessFactor(), QSSGRhiShaderPipeline::CommonUniformIndices::thicknessFactorIdx, aux::translateConstantAttenuation(), aux::translateLinearAttenuation(), aux::translateQuadraticAttenuation(), QSSGShaderMaterialAdapter::translucentFallOff(), QSSGShaderMaterialAdapter::transmissionFactor(), QSSGRenderLayer::FogOptions::transmitCurve, QSSGRenderLayer::FogOptions::transmitEnabled, QSSGRenderGraphObject::type, Qt::Uninitialized, QSSGRhiShaderPipeline::CommonUniformIndices::viewMatrixIdx, QSSGRhiShaderPipeline::CommonUniformIndices::viewProjectionMatrixIdx, QVector3D::x(), QVector3D::y(), QVector3D::z(), and ZERO_MATRIX.

Referenced by QSSGCustomMaterialSystem::updateUniformsForCustomMaterial(), and updateUniformsForDefaultMaterial().

+ Here is the caller graph for this function:

◆ shadedFragmentMainArgumentList()

const char * QSSGMaterialShaderGenerator::shadedFragmentMainArgumentList ( )
static

Definition at line 444 of file qssgrenderdefaultmaterialshadergenerator.cpp.

Referenced by insertFragmentMainArgs().

+ Here is the caller graph for this function:

◆ specularLightProcessorArgumentList()

const char * QSSGMaterialShaderGenerator::specularLightProcessorArgumentList ( )
static

Definition at line 439 of file qssgrenderdefaultmaterialshadergenerator.cpp.

Referenced by insertSpecularLightProcessorArgs().

+ Here is the caller graph for this function:

◆ spotLightProcessorArgumentList()

const char * QSSGMaterialShaderGenerator::spotLightProcessorArgumentList ( )
static

Definition at line 429 of file qssgrenderdefaultmaterialshadergenerator.cpp.

Referenced by insertSpotLightProcessorArgs().

+ Here is the caller graph for this function:

◆ vertexInstancedMainArgumentList()

const char * QSSGMaterialShaderGenerator::vertexInstancedMainArgumentList ( )
static

Definition at line 464 of file qssgrenderdefaultmaterialshadergenerator.cpp.

Referenced by insertVertexInstancedMainArgs().

+ Here is the caller graph for this function:

◆ vertexMainArgumentList()

const char * QSSGMaterialShaderGenerator::vertexMainArgumentList ( )
static

Definition at line 459 of file qssgrenderdefaultmaterialshadergenerator.cpp.

Referenced by insertVertexMainArgs().

+ Here is the caller graph for this function:

The documentation for this struct was generated from the following files: