Working on exposing the doubles-sided flag outside the Opacity property group.

Before, the only way to set the double-sided flag was to enable a non-opaque mode, because the flag was hidden. We are moving the double-sided flag to the general property group instead of the opacity property group, so it is always available. In this particular commit, we just add the general.doubleSided property so we don't break existing data. In an upcoming commit I will remove opacity.doubleSided, once we have the material backward compatibility system ready.

I also added another "default" texture map to the Common/Feature gem that is directional, so better for understanding UV/tangent space. These were copied from the AtomLyIntegration gem. This is being used for a screenshot test in AtomSampleViewer with the new 009_Opacity_Opaque_DoubleSided.material.

Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
This commit is contained in:
santorac
2021-09-23 12:41:26 -07:00
parent 5ae35810ae
commit f92daf060b
7 changed files with 40 additions and 3 deletions
@@ -92,6 +92,12 @@
],
"properties": {
"general": [
{
"id": "doubleSided",
"displayName": "Double-sided",
"description": "Whether to render back-faces or just front-faces.",
"type": "Bool"
},
{
"id": "applySpecularAA",
"displayName": "Apply Specular AA",
@@ -72,6 +72,12 @@
],
"properties": {
"general": [
{
"id": "doubleSided",
"displayName": "Double-sided",
"description": "Whether to render back-faces or just front-faces.",
"type": "Bool"
},
{
"id": "applySpecularAA",
"displayName": "Apply Specular AA",
@@ -10,17 +10,19 @@
----------------------------------------------------------------------------------------------------
function GetMaterialPropertyDependencies()
return {"opacity.doubleSided"}
return {"general.doubleSided", "opacity.doubleSided", "opacity.mode"}
end
ForwardPassIndex = 0
ForwardPassEdsIndex = 1
function Process(context)
local doubleSided = context:GetMaterialPropertyValue_bool("opacity.doubleSided")
local doubleSided = context:GetMaterialPropertyValue_bool("general.doubleSided")
local opacityDoubleSided = context:GetMaterialPropertyValue_bool("opacity.doubleSided")
local opacityMode = context:GetMaterialPropertyValue_enum("opacity.mode")
local lastShader = context:GetShaderCount() - 1;
if(doubleSided) then
if(doubleSided or (opacityDoubleSided and opacityMode ~= 0)) then
for i=0,lastShader do
context:GetShader(i):GetRenderStatesOverride():SetCullMode(CullMode_None)
end
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:57d6744696768f9fb8a5fe5fee9aa36fee1eb87a9dbc1e60d4a35ed3c39d68e6
size 810620
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:513f47f6fea5105f603170a8881b7e3b1cd2c4258636d64a6399c725032b500d
size 38689
@@ -0,0 +1,14 @@
{
"description": "",
"materialType": "Materials/Types/StandardPBR.materialtype",
"parentMaterial": "",
"propertyLayoutVersion": 3,
"properties": {
"baseColor": {
"textureMap": "Textures/Default/checker_uv_basecolor.png"
},
"general": {
"doubleSided": true
}
}
}
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b2ecc32cd3052f3cb5836c8be7bf5cba54d98f46e6a0eeac95aaef00a123411a
size 27340