void FVertexFactory::InitDeclaration( FVertexDeclarationElementList& Elements, const DataType& InData) { // Make a copy of the vertex factory data. Data = InData; // Create the vertex declaration for rendering the factory normally. Declaration = RHICreateVertexDeclaration(Elements); }
virtual void InitDynamicRHI() { FVertexDeclarationElementList Elements; int32 Offset = 0; FillDeclElements(Elements, Offset); // Create the vertex declaration for rendering the factory normally. // This is done in InitDynamicRHI instead of InitRHI to allow FParticleBeamTrailVertexFactory::InitRHI // to rely on it being initialized, since InitDynamicRHI is called before InitRHI. VertexDeclarationRHI = RHICreateVertexDeclaration(Elements); }
virtual void InitRHI() override { uint16 Stride = sizeof(FDistortionVertex); FVertexDeclarationElementList Elements; Elements.Add(FVertexElement(0, STRUCT_OFFSET(FDistortionVertex, Position),VET_Float2,0, Stride)); Elements.Add(FVertexElement(0, STRUCT_OFFSET(FDistortionVertex, TexR), VET_Float2, 1, Stride)); Elements.Add(FVertexElement(0, STRUCT_OFFSET(FDistortionVertex, TexG), VET_Float2, 2, Stride)); Elements.Add(FVertexElement(0, STRUCT_OFFSET(FDistortionVertex, TexB), VET_Float2, 3, Stride)); Elements.Add(FVertexElement(0, STRUCT_OFFSET(FDistortionVertex, VignetteFactor), VET_Float1, 4, Stride)); Elements.Add(FVertexElement(0, STRUCT_OFFSET(FDistortionVertex, TimewarpFactor), VET_Float1, 5, Stride)); VertexDeclarationRHI = RHICreateVertexDeclaration(Elements); }
void FSlateVertexDeclaration::InitRHI() { FVertexDeclarationElementList Elements; uint32 Stride = sizeof(FSlateVertex); Elements.Add(FVertexElement(0, STRUCT_OFFSET(FSlateVertex, TexCoords), VET_Float4, 0, Stride)); Elements.Add(FVertexElement(0, STRUCT_OFFSET(FSlateVertex, Position), VET_Float2, 1, Stride)); Elements.Add(FVertexElement(0, STRUCT_OFFSET(FSlateVertex, ClipRect) + STRUCT_OFFSET(FSlateRotatedClipRectType, TopLeft), VET_Float2, 2, Stride)); Elements.Add(FVertexElement(0, STRUCT_OFFSET(FSlateVertex, ClipRect) + STRUCT_OFFSET(FSlateRotatedClipRectType, ExtentX), VET_Float4, 3, Stride)); Elements.Add(FVertexElement(0, STRUCT_OFFSET(FSlateVertex, Color), VET_Color, 4, Stride)); VertexDeclarationRHI = RHICreateVertexDeclaration(Elements); }
virtual void InitRHI() override { FVertexDeclarationElementList Elements = { { 0, 0 * sizeof(FVector4), VET_Float4, 0, sizeof(FBenchmarkVertex) }, { 0, 1 * sizeof(FVector4), VET_Float4, 1, sizeof(FBenchmarkVertex) }, { 0, 2 * sizeof(FVector4), VET_Float4, 2, sizeof(FBenchmarkVertex) }, { 0, 3 * sizeof(FVector4), VET_Float4, 3, sizeof(FBenchmarkVertex) }, { 0, 4 * sizeof(FVector4), VET_Float4, 4, sizeof(FBenchmarkVertex) }, }; DeclRHI = RHICreateVertexDeclaration(Elements); }
void FVertexFactory::InitDeclaration( FVertexDeclarationElementList& Elements, const DataType& InData) { // Make a copy of the vertex factory data. Data = InData; // If GFFX detected, patch up the declarator if( !GVertexElementsCanShareStreamOffset ) { PatchVertexStreamOffsetsToBeUnique( Elements ); } // Create the vertex declaration for rendering the factory normally. Declaration = RHICreateVertexDeclaration(Elements); }
void FSlateVertexDeclaration::InitRHI() { FVertexDeclarationElementList Elements; uint32 Stride = sizeof(FSlateVertex); Elements.Add(FVertexElement(0,STRUCT_OFFSET(FSlateVertex,TexCoords),VET_Float4,0,Stride)); Elements.Add(FVertexElement(0,STRUCT_OFFSET(FSlateVertex,Position),VET_Short2,1,Stride)); bool bUseFloat16 = #if SLATE_USE_FLOAT16 true; #else false; #endif Elements.Add(FVertexElement(0,STRUCT_OFFSET(FSlateVertex,ClipRect),bUseFloat16 ? VET_Half2 : VET_Float2,2,Stride)); Elements.Add(FVertexElement(0,STRUCT_OFFSET(FSlateVertex,ClipRect)+STRUCT_OFFSET(FSlateRotatedClipRectType,ExtentX),bUseFloat16 ? VET_Half4 : VET_Float4,3,Stride)); Elements.Add(FVertexElement(0,STRUCT_OFFSET(FSlateVertex,Color),VET_Color,4,Stride)); VertexDeclarationRHI = RHICreateVertexDeclaration(Elements); }
virtual void InitRHI() override { FVertexDeclarationElementList Elements; // Stream 0. { int32 Offset = 0; // Sample. Elements.Add(FVertexElement(0, Offset, VET_Color, 0, sizeof(FColor), /*bUseInstanceIndex=*/ true)); Offset += sizeof(FColor); } // Stream 1. { int32 Offset = 0; // TexCoord. Elements.Add(FVertexElement(1, Offset, VET_Float2, 1, sizeof(FVector2D), /*bUseInstanceIndex=*/ false)); Offset += sizeof(FVector2D); } VertexDeclarationRHI = RHICreateVertexDeclaration( Elements ); }
void FVertexFactory::InitPositionDeclaration(const FVertexDeclarationElementList& Elements) { // Create the vertex declaration for rendering the factory normally. PositionDeclaration = RHICreateVertexDeclaration(Elements); }
virtual void InitRHI() override { FVertexDeclarationElementList Elements; Elements.Add(FVertexElement(0, 0, VET_Float2, 0, sizeof(FVector2D))); VertexDeclarationRHI = RHICreateVertexDeclaration(Elements); }