Compare commits

...

2 Commits

Author SHA1 Message Date
yang.yongquan ed80ace902 merge 2023-01-19 16:59:08 +08:00
白封羽 4eba93a4f7 分支合并 2023-01-19 15:41:21 +08:00
3 changed files with 49 additions and 6 deletions

View File

@ -61,14 +61,14 @@
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<LanguageStandard>stdcpp17</LanguageStandard>
<LanguageStandard>stdcpp20</LanguageStandard>
<AdditionalIncludeDirectories>$(SolutionDir)QGoodWindow;%(AdditionalIncludeDirectories);$(Qt_INCLUDEPATH_)</AdditionalIncludeDirectories>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<LanguageStandard>stdcpp17</LanguageStandard>
<AdditionalIncludeDirectories>$(SolutionDir)ArchitectureColoredPainting\src\Editor\RightBar;$(SolutionDir)ArchitectureColoredPainting\src\Editor\;$(SolutionDir)QGoodWindow;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<LanguageStandard>stdcpp20</LanguageStandard>
<AdditionalIncludeDirectories>$(SolutionDir)QGoodWindow;%(AdditionalIncludeDirectories);</AdditionalIncludeDirectories>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="Configuration">

View File

@ -367,6 +367,9 @@
<ClInclude Include="src\Editor\third-party modules\util\SvgFileLoader.h">
<Filter>Header Files\Editor\util</Filter>
</ClInclude>
<ClInclude Include="src\Renderer\Painting\ElementStyle.h">
<Filter>Header Files\Renderer\Painting</Filter>
</ClInclude>
<ClInclude Include="src\Editor\LayerWrapper.h">
<Filter>Header Files\Editor</Filter>
<Filter>Header Files\Editor\third-party modules\qquick</Filter>
@ -374,9 +377,6 @@
<ClInclude Include="src\Editor\third-party modules\util\SvgFileLoader.h">
<Filter>Header Files\Editor\util</Filter>
</ClInclude>
<ClInclude Include="src\Renderer\Painting\ElementStyle.h">
<Filter>Header Files\Renderer\Painting</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<QtRcc Include="MainWindow.qrc">

View File

@ -876,6 +876,49 @@ void drawLine(in float d, in uint styleIndex, out vec4 elementColor, out vec2 me
}
}
void drawLine(in float d, in uint styleIndex, out vec4 elementColor, out vec2 metallicRoughness)
{
elementColor = vec4(1);
metallicRoughness = vec2(0.8);
switch(int(elementData[styleIndex+3]))
{
case 0:
{
elementColor = vec4(elementData[styleIndex+7],elementData[styleIndex+8],elementData[styleIndex+9],1);
metallicRoughness = vec2(elementData[styleIndex+10],elementData[styleIndex+11]);
break;
}
case 1:
{
elementColor = vec4(mix(vec3(0), vec3(1), d), 1);
metallicRoughness = vec2(0,0.8);
break;
}
case 2:
{
float levels[] = {0.25,0.5,0.75};
vec3 colors[] = {vec3(1,0,0), vec3(0,1,0), vec3(0,0,1), vec3(1,1,0)};
int i = 0;
while(i<3)
{
if(d<levels[i])
{
elementColor = vec4(colors[i], 1);
metallicRoughness = vec2(0,0.8);
break;
}
i++;
}
if(i==3)
{
elementColor = vec4(colors[i], 1);
metallicRoughness = vec2(0,0.8);
}
break;
}
}
}
bool drawElement(uint elementIndex, vec2 localUV, out vec3 color, out vec2 metallicRoughness, inout vec3 debugBVH = vec3(0))
{
bool hitElement = false;