Skip to content

Commit 736b4bf

Browse files
author
KEVIN-ALIEN\kevin
committed
-Updated documentation
-Improved Demo content -Fixed release build target
1 parent 06c2173 commit 736b4bf

File tree

21 files changed

+42
-30
lines changed

21 files changed

+42
-30
lines changed
-734 Bytes
Binary file not shown.

Documentation/ShaderBox_KevinLoddewykx.tex

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,13 +177,13 @@ \section{ShaderBox}
177177
178178
\newpage
179179
\subsection{Planning}
180-
Currently I am working on \textbf{rewriting} how the \textbf{3D viewport} is hooked up with the user interface. At the moment it is using the \href{https://github.com/Microsoft/WPFDXInterop}{WPF DirectX Extensions} project from Microsoft, which allows you to render with DirectX 11 to a image hosted inside WPF. The problem with this approach is that WPF handles internally when a new frame needs to be rendered and you need to use a Flush call on the DeviceContext to have the content appear, which is a non-blocking call and causes flickering. Also all the input needs to be captured inside the WPF application and manually send to the engine and the rendering needs to run on the UI thread.
180+
Currently I am working on creating a UI design document. Describing the future UI layout, taking into account al the planned and backlogged feautures and extensibility.
181181
\par
182182
Planned
183183
\begin{itemize}[noitemsep]
184184
\item Docking manager + multiple text editors
185185
\item Improve integration of HlslTools: folding, code completion, ...
186-
\item C++/CLI project instead of marshalling
186+
\item C++/CLI project instead of marshalling for ShaderCompiler
187187
\end{itemize}
188188
189189
Backlogged
@@ -205,7 +205,7 @@ \subsection{Planning}
205205
\subsection{Workings}
206206
When creating a new shader you can choose which type of shader you want to make, the passes it will need, the topology and set up the rasterizer. Afterwards Shader Box will initialize a new shader project with for each choosen pass a file. The user can always add extra header files which can be used locally so only the project can access it, or set it as a shared header so all the projects can include it. There is one built-in shared header which includes the samplerstates which the engine supports, two cbuffers one for the camera information which changes every frame and one for the per object information (currently only one object per scene). And a reserved slot for a texture, for when creating a post processing shader.
207207
\par
208-
After writing your shader you can click compile or build. Compile will only compile the active shader pass and output the found errors, while build will compile the entire project to precompiled shader files and create a properties panel, for controlling the parameters. The look of the properties panel can be controlled by metadata, using the same syntax as in FX Composer. Finding all this information is done by calling the SyntaxFactory.ParseSyntaxTree(...) method of HLSL Tools on each pass seperatly while passing the shader content. Next Shader Box will go over each SyntaxTree and extract the necessary data for creating the properties, for each found cbuffer a byte array is created which stores the settings which needs to be passed to the GPU. Every variable gets a offset to where it value needs to be stored in the array, in conformance with the HLSL packing needs. Every time the user updates a variable this byte array, which is defined in C\#, gets marshalled to the C++ engine.
208+
After writing your shader you can click compile or build. Compile will only compile the active shader pass and output the found errors, while build will compile the entire project to precompiled shader files and create a properties panel, for controlling the parameters. The look of the properties panel can be controlled by metadata, using the same syntax as in FX Composer. Finding all this information is done by calling the SyntaxFactory.ParseSyntaxTree(...) method of HLSL Tools on each pass seperatly while passing the shader content. Next Shader Box will go over each SyntaxTree and extract the necessary data for creating the properties, for each found cbuffer a byte array is created which stores the settings which needs to be passed to the GPU. Every variable gets a offset to where it value needs to be stored in the array, in conformance with the HLSL packing needs. Every time the user updates a variable this byte array, which is defined in C\#, goes through a C++/CLI project to the C++ engine.
209209
210210
\newpage
211211
\subsection{Tab: Library}\label{subsec:tab_l}
@@ -248,7 +248,9 @@ \subsection{Sub window: New shader}\label{subsec:tab_d}
248248
\begin{itemize}
249249
\item Post processing
250250
\end{itemize}
251-
When you want to write a Post processing effect, requires a vertex shader and pixel shader, the other shader types are disabled.
251+
When you want to write a Post processing effect, only pixel shader is required and the other shader types are disabled.
252+
\par
253+
A vertex shader is not required, due to the engine providing this. The engine internally uses a vertex shader utilizing the Fullscreen Triangle Optimization.
252254
253255
Other settings you can set inside the window are:
254256
\begin{itemize}[noitemsep]

Source/DemoProject/Resources/.Internal/ShaderBox.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<ShaderGroup Path="./Resources/PP_Blur_2017_1_22-23_03/PP_Blur.sbproj" IsOpen="true" />
88
<ShaderGroup Path="./Resources/PP_Sepia_Vignette_2017_1_22-23_46/PP_Sepia_Vignette.sbproj" IsOpen="true" />
99
<ShaderGroup Path="./Resources/PP_CubicLensDistortion_2017_1_23-06_55/PP_CubicLensDistortion.sbproj" IsOpen="true" />
10-
<ShaderGroup Path="./Resources/Glow Outline_2017_10_2-15_53/NPR Shader.sbproj" IsOpen="true" />
10+
<ShaderGroup Path="./Resources/PBR_2017_10_2-15_53/NPR Shader.sbproj" IsOpen="true" />
1111
</Shadergroups>
1212
<Images>
1313
<Image Name="plus.png" ImagePath="./Resources/.Data/Images/plus.png" IsBuiltIn="false" />
Binary file not shown.
-793 Bytes
Binary file not shown.

Source/DemoProject/Resources/Glow Outline_2017_10_2-15_53/.cso/gs.cso renamed to Source/DemoProject/Resources/PBR_2017_10_2-15_53/.cso/gs.cso

File renamed without changes.
2.1 KB
Binary file not shown.

Source/DemoProject/Resources/Glow Outline_2017_10_2-15_53/.cso/vs.cso renamed to Source/DemoProject/Resources/PBR_2017_10_2-15_53/.cso/vs.cso

File renamed without changes.

Source/DemoProject/Resources/Glow Outline_2017_10_2-15_53/Header.hlsli renamed to Source/DemoProject/Resources/PBR_2017_10_2-15_53/Header.hlsli

File renamed without changes.

Source/DemoProject/Resources/Glow Outline_2017_10_2-15_53/NPR Shader.sbproj renamed to Source/DemoProject/Resources/PBR_2017_10_2-15_53/NPR Shader.sbproj

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0"?>
22
<ShaderGroup xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
3-
<NameIdentifier>Glow Outline_2017_10_2-15_53</NameIdentifier>
3+
<NameIdentifier>PBR_2017_10_2-15_53</NameIdentifier>
44
<Name>NPR Shader</Name>
55
<Description>A geometry shader showcasing two silhoutte rendering techniques and one crease</Description>
66
<IsBuilded>true</IsBuilded>
@@ -10,11 +10,11 @@
1010
<Buffers>
1111
<Buffer>
1212
<Register>b3</Register>
13-
<BufferSize>64</BufferSize>
13+
<BufferSize>80</BufferSize>
1414
<Variables>
1515
<Variable Name="m_ColorDiffuse" DataType="Float" IsSNorm="false" IsUNorm="false" Rows="1" Columns="3" IsScalar="false" IsVector="true" IsMatrix="false" IsArray="false" IsTexture="false" Dimension="-1" Offset="0" Size="12">
1616
<Value>
17-
<Color r="231" g="231" b="231" a="255" scR="0.8" scG="0.8" scB="0.8" scA="1" />
17+
<Color r="163" g="163" b="163" a="255" scR="0.366252631" scG="0.366252631" scB="0.366252631" scA="1" />
1818
</Value>
1919
<AnnotationKeywords>
2020
<KVPairSerializable>
@@ -42,7 +42,7 @@
4242
</Variable>
4343
<Variable Name="m_SilhoutteEdgeColor" DataType="Float" IsSNorm="false" IsUNorm="false" Rows="1" Columns="4" IsScalar="false" IsVector="true" IsMatrix="false" IsArray="false" IsTexture="false" Dimension="-1" Offset="32" Size="16">
4444
<Value>
45-
<Color r="231" g="231" b="231" a="255" scR="0.8" scG="0.8" scB="0.8" scA="1" />
45+
<Color r="255" g="0" b="0" a="255" scR="1" scG="0" scB="0" scA="1" />
4646
</Value>
4747
<AnnotationKeywords>
4848
<KVPairSerializable>
@@ -53,7 +53,7 @@
5353
</Variable>
5454
<Variable Name="m_CreaseEdgeColor" DataType="Float" IsSNorm="false" IsUNorm="false" Rows="1" Columns="4" IsScalar="false" IsVector="true" IsMatrix="false" IsArray="false" IsTexture="false" Dimension="-1" Offset="48" Size="16">
5555
<Value>
56-
<Color r="231" g="231" b="231" a="255" scR="0.8" scG="0.8" scB="0.8" scA="1" />
56+
<Color r="0" g="255" b="255" a="255" scR="0" scG="1" scB="1" scA="1" />
5757
</Value>
5858
<AnnotationKeywords>
5959
<KVPairSerializable>
@@ -62,6 +62,12 @@
6262
</KVPairSerializable>
6363
</AnnotationKeywords>
6464
</Variable>
65+
<Variable Name="useTexture" DataType="Bool" IsSNorm="false" IsUNorm="false" Rows="0" Columns="0" IsScalar="true" IsVector="false" IsMatrix="false" IsArray="false" IsTexture="false" Dimension="-1" Offset="64" Size="4">
66+
<Value>
67+
<Value_b>false</Value_b>
68+
</Value>
69+
<AnnotationKeywords />
70+
</Variable>
6571
</Variables>
6672
</Buffer>
6773
<Buffer>
@@ -85,7 +91,7 @@
8591
<Variables>
8692
<Variable Name="creaseWidth" DataType="Float" IsSNorm="false" IsUNorm="false" Rows="0" Columns="0" IsScalar="true" IsVector="false" IsMatrix="false" IsArray="false" IsTexture="false" Dimension="-1" Offset="0" Size="4">
8793
<Value>
88-
<Value_d>0</Value_d>
94+
<Value_d>0.025</Value_d>
8995
</Value>
9096
<AnnotationKeywords>
9197
<KVPairSerializable>
@@ -104,7 +110,7 @@
104110
</Variable>
105111
<Variable Name="edgeWidth" DataType="Float" IsSNorm="false" IsUNorm="false" Rows="0" Columns="0" IsScalar="true" IsVector="false" IsMatrix="false" IsArray="false" IsTexture="false" Dimension="-1" Offset="4" Size="4">
106112
<Value>
107-
<Value_d>0</Value_d>
113+
<Value_d>0.05</Value_d>
108114
</Value>
109115
<AnnotationKeywords>
110116
<KVPairSerializable>
@@ -123,7 +129,7 @@
123129
</Variable>
124130
<Variable Name="creaseThreshold" DataType="Float" IsSNorm="false" IsUNorm="false" Rows="0" Columns="0" IsScalar="true" IsVector="false" IsMatrix="false" IsArray="false" IsTexture="false" Dimension="-1" Offset="8" Size="4">
125131
<Value>
126-
<Value_d>0</Value_d>
132+
<Value_d>0.20000000000000004</Value_d>
127133
</Value>
128134
<AnnotationKeywords>
129135
<KVPairSerializable>
@@ -157,29 +163,29 @@
157163
<FillMode>Solid</FillMode>
158164
<HasHullDomainShader>false</HasHullDomainShader>
159165
<HasGeometryShader>true</HasGeometryShader>
160-
<SelectedModel>1333716873</SelectedModel>
166+
<SelectedModel>145058193</SelectedModel>
161167
<Shaders>
162168
<IsBuiltIn>false</IsBuiltIn>
163169
<ShaderType>Vertex</ShaderType>
164170
<Name>vs.hlsl</Name>
165-
<FileLocation>./Resources/Glow Outline_2017_10_2-15_53/vs.hlsl</FileLocation>
171+
<FileLocation>./Resources/PBR_2017_10_2-15_53/vs.hlsl</FileLocation>
166172
</Shaders>
167173
<Shaders>
168174
<IsBuiltIn>false</IsBuiltIn>
169175
<ShaderType>Pixel</ShaderType>
170176
<Name>ps.hlsl</Name>
171-
<FileLocation>./Resources/Glow Outline_2017_10_2-15_53/ps.hlsl</FileLocation>
177+
<FileLocation>./Resources/PBR_2017_10_2-15_53/ps.hlsl</FileLocation>
172178
</Shaders>
173179
<Shaders>
174180
<IsBuiltIn>false</IsBuiltIn>
175181
<ShaderType>Header</ShaderType>
176182
<Name>Header.hlsli</Name>
177-
<FileLocation>./Resources/Glow Outline_2017_10_2-15_53/Header.hlsli</FileLocation>
183+
<FileLocation>./Resources/PBR_2017_10_2-15_53/Header.hlsli</FileLocation>
178184
</Shaders>
179185
<Shaders>
180186
<IsBuiltIn>false</IsBuiltIn>
181187
<ShaderType>Geometry</ShaderType>
182188
<Name>gs.hlsl</Name>
183-
<FileLocation>./Resources/Glow Outline_2017_10_2-15_53/gs.hlsl</FileLocation>
189+
<FileLocation>./Resources/PBR_2017_10_2-15_53/gs.hlsl</FileLocation>
184190
</Shaders>
185191
</ShaderGroup>

0 commit comments

Comments
 (0)