Skip to content

Commit

Permalink
First-person flags are defined by instance now -- so it can be inheri…
Browse files Browse the repository at this point in the history
…ted for already built AS
  • Loading branch information
sultim-t committed Nov 10, 2023
1 parent b188c5d commit 222e611
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 24 deletions.
34 changes: 17 additions & 17 deletions Include/RTGL1/RTGL1.h
Original file line number Diff line number Diff line change
Expand Up @@ -334,33 +334,33 @@ typedef enum RgMeshPrimitiveFlagBits
{
RG_MESH_PRIMITIVE_ALPHA_TESTED = 1 << 0,
RG_MESH_PRIMITIVE_TRANSLUCENT = 1 << 1,
RG_MESH_PRIMITIVE_FIRST_PERSON = 1 << 2,
RG_MESH_PRIMITIVE_FIRST_PERSON_VIEWER = 1 << 3,
RG_MESH_PRIMITIVE_SKY = 1 << 4,
RG_MESH_PRIMITIVE_MIRROR = 1 << 5,
RG_MESH_PRIMITIVE_GLASS = 1 << 6,
RG_MESH_PRIMITIVE_WATER = 1 << 7,
RG_MESH_PRIMITIVE_DONT_GENERATE_NORMALS = 1 << 8,
RG_MESH_PRIMITIVE_FORCE_EXACT_NORMALS = 1 << 9,
RG_MESH_PRIMITIVE_SKY = 1 << 2,
RG_MESH_PRIMITIVE_MIRROR = 1 << 3,
RG_MESH_PRIMITIVE_GLASS = 1 << 4,
RG_MESH_PRIMITIVE_WATER = 1 << 5,
RG_MESH_PRIMITIVE_DONT_GENERATE_NORMALS = 1 << 6,
RG_MESH_PRIMITIVE_FORCE_EXACT_NORMALS = 1 << 7,
// If roughness is too small, act as a mirror (perfect reflection).
RG_MESH_PRIMITIVE_MIRROR_IF_SMOOTH = 1 << 10,
RG_MESH_PRIMITIVE_MIRROR_IF_SMOOTH = 1 << 8,
// If roughness is too small, act as a glass (perfect reflection/refraction).
RG_MESH_PRIMITIVE_GLASS_IF_SMOOTH = 1 << 11,
RG_MESH_PRIMITIVE_GLASS_IF_SMOOTH = 1 << 9,
// Ignore refracting geometry behind this primitive.
RG_MESH_PRIMITIVE_IGNORE_REFRACT_AFTER = 1 << 12,
RG_MESH_PRIMITIVE_ACID = 1 << 13,
RG_MESH_PRIMITIVE_THIN_MEDIA = 1 << 14,
RG_MESH_PRIMITIVE_SKY_VISIBILITY = 1 << 15,
RG_MESH_PRIMITIVE_IGNORE_REFRACT_AFTER = 1 << 10,
RG_MESH_PRIMITIVE_ACID = 1 << 11,
RG_MESH_PRIMITIVE_THIN_MEDIA = 1 << 12,
RG_MESH_PRIMITIVE_SKY_VISIBILITY = 1 << 13,
// If set, the first triangle is analyzed to make a decal.
// Requires vertexCount >= 3.
RG_MESH_PRIMITIVE_DECAL = 1 << 16,
RG_MESH_PRIMITIVE_EXPORT_INVERT_NORMALS = 1 << 17,
RG_MESH_PRIMITIVE_DECAL = 1 << 14,
RG_MESH_PRIMITIVE_EXPORT_INVERT_NORMALS = 1 << 15,
} RgMeshPrimitiveFlagBits;
typedef uint32_t RgMeshPrimitiveFlags;

typedef enum RgMeshInfoFlagBits
{
RG_MESH_INFO_EXPORT_AS_SEPARATE_FILE = 1,
RG_MESH_EXPORT_AS_SEPARATE_FILE = 1 << 0,
RG_MESH_FIRST_PERSON = 1 << 1,
RG_MESH_FIRST_PERSON_VIEWER = 1 << 2,
} RgMeshInfoFlagBits;
typedef uint32_t RgMeshInfoFlags;

Expand Down
4 changes: 2 additions & 2 deletions Source/Scene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ bool RTGL1::Scene::ReplacementExists( const RgMeshInfo& mesh ) const
{
if( mesh.isExportable && !Utils::IsCstrEmpty( mesh.pMeshName ) )
{
if( mesh.flags & RG_MESH_INFO_EXPORT_AS_SEPARATE_FILE )
if( mesh.flags & RG_MESH_EXPORT_AS_SEPARATE_FILE )
{
return find_p( replacements, mesh.pMeshName );
}
Expand Down Expand Up @@ -238,7 +238,7 @@ RTGL1::UploadResult RTGL1::Scene::UploadPrimitive( uint32_t fr
return UploadResult::ExportableStatic;
}

if( mesh.flags & RG_MESH_INFO_EXPORT_AS_SEPARATE_FILE )
if( mesh.flags & RG_MESH_EXPORT_AS_SEPARATE_FILE )
{
replacement = find_p( replacements, mesh.pMeshName );
}
Expand Down
4 changes: 2 additions & 2 deletions Source/VertexCollectorFilterType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,11 @@ FL RTGL1::VertexCollectorFilterTypeFlags_GetForGeometry( const RgMeshInfo&
}


if( primitive.flags & RG_MESH_PRIMITIVE_FIRST_PERSON )
if( mesh.flags & RG_MESH_FIRST_PERSON )
{
flags |= FL( FT::PV_FIRST_PERSON );
}
else if( primitive.flags & RG_MESH_PRIMITIVE_FIRST_PERSON_VIEWER )
else if( mesh.flags & RG_MESH_FIRST_PERSON_VIEWER )
{
flags |= FL( FT::PV_FIRST_PERSON_VIEWER );
}
Expand Down
6 changes: 3 additions & 3 deletions Source/VulkanDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1116,7 +1116,7 @@ void RTGL1::VulkanDevice::UploadMeshPrimitive( const RgMeshInfo* pMesh,


if( auto e = sceneImportExport->TryGetExporter( mesh.flags &
RG_MESH_INFO_EXPORT_AS_SEPARATE_FILE ) )
RG_MESH_EXPORT_AS_SEPARATE_FILE ) )
{
auto allowMeshExport = [ & ]( const RgMeshInfo& m ) {
if( r != UploadResult::ExportableDynamic &&
Expand All @@ -1141,7 +1141,7 @@ void RTGL1::VulkanDevice::UploadMeshPrimitive( const RgMeshInfo* pMesh,
}

// SHIPPING_HACK: add lights to the scene gltf even for non-exportable geometry
if( !( mesh.flags & RG_MESH_INFO_EXPORT_AS_SEPARATE_FILE ) )
if( !( mesh.flags & RG_MESH_EXPORT_AS_SEPARATE_FILE ) )
{
e->AddPrimitiveLights( mesh, prim );
}
Expand Down Expand Up @@ -1292,7 +1292,7 @@ void RTGL1::VulkanDevice::UploadMeshPrimitive( const RgMeshInfo* pMesh,
{
throw RgException( RG_RESULT_WRONG_FUNCTION_ARGUMENT, "Argument is null" );
}
if( mesh->flags & RG_MESH_INFO_EXPORT_AS_SEPARATE_FILE )
if( mesh->flags & RG_MESH_EXPORT_AS_SEPARATE_FILE )
{
if( !mesh->isExportable )
{
Expand Down

0 comments on commit 222e611

Please sign in to comment.