Files
Steve Pham 38261d0800 Shorten copyright headers by splitting into 2 lines (#2213)
* Updated all copyright headers to split the longer original copyright line into 2 shorter lines

Signed-off-by: Steve Pham <spham@amazon.com>
2021-07-16 15:25:48 -07:00

43 lines
1.2 KiB
Plaintext

/*
* Copyright (c) Contributors to the Open 3D Engine Project.
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#pragma once
#include <Atom/Features/SrgSemantics.azsli>
ShaderResourceGroup ObjectSrg : SRG_PerDraw
{
float4 m_color;
row_major float3x4 m_modelToWorld;
row_major float3x3 m_normalMatrix;
row_major float4x4 m_viewProjectionOverride;
float m_pointSize;
//! Returns the matrix for transforming points from Object Space to World Space.
float4x4 GetWorldMatrix()
{
float4x4 modelToWorld = float4x4(
float4(1, 0, 0, 0),
float4(0, 1, 0, 0),
float4(0, 0, 1, 0),
float4(0, 0, 0, 1));
modelToWorld[0] = m_modelToWorld[0];
modelToWorld[1] = m_modelToWorld[1];
modelToWorld[2] = m_modelToWorld[2];
return modelToWorld;
}
//! Returns the inverse-transpose of the world matrix.
//! Commonly used to transform normals while supporting non-uniform scale.
float3x3 GetWorldMatrixInverseTranspose()
{
return m_normalMatrix;
}
}