port from perforce
This commit is contained in:
BIN
hgplus/revision15-8k/8kode.opensdf
Normal file
BIN
hgplus/revision15-8k/8kode.opensdf
Normal file
Binary file not shown.
62
hgplus/revision15-8k/8kode.sln
Normal file
62
hgplus/revision15-8k/8kode.sln
Normal file
@@ -0,0 +1,62 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2013
|
||||
VisualStudioVersion = 12.0.31101.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "intro", "src\intro\intro.vcxproj", "{EC001821-5569-4BB5-87B3-20CB8FF9137B}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{6D00EB12-7129-482A-8011-F187F20345DF} = {6D00EB12-7129-482A-8011-F187F20345DF}
|
||||
{930621BA-75BE-49FE-80DE-E75E7DC06931} = {930621BA-75BE-49FE-80DE-E75E7DC06931}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "tool", "src\tool\tool.csproj", "{6D00EB12-7129-482A-8011-F187F20345DF}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{930621BA-75BE-49FE-80DE-E75E7DC06931} = {930621BA-75BE-49FE-80DE-E75E7DC06931}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "shc", "src\shc\shc.csproj", "{930621BA-75BE-49FE-80DE-E75E7DC06931}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Authoring|Mixed Platforms = Authoring|Mixed Platforms
|
||||
Compress|Mixed Platforms = Compress|Mixed Platforms
|
||||
Release|Mixed Platforms = Release|Mixed Platforms
|
||||
ShaderDebug|Mixed Platforms = ShaderDebug|Mixed Platforms
|
||||
Video|Mixed Platforms = Video|Mixed Platforms
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{EC001821-5569-4BB5-87B3-20CB8FF9137B}.Authoring|Mixed Platforms.ActiveCfg = Authoring|Win32
|
||||
{EC001821-5569-4BB5-87B3-20CB8FF9137B}.Authoring|Mixed Platforms.Build.0 = Authoring|Win32
|
||||
{EC001821-5569-4BB5-87B3-20CB8FF9137B}.Compress|Mixed Platforms.ActiveCfg = Compress|Win32
|
||||
{EC001821-5569-4BB5-87B3-20CB8FF9137B}.Compress|Mixed Platforms.Build.0 = Compress|Win32
|
||||
{EC001821-5569-4BB5-87B3-20CB8FF9137B}.Release|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{EC001821-5569-4BB5-87B3-20CB8FF9137B}.Release|Mixed Platforms.Build.0 = Release|Win32
|
||||
{EC001821-5569-4BB5-87B3-20CB8FF9137B}.ShaderDebug|Mixed Platforms.ActiveCfg = ShaderDebug|Win32
|
||||
{EC001821-5569-4BB5-87B3-20CB8FF9137B}.ShaderDebug|Mixed Platforms.Build.0 = ShaderDebug|Win32
|
||||
{EC001821-5569-4BB5-87B3-20CB8FF9137B}.Video|Mixed Platforms.ActiveCfg = Video|Win32
|
||||
{EC001821-5569-4BB5-87B3-20CB8FF9137B}.Video|Mixed Platforms.Build.0 = Video|Win32
|
||||
{6D00EB12-7129-482A-8011-F187F20345DF}.Authoring|Mixed Platforms.ActiveCfg = Authoring|Any CPU
|
||||
{6D00EB12-7129-482A-8011-F187F20345DF}.Authoring|Mixed Platforms.Build.0 = Authoring|Any CPU
|
||||
{6D00EB12-7129-482A-8011-F187F20345DF}.Compress|Mixed Platforms.ActiveCfg = Void|Any CPU
|
||||
{6D00EB12-7129-482A-8011-F187F20345DF}.Compress|Mixed Platforms.Build.0 = Void|Any CPU
|
||||
{6D00EB12-7129-482A-8011-F187F20345DF}.Release|Mixed Platforms.ActiveCfg = Void|Any CPU
|
||||
{6D00EB12-7129-482A-8011-F187F20345DF}.Release|Mixed Platforms.Build.0 = Void|Any CPU
|
||||
{6D00EB12-7129-482A-8011-F187F20345DF}.ShaderDebug|Mixed Platforms.ActiveCfg = Void|Any CPU
|
||||
{6D00EB12-7129-482A-8011-F187F20345DF}.ShaderDebug|Mixed Platforms.Build.0 = Void|Any CPU
|
||||
{6D00EB12-7129-482A-8011-F187F20345DF}.Video|Mixed Platforms.ActiveCfg = Void|Any CPU
|
||||
{6D00EB12-7129-482A-8011-F187F20345DF}.Video|Mixed Platforms.Build.0 = Void|Any CPU
|
||||
{930621BA-75BE-49FE-80DE-E75E7DC06931}.Authoring|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{930621BA-75BE-49FE-80DE-E75E7DC06931}.Authoring|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{930621BA-75BE-49FE-80DE-E75E7DC06931}.Compress|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{930621BA-75BE-49FE-80DE-E75E7DC06931}.Compress|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{930621BA-75BE-49FE-80DE-E75E7DC06931}.Release|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{930621BA-75BE-49FE-80DE-E75E7DC06931}.Release|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{930621BA-75BE-49FE-80DE-E75E7DC06931}.ShaderDebug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{930621BA-75BE-49FE-80DE-E75E7DC06931}.ShaderDebug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{930621BA-75BE-49FE-80DE-E75E7DC06931}.Video|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{930621BA-75BE-49FE-80DE-E75E7DC06931}.Video|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
BIN
hgplus/revision15-8k/8kode.v12.suo
Normal file
BIN
hgplus/revision15-8k/8kode.v12.suo
Normal file
Binary file not shown.
204
hgplus/revision15-8k/data.rocket
Normal file
204
hgplus/revision15-8k/data.rocket
Normal file
@@ -0,0 +1,204 @@
|
||||
<sync rows="265">
|
||||
<tracks>
|
||||
<track name="cameraPosition_x">
|
||||
<key interpolation="2" value="0" row="0"/>
|
||||
<key interpolation="0" value="-10" row="32"/>
|
||||
<key interpolation="1" value="-10" row="48"/>
|
||||
<key interpolation="0" value="10" row="63"/>
|
||||
<key interpolation="1" value="-10" row="64"/>
|
||||
<key interpolation="0" value="10" row="79"/>
|
||||
<key interpolation="1" value="-4" row="80"/>
|
||||
<key interpolation="0" value="0" row="95"/>
|
||||
<key interpolation="2" value="0" row="112"/>
|
||||
<key interpolation="0" value="15" row="143"/>
|
||||
<key interpolation="0" value="-8" row="144"/>
|
||||
<key interpolation="0" value="0" row="176"/>
|
||||
<key interpolation="1" value="5" row="192"/>
|
||||
<key interpolation="2" value="0" row="208"/>
|
||||
<key interpolation="2" value="100" row="224"/>
|
||||
<key interpolation="0" value="10" row="240"/>
|
||||
</track>
|
||||
<track name="cameraPosition_y">
|
||||
<key interpolation="0" value="5" row="0"/>
|
||||
<key interpolation="1" value="3.5" row="80"/>
|
||||
<key interpolation="0" value="2.6" row="95"/>
|
||||
<key interpolation="0" value="3" row="144"/>
|
||||
<key interpolation="2" value="25" row="176"/>
|
||||
<key interpolation="0" value="3" row="191"/>
|
||||
<key interpolation="0" value="30" row="192"/>
|
||||
<key interpolation="1" value="-4" row="208"/>
|
||||
<key interpolation="0" value="50" row="223"/>
|
||||
<key interpolation="2" value="15" row="224"/>
|
||||
<key interpolation="0" value="5" row="240"/>
|
||||
</track>
|
||||
<track name="cameraPosition_z">
|
||||
<key interpolation="1" value="-1" row="0"/>
|
||||
<key interpolation="0" value="10" row="15"/>
|
||||
<key interpolation="2" value="10" row="16"/>
|
||||
<key interpolation="3" value="40" row="32"/>
|
||||
<key interpolation="0" value="60" row="47"/>
|
||||
<key interpolation="1" value="70" row="48"/>
|
||||
<key interpolation="0" value="90" row="63"/>
|
||||
<key interpolation="1" value="100" row="64"/>
|
||||
<key interpolation="0" value="120" row="79"/>
|
||||
<key interpolation="0" value="152" row="80"/>
|
||||
<key interpolation="1" value="160" row="96"/>
|
||||
<key interpolation="0" value="180" row="111"/>
|
||||
<key interpolation="0" value="31" row="144"/>
|
||||
<key interpolation="2" value="0" row="176"/>
|
||||
<key interpolation="2" value="20" row="184"/>
|
||||
<key interpolation="0" value="10" row="191"/>
|
||||
<key interpolation="0" value="20" row="192"/>
|
||||
<key interpolation="0" value="18" row="208"/>
|
||||
<key interpolation="3" value="50" row="224"/>
|
||||
<key interpolation="0" value="50" row="240"/>
|
||||
</track>
|
||||
<track name="cameraCenter_x">
|
||||
<key interpolation="0" value="0" row="0"/>
|
||||
<key interpolation="1" value="-5" row="48"/>
|
||||
<key interpolation="0" value="5" row="63"/>
|
||||
<key interpolation="0" value="0" row="80"/>
|
||||
<key interpolation="0" value="-4" row="144"/>
|
||||
<key interpolation="0" value="0" row="176"/>
|
||||
<key interpolation="2" value="0" row="184"/>
|
||||
<key interpolation="0" value="-5" row="192"/>
|
||||
<key interpolation="1" value="-25" row="208"/>
|
||||
<key interpolation="2" value="40" row="224"/>
|
||||
<key interpolation="0" value="0" row="240"/>
|
||||
</track>
|
||||
<track name="cameraCenter_y">
|
||||
<key interpolation="2" value="-2" row="0"/>
|
||||
<key interpolation="0" value="-10" row="32"/>
|
||||
<key interpolation="2" value="-10" row="48"/>
|
||||
<key interpolation="2" value="-5" row="56"/>
|
||||
<key interpolation="0" value="-10" row="63"/>
|
||||
<key interpolation="1" value="-2" row="80"/>
|
||||
<key interpolation="0" value="-8" row="95"/>
|
||||
<key interpolation="0" value="-5" row="96"/>
|
||||
<key interpolation="0" value="0" row="144"/>
|
||||
<key interpolation="2" value="20" row="176"/>
|
||||
<key interpolation="2" value="10" row="184"/>
|
||||
<key interpolation="0" value="0" row="192"/>
|
||||
<key interpolation="1" value="20" row="208"/>
|
||||
<key interpolation="0" value="35" row="223"/>
|
||||
<key interpolation="1" value="15" row="224"/>
|
||||
<key interpolation="0" value="5" row="240"/>
|
||||
</track>
|
||||
<track name="cameraCenter_z">
|
||||
<key interpolation="1" value="4" row="0"/>
|
||||
<key interpolation="0" value="15" row="15"/>
|
||||
<key interpolation="2" value="15" row="16"/>
|
||||
<key interpolation="3" value="50" row="32"/>
|
||||
<key interpolation="0" value="70" row="47"/>
|
||||
<key interpolation="1" value="80" row="48"/>
|
||||
<key interpolation="0" value="100" row="63"/>
|
||||
<key interpolation="1" value="90" row="64"/>
|
||||
<key interpolation="0" value="110" row="79"/>
|
||||
<key interpolation="1" value="145" row="80"/>
|
||||
<key interpolation="0" value="135" row="95"/>
|
||||
<key interpolation="1" value="150" row="96"/>
|
||||
<key interpolation="0" value="170" row="111"/>
|
||||
<key interpolation="0" value="50" row="144"/>
|
||||
<key interpolation="2" value="5" row="176"/>
|
||||
<key interpolation="0" value="25" row="184"/>
|
||||
<key interpolation="0" value="50" row="192"/>
|
||||
<key interpolation="1" value="20" row="208"/>
|
||||
<key interpolation="0" value="100" row="224"/>
|
||||
</track>
|
||||
<track name="cameraUp_x">
|
||||
<key interpolation="0" value="0" row="0"/>
|
||||
<key interpolation="0" value="0" row="16"/>
|
||||
<key interpolation="0" value="0" row="48"/>
|
||||
<key interpolation="1" value="0" row="80"/>
|
||||
<key interpolation="0" value="0.1" row="95"/>
|
||||
<key interpolation="0" value="0" row="96"/>
|
||||
<key interpolation="0" value="0" row="144"/>
|
||||
<key interpolation="0" value="0" row="176"/>
|
||||
</track>
|
||||
<track name="cameraUp_y">
|
||||
<key interpolation="0" value="1" row="0"/>
|
||||
<key interpolation="0" value="1" row="16"/>
|
||||
<key interpolation="0" value="2" row="48"/>
|
||||
<key interpolation="0" value="1" row="80"/>
|
||||
<key interpolation="0" value="1" row="96"/>
|
||||
<key interpolation="0" value="1" row="144"/>
|
||||
<key interpolation="0" value="1" row="176"/>
|
||||
</track>
|
||||
<track name="cameraUp_z">
|
||||
<key interpolation="1" value="2" row="0"/>
|
||||
<key interpolation="0" value="0" row="16"/>
|
||||
<key interpolation="0" value="1" row="48"/>
|
||||
<key interpolation="0" value="-1" row="64"/>
|
||||
<key interpolation="0" value="0" row="80"/>
|
||||
<key interpolation="0" value="0" row="96"/>
|
||||
<key interpolation="0" value="0" row="144"/>
|
||||
<key interpolation="0" value="0" row="176"/>
|
||||
</track>
|
||||
<track name="fade">
|
||||
<key interpolation="0" value="0.5" row="0"/>
|
||||
<key interpolation="1" value="0.5" row="47"/>
|
||||
<key interpolation="1" value="0" row="48"/>
|
||||
<key interpolation="0" value="0.5" row="49"/>
|
||||
<key interpolation="1" value="0.5" row="63"/>
|
||||
<key interpolation="1" value="0" row="64"/>
|
||||
<key interpolation="0" value="0.5" row="65"/>
|
||||
<key interpolation="1" value="0.5" row="79"/>
|
||||
<key interpolation="1" value="0" row="80"/>
|
||||
<key interpolation="0" value="0.5" row="81"/>
|
||||
<key interpolation="1" value="0.5" row="95"/>
|
||||
<key interpolation="1" value="0" row="96"/>
|
||||
<key interpolation="0" value="0.5" row="97"/>
|
||||
<key interpolation="1" value="0.5" row="111"/>
|
||||
<key interpolation="1" value="0" row="112"/>
|
||||
<key interpolation="0" value="0.5" row="113"/>
|
||||
<key interpolation="3" value="0.5" row="136"/>
|
||||
<key interpolation="2" value="0.8" row="144"/>
|
||||
<key interpolation="0" value="0.5" row="152"/>
|
||||
<key interpolation="3" value="0.5" row="175"/>
|
||||
<key interpolation="1" value="0" row="176"/>
|
||||
<key interpolation="0" value="0.5" row="177"/>
|
||||
<key interpolation="3" value="0.5" row="191"/>
|
||||
<key interpolation="1" value="0" row="192"/>
|
||||
<key interpolation="0" value="0.5" row="193"/>
|
||||
<key interpolation="1" value="0.5" row="207"/>
|
||||
<key interpolation="1" value="0.6" row="208"/>
|
||||
<key interpolation="0" value="0.5" row="209"/>
|
||||
<key interpolation="2" value="0.5" row="223"/>
|
||||
<key interpolation="2" value="0.8" row="224"/>
|
||||
<key interpolation="0" value="0.5" row="225"/>
|
||||
<key interpolation="3" value="0.5" row="256"/>
|
||||
<key interpolation="0" value="0" row="264"/>
|
||||
</track>
|
||||
<track name="cameraPosition_w"/>
|
||||
<track name="cameraCenter_w"/>
|
||||
<track name="cameraUp_w"/>
|
||||
<track name="cubeLifetime">
|
||||
<key interpolation="0" value="1" row="0"/>
|
||||
<key interpolation="0" value="4" row="144"/>
|
||||
<key interpolation="1" value="1" row="176"/>
|
||||
<key interpolation="0" value="15" row="192"/>
|
||||
<key interpolation="2" value="15" row="198"/>
|
||||
<key interpolation="2" value="1" row="200"/>
|
||||
<key interpolation="0" value="40" row="202"/>
|
||||
<key interpolation="1" value="24" row="224"/>
|
||||
<key interpolation="0" value="8" row="240"/>
|
||||
</track>
|
||||
<track name="transition">
|
||||
<key interpolation="1" value="1" row="0"/>
|
||||
<key interpolation="0" value="0" row="48"/>
|
||||
<key interpolation="3" value="0" row="128"/>
|
||||
<key interpolation="1" value="1" row="144"/>
|
||||
<key interpolation="3" value="0.75" row="152"/>
|
||||
<key interpolation="0" value="0" row="176"/>
|
||||
<key interpolation="3" value="0" row="206"/>
|
||||
<key interpolation="1" value="1" row="208"/>
|
||||
<key interpolation="0" value="0" row="212"/>
|
||||
<key interpolation="2" value="0" row="222"/>
|
||||
<key interpolation="2" value="1" row="224"/>
|
||||
<key interpolation="0" value="0" row="226"/>
|
||||
<key interpolation="3" value="0" row="248"/>
|
||||
<key interpolation="0" value="1" row="264"/>
|
||||
</track>
|
||||
</tracks>
|
||||
<bookmarks/>
|
||||
</sync>
|
||||
BIN
hgplus/revision15-8k/packages/AvalonEdit.5.0.2/AvalonEdit.5.0.2.nupkg
vendored
Normal file
BIN
hgplus/revision15-8k/packages/AvalonEdit.5.0.2/AvalonEdit.5.0.2.nupkg
vendored
Normal file
Binary file not shown.
33
hgplus/revision15-8k/packages/AvalonEdit.5.0.2/AvalonEdit.5.0.2.nuspec
vendored
Normal file
33
hgplus/revision15-8k/packages/AvalonEdit.5.0.2/AvalonEdit.5.0.2.nuspec
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
<?xml version="1.0"?>
|
||||
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>AvalonEdit</id>
|
||||
<version>5.0.2</version>
|
||||
<authors>Daniel Grunwald</authors>
|
||||
<owners>Daniel Grunwald</owners>
|
||||
<licenseUrl>http://opensource.org/licenses/MIT</licenseUrl>
|
||||
<projectUrl>http://www.avalonedit.net/</projectUrl>
|
||||
<iconUrl>http://community.sharpdevelop.net/blogs/mattward/SharpDevelop.png</iconUrl>
|
||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||
<description>AvalonEdit is the WPF-based text editor used in SharpDevelop. There are two builds of AvalonEdit included in this package. One that targets .NET 4.0 and one that targets .NET 3.5.</description>
|
||||
<summary>AvalonEdit is the WPF-based text editor used in SharpDevelop</summary>
|
||||
<releaseNotes>* License changed from LGPL to MIT
|
||||
* New Feature: Hide mouse cursor while typing (enabled by default)
|
||||
* New Feature: Highlight current line (disabled by default)
|
||||
* New Feature: Overstrike mode (disabled by default)
|
||||
* New Feature: 'underline' attribute in syntax highlighting definitions
|
||||
* AvalonEdit now raises the WPF DataObject attached events on clipboard and drag'n'drop operations.
|
||||
* Encoding detection now distinguishes between UTF-8 with BOM and UTF-8 without BOM. This prevents AvalonEdit from adding the BOM to existing UTF-8 files.
|
||||
* Improved handling of grapheme clusters. A base character followed by a combining mark is now treated as a single character by the caret movement logic.
|
||||
* Added RichText, RichTextModel and RichTextColorizer.
|
||||
* Renamed the VB highlighting mode from "VBNET" to "VB"
|
||||
* Changed IHighlighter API in order to support SharpDevelop's semantic C# highlighter
|
||||
* The regex-based highlighting engine was moved into its own class (HighlightingEngine) to be separated from the state-tracking logic in DocumentHighlighter.
|
||||
* Add FileName property to TextDocument class.
|
||||
* DocumentChangeEventArgs.RemovedText/InsertedText are now of type ITextSource instead of string.
|
||||
* The error-tolerant XML parser included with AvalonEdit was removed. An improved version of this parser is part of the NRefactory 5 project.
|
||||
* Removed some obsolete APIs.</releaseNotes>
|
||||
<language>en-US</language>
|
||||
<tags>WPF Text Editor SharpDevelop AvalonEdit</tags>
|
||||
</metadata>
|
||||
</package>
|
||||
BIN
hgplus/revision15-8k/packages/AvalonEdit.5.0.2/lib/Net35/ICSharpCode.AvalonEdit.dll
vendored
Normal file
BIN
hgplus/revision15-8k/packages/AvalonEdit.5.0.2/lib/Net35/ICSharpCode.AvalonEdit.dll
vendored
Normal file
Binary file not shown.
9939
hgplus/revision15-8k/packages/AvalonEdit.5.0.2/lib/Net35/ICSharpCode.AvalonEdit.xml
vendored
Normal file
9939
hgplus/revision15-8k/packages/AvalonEdit.5.0.2/lib/Net35/ICSharpCode.AvalonEdit.xml
vendored
Normal file
File diff suppressed because it is too large
Load Diff
BIN
hgplus/revision15-8k/packages/AvalonEdit.5.0.2/lib/Net40/ICSharpCode.AvalonEdit.dll
vendored
Normal file
BIN
hgplus/revision15-8k/packages/AvalonEdit.5.0.2/lib/Net40/ICSharpCode.AvalonEdit.dll
vendored
Normal file
Binary file not shown.
9939
hgplus/revision15-8k/packages/AvalonEdit.5.0.2/lib/Net40/ICSharpCode.AvalonEdit.xml
vendored
Normal file
9939
hgplus/revision15-8k/packages/AvalonEdit.5.0.2/lib/Net40/ICSharpCode.AvalonEdit.xml
vendored
Normal file
File diff suppressed because it is too large
Load Diff
4
hgplus/revision15-8k/packages/repositories.config
Normal file
4
hgplus/revision15-8k/packages/repositories.config
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<repositories>
|
||||
<repository path="..\src\tool\packages.config" />
|
||||
</repositories>
|
||||
58
hgplus/revision15-8k/readme.txt
Normal file
58
hgplus/revision15-8k/readme.txt
Normal file
@@ -0,0 +1,58 @@
|
||||
Alcatraz 8kode
|
||||
=========
|
||||
|
||||
A framework for developing 8k intros.
|
||||
|
||||
Initial setup:
|
||||
1) Start Visual Studio 2013 and open 8kode.sln
|
||||
2) Right click your solution and choose "Set StartUp Projects..."
|
||||
3) Under Common Properties -> Startup Project, choose "Multiple startup projects"
|
||||
4) Set both "intro" and "tool" to Start.
|
||||
5) Click "OK"
|
||||
6) Set your build configuration to "Authoring"
|
||||
7) Hit F5 and enjoy.
|
||||
|
||||
Interface:
|
||||
8kode's interface is very similar to Blender 2.5.
|
||||
If you're unfamiliar with it, please have a look at http://vimeo.com/19628478 starting from 1:59
|
||||
You can set up multiple views of the same data, and you can split, resize and merge views as you need.
|
||||
Layouts can be saved and loaded using the Layouts menu.
|
||||
|
||||
Intro navigation:
|
||||
You can move through time by clicking and dragging in the Audio view.
|
||||
The seek positions snap to intro "scenes".
|
||||
A scene is defined by SOUND_TICKS_PER_SCENE * SAMPLES_PER_TICK samples.
|
||||
The preconfigured SOUND_TICKS_PER_SCENE is 64 ticks and SAMPLES_PER_TICK is provided by 4klang.h
|
||||
|
||||
File and folder structure:
|
||||
The intro coder musn't take care of the src\intro\framework folder.
|
||||
Shaders are inside src\intro\shaders, intro code is inside src\intro\intro.
|
||||
Put your intro init code in src\intro\intro\init.h and your per-frame code in src\intro\intro\update.h.
|
||||
Variables and such can be put in src\intro\intro\data.h
|
||||
|
||||
Shader compiler tool (shc):
|
||||
8kode comes with a shader preprocessor. It has 2 main purposes:
|
||||
1) Resolve all #includes, so that Ctrl+Alt+Test's shader minifier can minify everything together
|
||||
2) Automatically generate C++ code with ready-to-use DirectX shader pointers
|
||||
In order to have autogenerated shader pointers, you can use an [EntryPoint(foo)] attribute on your HLSL function.
|
||||
This will signal shc that this function is an entry point, and it will create a corresponding IID3D11FooShader* pointer.
|
||||
Obviously you should replace foo with the correct shader profile name (e.g. vs, ps, cs).
|
||||
Example:
|
||||
|
||||
[numthreads(16, 16, 1)]
|
||||
[entrypoint(cs)]
|
||||
void colorPattern(uint3 id:SV_DispatchThreadID)
|
||||
{
|
||||
float2 resolution;
|
||||
out0.GetDimensions(resolution.x, resolution.y);
|
||||
out0[id.xy] = float4(id.xy / resolution, 0.5, 1.0);
|
||||
}
|
||||
|
||||
When compiling with shc, it will generate corresponding code and provide a ID3D11ComputeShader* cs_colorPattern pointer.
|
||||
The coder can use that pointer immediately in the intro code.
|
||||
8kode's authoring tool allows instant shader compilation with the shortcut Ctrl+Enter. It invokes shc, which in turn:
|
||||
1) generates intro\framework\shaders_shc.h, containing all entry point shader pointers and compile code for the intro
|
||||
2) runs Ctrl+Alt+Test's shader minifier and outputs the minified shader to intro\framework\intro_hlsl.h
|
||||
3) recompiles every entry point that was present at the last intro compile time. If entry points changed, a tool restart is required.
|
||||
All shader compilation errors are marked in the code view as line decorations. Hovering over marked lines will display a tooltip
|
||||
with the errors in that line.
|
||||
2
hgplus/revision15-8k/release/readme.txt
Normal file
2
hgplus/revision15-8k/release/readme.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
License: CC BY-NC-SA 3.0
|
||||
Inspired by Cube Town by Jollard: http://jollard.deviantart.com/art/Cube-Town-1680x1050-159761642
|
||||
13
hgplus/revision15-8k/src/intro/crinkler.html
Normal file
13
hgplus/revision15-8k/src/intro/crinkler.html
Normal file
File diff suppressed because one or more lines are too long
1629
hgplus/revision15-8k/src/intro/framework/4klang.asm
Normal file
1629
hgplus/revision15-8k/src/intro/framework/4klang.asm
Normal file
File diff suppressed because it is too large
Load Diff
22
hgplus/revision15-8k/src/intro/framework/4klang.h
Normal file
22
hgplus/revision15-8k/src/intro/framework/4klang.h
Normal file
@@ -0,0 +1,22 @@
|
||||
// some useful song defines for 4klang
|
||||
#define SAMPLE_RATE 44100
|
||||
#define BPM 174.170609
|
||||
#define MAX_INSTRUMENTS 10
|
||||
#define MAX_PATTERNS 132
|
||||
#define PATTERN_SIZE_SHIFT 4
|
||||
#define PATTERN_SIZE (1 << PATTERN_SIZE_SHIFT)
|
||||
#define MAX_TICKS (MAX_PATTERNS*PATTERN_SIZE)
|
||||
#define SAMPLES_PER_TICK 3798
|
||||
#define MAX_SAMPLES (SAMPLES_PER_TICK*MAX_TICKS)
|
||||
#define POLYPHONY 1
|
||||
#define FLOAT_32BIT
|
||||
#define SAMPLE_TYPE float
|
||||
|
||||
#define WINDOWS_OBJECT
|
||||
|
||||
// declaration of the external synth render function, you'll always need that
|
||||
extern "C" void __stdcall _4klang_render(void*);
|
||||
// declaration of the external envelope buffer. access only if you're song was exported with that option
|
||||
extern "C" float _4klang_envelope_buffer;
|
||||
// declaration of the external note buffer. access only if you're song was exported with that option
|
||||
extern "C" int _4klang_note_buffer;
|
||||
941
hgplus/revision15-8k/src/intro/framework/4klang.inc
Normal file
941
hgplus/revision15-8k/src/intro/framework/4klang.inc
Normal file
@@ -0,0 +1,941 @@
|
||||
%macro export_func 1
|
||||
global _%1
|
||||
_%1:
|
||||
%endmacro
|
||||
%define USE_SECTIONS
|
||||
%define SAMPLE_RATE 44100
|
||||
%define MAX_INSTRUMENTS 10
|
||||
%define MAX_VOICES 1
|
||||
%define HLD 1
|
||||
%define BPM 174.170609
|
||||
%define MAX_PATTERNS 132
|
||||
%define PATTERN_SIZE_SHIFT 4
|
||||
%define PATTERN_SIZE (1 << PATTERN_SIZE_SHIFT)
|
||||
%define MAX_TICKS (MAX_PATTERNS*PATTERN_SIZE)
|
||||
%define SAMPLES_PER_TICK 3798
|
||||
%define DEF_LFO_NORMALIZE 0.0000658241
|
||||
%define MAX_SAMPLES (SAMPLES_PER_TICK*MAX_TICKS)
|
||||
;%define GO4K_USE_16BIT_OUTPUT
|
||||
;%define GO4K_USE_GROOVE_PATTERN
|
||||
;%define GO4K_USE_ENVELOPE_RECORDINGS
|
||||
;%define GO4K_USE_NOTE_RECORDINGS
|
||||
%define GO4K_CLIP_OUTPUT
|
||||
%define GO4K_USE_DST
|
||||
%define GO4K_USE_DLL
|
||||
%define GO4K_USE_PAN
|
||||
%define GO4K_USE_GLOBAL_DLL
|
||||
%define GO4K_USE_FSTG
|
||||
%define GO4K_USE_ENV_CHECK
|
||||
%define GO4K_USE_ENV_MOD_GM
|
||||
%define GO4K_USE_VCO_CHECK
|
||||
%define GO4K_USE_VCO_PHASE_OFFSET
|
||||
%define GO4K_USE_VCO_SHAPE
|
||||
%define GO4K_USE_VCO_GATE
|
||||
%define GO4K_USE_VCO_MOD_FM
|
||||
%define GO4K_USE_VCO_MOD_TM
|
||||
%define GO4K_USE_VCO_MOD_GM
|
||||
%define GO4K_USE_VCO_MOD_SM
|
||||
%define GO4K_USE_VCF_CHECK
|
||||
%define GO4K_USE_VCF_MOD_FM
|
||||
%define GO4K_USE_VCF_HIGH
|
||||
%define GO4K_USE_VCF_BAND
|
||||
%define GO4K_USE_VCF_PEAK
|
||||
%define GO4K_USE_DST_CHECK
|
||||
%define GO4K_USE_DST_SH
|
||||
%define GO4K_USE_DLL_CHORUS_CLAMP
|
||||
%define GO4K_USE_DLL_DAMP
|
||||
%define GO4K_USE_DLL_DC_FILTER
|
||||
%define GO4K_USE_FSTG_CHECK
|
||||
%define GO4K_USE_OUT_MOD_GM
|
||||
%define GO4K_USE_WAVESHAPER_CLIP
|
||||
%define MAX_DELAY 65536
|
||||
%define MAX_UNITS 48
|
||||
%define MAX_UNIT_SLOTS 9
|
||||
%define GO4K_BEGIN_CMDDEF(def_name)
|
||||
%define GO4K_END_CMDDEF db 0
|
||||
%define GO4K_BEGIN_PARAMDEF(def_name)
|
||||
%define GO4K_END_PARAMDEF
|
||||
GO4K_ENV_ID equ 1
|
||||
%macro GO4K_ENV 5
|
||||
db %1
|
||||
db %2
|
||||
db %3
|
||||
db %4
|
||||
db %5
|
||||
%endmacro
|
||||
%define ATTAC(val) val
|
||||
%define DECAY(val) val
|
||||
%define SUSTAIN(val) val
|
||||
%define RELEASE(val) val
|
||||
%define GAIN(val) val
|
||||
struc go4kENV_val
|
||||
.attac resd 1
|
||||
.decay resd 1
|
||||
.sustain resd 1
|
||||
.release resd 1
|
||||
.gain resd 1
|
||||
.size
|
||||
endstruc
|
||||
struc go4kENV_wrk
|
||||
.state resd 1
|
||||
.level resd 1
|
||||
.gm resd 1
|
||||
.am resd 1
|
||||
.dm resd 1
|
||||
.sm resd 1
|
||||
.rm resd 1
|
||||
.size
|
||||
endstruc
|
||||
%define ENV_STATE_ATTAC 0
|
||||
%define ENV_STATE_DECAY 1
|
||||
%define ENV_STATE_SUSTAIN 2
|
||||
%define ENV_STATE_RELEASE 3
|
||||
%define ENV_STATE_OFF 4
|
||||
GO4K_VCO_ID equ 2
|
||||
%macro GO4K_VCO 8
|
||||
db %1
|
||||
db %2
|
||||
%ifdef GO4K_USE_VCO_PHASE_OFFSET
|
||||
db %3
|
||||
%endif
|
||||
%ifdef GO4K_USE_VCO_GATE
|
||||
db %4
|
||||
%endif
|
||||
db %5
|
||||
%ifdef GO4K_USE_VCO_SHAPE
|
||||
db %6
|
||||
%endif
|
||||
db %7
|
||||
db %8
|
||||
%endmacro
|
||||
%define TRANSPOSE(val) val
|
||||
%define DETUNE(val) val
|
||||
%define PHASE(val) val
|
||||
%define GATES(val) val
|
||||
%define COLOR(val) val
|
||||
%define SHAPE(val) val
|
||||
%define FLAGS(val) val
|
||||
%define SINE 0x01
|
||||
%define TRISAW 0x02
|
||||
%define PULSE 0x04
|
||||
%define NOISE 0x08
|
||||
%define LFO 0x10
|
||||
%define GATE 0x20
|
||||
%define VCO_STEREO 0x40
|
||||
struc go4kVCO_val
|
||||
.transpose resd 1
|
||||
.detune resd 1
|
||||
%ifdef GO4K_USE_VCO_PHASE_OFFSET
|
||||
.phaseofs resd 1
|
||||
%endif
|
||||
%ifdef GO4K_USE_VCO_GATE
|
||||
.gate resd 1
|
||||
%endif
|
||||
.color resd 1
|
||||
%ifdef GO4K_USE_VCO_SHAPE
|
||||
.shape resd 1
|
||||
%endif
|
||||
.gain resd 1
|
||||
.flags resd 1
|
||||
.size
|
||||
endstruc
|
||||
struc go4kVCO_wrk
|
||||
.phase resd 1
|
||||
.tm resd 1
|
||||
.dm resd 1
|
||||
.fm resd 1
|
||||
.pm resd 1
|
||||
.cm resd 1
|
||||
.sm resd 1
|
||||
.gm resd 1
|
||||
.phase2 resd 1
|
||||
.size
|
||||
endstruc
|
||||
GO4K_VCF_ID equ 3
|
||||
%macro GO4K_VCF 3
|
||||
db %1
|
||||
db %2
|
||||
db %3
|
||||
%endmacro
|
||||
%define LOWPASS 0x1
|
||||
%define HIGHPASS 0x2
|
||||
%define BANDPASS 0x4
|
||||
%define BANDSTOP 0x3
|
||||
%define ALLPASS 0x7
|
||||
%define PEAK 0x8
|
||||
%define STEREO 0x10
|
||||
%define FREQUENCY(val) val
|
||||
%define RESONANCE(val) val
|
||||
%define VCFTYPE(val) val
|
||||
struc go4kVCF_val
|
||||
.freq resd 1
|
||||
.res resd 1
|
||||
.type resd 1
|
||||
.size
|
||||
endstruc
|
||||
struc go4kVCF_wrk
|
||||
.low resd 1
|
||||
.high resd 1
|
||||
.band resd 1
|
||||
.freq resd 1
|
||||
.fm resd 1
|
||||
.rm resd 1
|
||||
.low2 resd 1
|
||||
.high2 resd 1
|
||||
.band2 resd 1
|
||||
.size
|
||||
endstruc
|
||||
GO4K_DST_ID equ 4
|
||||
%macro GO4K_DST 3
|
||||
db %1
|
||||
%ifdef GO4K_USE_DST_SH
|
||||
db %2
|
||||
%ifdef GO4K_USE_DST_STEREO
|
||||
db %3
|
||||
%endif
|
||||
%else
|
||||
%ifdef GO4K_USE_DST_STEREO
|
||||
db %3
|
||||
%endif
|
||||
%endif
|
||||
%endmacro
|
||||
%define DRIVE(val) val
|
||||
%define SNHFREQ(val) val
|
||||
%define FLAGS(val) val
|
||||
struc go4kDST_val
|
||||
.drive resd 1
|
||||
%ifdef GO4K_USE_DST_SH
|
||||
.snhfreq resd 1
|
||||
%endif
|
||||
.flags resd 1
|
||||
.size
|
||||
endstruc
|
||||
struc go4kDST_wrk
|
||||
.out resd 1
|
||||
.snhphase resd 1
|
||||
.dm resd 1
|
||||
.sm resd 1
|
||||
.out2 resd 1
|
||||
.size
|
||||
endstruc
|
||||
GO4K_DLL_ID equ 5
|
||||
%macro GO4K_DLL 8
|
||||
db %1
|
||||
db %2
|
||||
db %3
|
||||
%ifdef GO4K_USE_DLL_DAMP
|
||||
db %4
|
||||
%endif
|
||||
%ifdef GO4K_USE_DLL_CHORUS
|
||||
db %5
|
||||
db %6
|
||||
%endif
|
||||
db %7
|
||||
db %8
|
||||
%endmacro
|
||||
%define PREGAIN(val) val
|
||||
%define DRY(val) val
|
||||
%define FEEDBACK(val) val
|
||||
%define DEPTH(val) val
|
||||
%define DAMP(val) val
|
||||
%define DELAY(val) val
|
||||
%define COUNT(val) val
|
||||
struc go4kDLL_val
|
||||
.pregain resd 1
|
||||
.dry resd 1
|
||||
.feedback resd 1
|
||||
%ifdef GO4K_USE_DLL_DAMP
|
||||
.damp resd 1
|
||||
%endif
|
||||
%ifdef GO4K_USE_DLL_CHORUS
|
||||
.freq resd 1
|
||||
.depth
|
||||
%endif
|
||||
.delay resd 1
|
||||
.count resd 1
|
||||
.size
|
||||
endstruc
|
||||
struc go4kDLL_wrk
|
||||
.index resd 1
|
||||
.store resd 1
|
||||
.dcin resd 1
|
||||
.dcout resd 1
|
||||
%ifdef GO4K_USE_DLL_CHORUS
|
||||
.phase resd 1
|
||||
%endif
|
||||
.buffer resd MAX_DELAY
|
||||
.size
|
||||
endstruc
|
||||
struc go4kDLL_wrk2
|
||||
.pm resd 1
|
||||
.fm resd 1
|
||||
.im resd 1
|
||||
.dm resd 1
|
||||
.sm resd 1
|
||||
.am resd 1
|
||||
.size
|
||||
endstruc
|
||||
GO4K_FOP_ID equ 6
|
||||
%macro GO4K_FOP 1
|
||||
db %1
|
||||
%endmacro
|
||||
%define OP(val) val
|
||||
%define FOP_POP 0x1
|
||||
%define FOP_ADDP 0x2
|
||||
%define FOP_MULP 0x3
|
||||
%define FOP_PUSH 0x4
|
||||
%define FOP_XCH 0x5
|
||||
%define FOP_ADD 0x6
|
||||
%define FOP_MUL 0x7
|
||||
%define FOP_ADDP2 0x8
|
||||
%define FOP_LOADNOTE 0x9
|
||||
%define FOP_MULP2 0xa
|
||||
struc go4kFOP_val
|
||||
.flags resd 1
|
||||
.size
|
||||
endstruc
|
||||
struc go4kFOP_wrk
|
||||
.size
|
||||
endstruc
|
||||
GO4K_FST_ID equ 7
|
||||
%macro GO4K_FST 2
|
||||
db %1
|
||||
dw %2
|
||||
%endmacro
|
||||
%define AMOUNT(val) val
|
||||
%define DEST(val) val
|
||||
%define FST_SET 0x0000
|
||||
%define FST_ADD 0x4000
|
||||
%define FST_POP 0x8000
|
||||
struc go4kFST_val
|
||||
.amount resd 1
|
||||
.op1 resd 1
|
||||
.size
|
||||
endstruc
|
||||
struc go4kFST_wrk
|
||||
.size
|
||||
endstruc
|
||||
GO4K_PAN_ID equ 8
|
||||
%macro GO4K_PAN 1
|
||||
%ifdef GO4K_USE_PAN
|
||||
db %1
|
||||
%endif
|
||||
%endmacro
|
||||
%define PANNING(val) val
|
||||
struc go4kPAN_val
|
||||
%ifdef GO4K_USE_PAN
|
||||
.panning resd 1
|
||||
%endif
|
||||
.size
|
||||
endstruc
|
||||
struc go4kPAN_wrk
|
||||
.pm resd 1
|
||||
.size
|
||||
endstruc
|
||||
GO4K_OUT_ID equ 9
|
||||
%macro GO4K_OUT 2
|
||||
db %1
|
||||
%ifdef GO4K_USE_GLOBAL_DLL
|
||||
db %2
|
||||
%endif
|
||||
%endmacro
|
||||
%define AUXSEND(val) val
|
||||
struc go4kOUT_val
|
||||
.gain resd 1
|
||||
%ifdef GO4K_USE_GLOBAL_DLL
|
||||
.auxsend resd 1
|
||||
%endif
|
||||
.size
|
||||
endstruc
|
||||
struc go4kOUT_wrk
|
||||
.am resd 1
|
||||
.gm resd 1
|
||||
.size
|
||||
endstruc
|
||||
GO4K_ACC_ID equ 10
|
||||
%macro GO4K_ACC 1
|
||||
db %1
|
||||
%endmacro
|
||||
%define OUTPUT 0
|
||||
%define AUX 8
|
||||
%define ACCTYPE(val) val
|
||||
struc go4kACC_val
|
||||
.acctype resd 1
|
||||
.size
|
||||
endstruc
|
||||
struc go4kACC_wrk
|
||||
.size
|
||||
endstruc
|
||||
%ifdef GO4K_USE_FLD
|
||||
GO4K_FLD_ID equ 11
|
||||
%macro GO4K_FLD 1
|
||||
db %1
|
||||
%endmacro
|
||||
%define VALUE(val) val
|
||||
struc go4kFLD_val
|
||||
.value resd 1
|
||||
.size
|
||||
endstruc
|
||||
struc go4kFLD_wrk
|
||||
.vm resd 1
|
||||
.size
|
||||
endstruc
|
||||
%endif
|
||||
%ifdef GO4K_USE_FSTG
|
||||
GO4K_FSTG_ID equ 12
|
||||
%macro GO4K_FSTG 2
|
||||
db %1
|
||||
dw %2
|
||||
%endmacro
|
||||
struc go4kFSTG_val
|
||||
.amount resd 1
|
||||
.op1 resd 1
|
||||
.size
|
||||
endstruc
|
||||
struc go4kFSTG_wrk
|
||||
.size
|
||||
endstruc
|
||||
%endif
|
||||
struc go4k_instrument
|
||||
.release resd 1
|
||||
.note resd 1
|
||||
.workspace resd MAX_UNITS*MAX_UNIT_SLOTS
|
||||
.dlloutl resd 1
|
||||
.dlloutr resd 1
|
||||
.outl resd 1
|
||||
.outr resd 1
|
||||
.size
|
||||
endstruc
|
||||
struc go4k_synth
|
||||
.instruments resb go4k_instrument.size * MAX_INSTRUMENTS * MAX_VOICES
|
||||
.global resb go4k_instrument.size * MAX_VOICES
|
||||
.size
|
||||
endstruc
|
||||
%ifdef USE_SECTIONS
|
||||
section .g4kmuc1 data align=1
|
||||
%else
|
||||
section .data align=1
|
||||
%endif
|
||||
go4k_patterns
|
||||
db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
db 0, 0, 0, 0, 0, 0, 84, HLD, HLD, HLD, HLD, HLD, 76, HLD, HLD, HLD,
|
||||
db 77, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, 64, HLD, 69, HLD,
|
||||
db 81, HLD, 93, HLD, HLD, HLD, 84, HLD, HLD, HLD, HLD, HLD, 76, HLD, HLD, HLD,
|
||||
db HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, 64, HLD, 69, HLD,
|
||||
db 77, HLD, 76, HLD, 77, HLD, 74, HLD, HLD, HLD, 77, HLD, 81, HLD, HLD, HLD,
|
||||
db 74, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, 88, HLD, 89, HLD, HLD, HLD,
|
||||
db 86, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
|
||||
db 79, HLD, 78, HLD, 79, HLD, 76, HLD, HLD, HLD, 79, HLD, 83, HLD, HLD, HLD,
|
||||
db 76, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, 90, HLD, 91, HLD, HLD, HLD,
|
||||
db 88, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
|
||||
db 84, HLD, 83, HLD, 84, HLD, 81, HLD, HLD, HLD, 84, HLD, 88, HLD, HLD, HLD,
|
||||
db 81, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, 95, HLD, 96, HLD, HLD, HLD,
|
||||
db 93, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
|
||||
db 81, HLD, 79, HLD, 81, HLD, 78, HLD, HLD, HLD, 81, HLD, 84, HLD, HLD, HLD,
|
||||
db 78, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, 91, HLD, 93, HLD, HLD, HLD,
|
||||
db 90, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
|
||||
db 76, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, 90, HLD, 91, HLD, 69, HLD,
|
||||
db 88, HLD, 86, HLD, 88, HLD, 84, HLD, HLD, HLD, 88, HLD, 91, HLD, HLD, HLD,
|
||||
db 84, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, 98, HLD, 100, HLD, HLD, HLD,
|
||||
db 96, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
|
||||
db 83, HLD, 81, HLD, 83, HLD, 79, HLD, HLD, HLD, 83, HLD, 86, HLD, HLD, HLD,
|
||||
db 79, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, 93, HLD, 95, HLD, HLD, HLD,
|
||||
db 91, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
|
||||
db 76, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
|
||||
db HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
|
||||
db 57, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
|
||||
db 62, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
|
||||
db 64, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
|
||||
db 59, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
|
||||
db 60, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
|
||||
db 48, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
|
||||
db 67, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
|
||||
db 55, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
|
||||
db 66, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
|
||||
db 69, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
|
||||
db 71, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
|
||||
db 83, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
|
||||
db 75, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
|
||||
db 72, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
|
||||
db 84, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
|
||||
db 87, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
|
||||
db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72, HLD, HLD, HLD,
|
||||
db 0, 0, 0, 0, 0, 0, 0, 0, 60, HLD, 60, HLD, HLD, HLD, 60, HLD,
|
||||
db HLD, HLD, HLD, HLD, HLD, HLD, 60, HLD, 60, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
|
||||
db HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, 60, HLD, 60, HLD, HLD, HLD, 60, HLD,
|
||||
db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 60, HLD, HLD, HLD,
|
||||
db 60, HLD, HLD, HLD, HLD, HLD, 60, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
|
||||
db 60, HLD, HLD, HLD, HLD, HLD, 60, HLD, HLD, HLD, HLD, HLD, 60, HLD, HLD, HLD,
|
||||
db HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, 60, HLD, HLD, HLD,
|
||||
db 50, HLD, HLD, HLD, 38, HLD, HLD, HLD, 38, HLD, HLD, HLD, 50, HLD, HLD, HLD,
|
||||
db 38, HLD, HLD, HLD, 38, HLD, HLD, HLD, 50, HLD, 62, HLD, 50, HLD, HLD, HLD,
|
||||
db 38, HLD, HLD, HLD, 50, HLD, HLD, HLD, 50, HLD, HLD, HLD, 38, HLD, HLD, HLD,
|
||||
db 38, HLD, HLD, HLD, 50, HLD, HLD, HLD, 62, HLD, 50, HLD, 38, HLD, HLD, HLD,
|
||||
db 52, HLD, HLD, HLD, 40, HLD, HLD, HLD, 40, HLD, HLD, HLD, 52, HLD, HLD, HLD,
|
||||
db 40, HLD, HLD, HLD, 40, HLD, HLD, HLD, 52, HLD, 64, HLD, 52, HLD, HLD, HLD,
|
||||
db 40, HLD, HLD, HLD, 52, HLD, HLD, HLD, 52, HLD, HLD, HLD, 40, HLD, HLD, HLD,
|
||||
db 40, HLD, HLD, HLD, 52, HLD, HLD, HLD, 64, HLD, 52, HLD, 40, HLD, HLD, HLD,
|
||||
db 57, HLD, HLD, HLD, 45, HLD, HLD, HLD, 45, HLD, HLD, HLD, 57, HLD, HLD, HLD,
|
||||
db 45, HLD, HLD, HLD, 45, HLD, HLD, HLD, 57, HLD, 69, HLD, 57, HLD, HLD, HLD,
|
||||
db 45, HLD, HLD, HLD, 57, HLD, HLD, HLD, 57, HLD, HLD, HLD, 45, HLD, HLD, HLD,
|
||||
db 45, HLD, HLD, HLD, 57, HLD, HLD, HLD, 69, HLD, 57, HLD, 45, HLD, HLD, HLD,
|
||||
db 59, HLD, HLD, HLD, 47, HLD, HLD, HLD, 47, HLD, HLD, HLD, 59, HLD, HLD, HLD,
|
||||
db 47, HLD, HLD, HLD, 47, HLD, HLD, HLD, 59, HLD, 71, HLD, 59, HLD, HLD, HLD,
|
||||
db 47, HLD, HLD, HLD, 59, HLD, HLD, HLD, 59, HLD, HLD, HLD, 47, HLD, HLD, HLD,
|
||||
db 47, HLD, HLD, HLD, 59, HLD, HLD, HLD, 71, HLD, 59, HLD, 47, HLD, HLD, HLD,
|
||||
db 40, HLD, HLD, HLD, 40, HLD, HLD, HLD, 52, HLD, 40, HLD, 52, HLD, HLD, HLD,
|
||||
db 40, HLD, HLD, HLD, 52, HLD, HLD, HLD, 40, HLD, 52, HLD, 40, HLD, HLD, HLD,
|
||||
db 48, HLD, HLD, HLD, 36, HLD, HLD, HLD, 36, HLD, HLD, HLD, 48, HLD, HLD, HLD,
|
||||
db 36, HLD, HLD, HLD, 36, HLD, HLD, HLD, 48, HLD, 60, HLD, 48, HLD, HLD, HLD,
|
||||
db 48, HLD, HLD, HLD, 60, HLD, HLD, HLD, 60, HLD, HLD, HLD, 48, HLD, HLD, HLD,
|
||||
db 48, HLD, HLD, HLD, 60, HLD, HLD, HLD, 72, HLD, 60, HLD, 48, HLD, HLD, HLD,
|
||||
db 55, HLD, HLD, HLD, 43, HLD, HLD, HLD, 43, HLD, HLD, HLD, 55, HLD, HLD, HLD,
|
||||
db 43, HLD, HLD, HLD, 43, HLD, HLD, HLD, 55, HLD, 67, HLD, 55, HLD, HLD, HLD,
|
||||
db 43, HLD, HLD, HLD, 55, HLD, HLD, HLD, 55, HLD, HLD, HLD, 43, HLD, HLD, HLD,
|
||||
db 43, HLD, HLD, HLD, 55, HLD, HLD, HLD, 67, HLD, 55, HLD, 43, HLD, HLD, HLD,
|
||||
db 40, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
|
||||
db 81, 0, 83, 0, 84, 0, 86, 0, 2, HLD, 88, HLD, HLD, HLD, HLD, HLD,
|
||||
db 0, 0, 0, 0, 0, 0, 0, 0, 84, HLD, HLD, HLD, 2, HLD, HLD, HLD,
|
||||
db 83, HLD, HLD, HLD, 0, 0, 0, 0, 0, 0, 0, 0, 79, 0, 81, 0,
|
||||
db 76, HLD, HLD, HLD, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
db 79, 0, 81, HLD, HLD, HLD, 83, HLD, 0, 0, 79, HLD, 0, 0, 0, 0,
|
||||
db 78, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
|
||||
db 0, 0, 0, 0, 79, 0, 81, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
|
||||
db 0, 0, 0, 0, 0, 0, 0, 0, 81, 0, 83, 0, 84, 0, 81, 0,
|
||||
db 83, HLD, HLD, HLD, HLD, HLD, HLD, HLD, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
db 81, HLD, HLD, HLD, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
db 52, HLD, HLD, HLD, HLD, HLD, HLD, HLD, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
db 52, HLD, HLD, HLD, HLD, HLD, HLD, HLD, 91, 0, 90, 0, 88, 0, 86, 0,
|
||||
db 88, HLD, HLD, HLD, HLD, HLD, HLD, HLD, 0, 0, 0, 0, 0, 0, 90, 0,
|
||||
db 88, 0, 90, HLD, 0, 0, 91, HLD, 0, 0, 88, HLD, 0, 0, 0, 0,
|
||||
db 86, HLD, HLD, HLD, HLD, HLD, HLD, HLD, 0, 0, 0, 0, 0, 0, 81, 0,
|
||||
db 79, 0, 81, HLD, 0, 0, 83, HLD, 0, 0, 91, HLD, 0, 0, 0, 0,
|
||||
db 90, HLD, HLD, HLD, HLD, HLD, HLD, HLD, 0, 0, 0, 0, 0, 0, 91, 0,
|
||||
db 0, 0, 0, 0, 0, 0, 0, 0, 90, HLD, HLD, HLD, 0, 0, 0, 0,
|
||||
db 91, HLD, HLD, HLD, HLD, HLD, HLD, HLD, 0, 0, 0, 0, 0, 0, 90, 0,
|
||||
db 0, 0, 0, 0, 0, 0, 0, 0, 91, 0, 90, 0, 88, 0, 86, 0,
|
||||
db 90, HLD, HLD, HLD, HLD, HLD, HLD, HLD, 0, 0, 0, 0, 0, 0, 88, 0,
|
||||
db 0, 0, 0, 0, 0, 0, 0, 0, 83, HLD, HLD, HLD, 0, 0, 0, 0,
|
||||
go4k_patterns_end
|
||||
%ifdef USE_SECTIONS
|
||||
section .g4kmuc2 data align=1
|
||||
%else
|
||||
section .data
|
||||
%endif
|
||||
go4k_pattern_lists
|
||||
Instrument0List db 1, 2, 3, 4, 3, 2, 3, 4, 3, 2, 3, 4, 3, 2, 3, 4, 3, 2, 3, 4, 3, 2, 3, 4, 5, 6, 5, 7, 8, 9, 8, 10, 5, 6, 5, 7, 8, 9, 8, 10, 11, 12, 11, 13, 8, 9, 8, 10, 14, 15, 14, 16, 8, 9, 8, 10, 11, 12, 11, 13, 8, 9, 8, 10, 14, 15, 14, 16, 8, 9, 8, 10, 8, 17, 8, 10, 8, 17, 8, 10, 8, 17, 8, 10, 8, 17, 8, 10, 18, 19, 18, 20, 21, 22, 21, 23, 14, 15, 14, 16, 8, 9, 8, 10, 18, 19, 18, 20, 21, 22, 21, 23, 14, 15, 14, 16, 8, 9, 8, 10, 8, 9, 8, 10, 8, 9, 8, 10, 8, 24, 24, 25,
|
||||
Instrument1List db 26, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 27, 25, 25, 25, 28, 25, 25, 25, 27, 25, 25, 25, 28, 25, 25, 25, 26, 25, 25, 25, 28, 25, 25, 25, 29, 25, 25, 25, 28, 25, 25, 25, 26, 25, 25, 25, 28, 25, 25, 25, 29, 25, 25, 25, 28, 25, 25, 25, 28, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 30, 25, 31, 30, 32, 25, 32, 33, 29, 25, 34, 29, 28, 25, 32, 33, 30, 25, 31, 30, 32, 25, 32, 33, 29, 25, 34, 29, 28, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 0, 0,
|
||||
Instrument2List db 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 35, 25, 25, 25, 36, 25, 25, 25, 35, 25, 25, 25, 36, 25, 25, 25, 24, 25, 25, 25, 37, 25, 25, 25, 38, 25, 25, 25, 37, 25, 25, 25, 24, 25, 25, 25, 37, 25, 25, 25, 38, 25, 25, 25, 37, 25, 25, 25, 36, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 39, 40, 25, 25, 37, 25, 25, 25, 38, 25, 25, 25, 37, 25, 25, 25, 39, 40, 25, 25, 37, 25, 25, 25, 38, 41, 25, 25, 37, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 0, 0,
|
||||
Instrument3List db 0, 0, 0, 0, 0, 0, 39, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
Instrument4List db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 43, 44, 45, 44, 45, 44, 45, 44, 45, 44, 45, 44, 45, 44, 45, 44, 45, 44, 45, 44, 45, 44, 45, 44, 45, 44, 45, 44, 45, 44, 45, 44, 45, 44, 45, 44, 45, 44, 45, 44, 45, 44, 45, 44, 45, 44, 45, 44, 45, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 44, 45, 44, 45, 44, 45, 44, 45, 44, 45, 44, 45, 44, 45, 44, 45, 44, 45, 44, 45, 44, 45, 44, 45, 44, 45, 44, 45, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 0, 0,
|
||||
Instrument5List db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 46, 30, 47, 30, 48, 30, 47, 30, 48, 30, 47, 30, 48, 30, 47, 30, 48, 30, 47, 30, 48, 30, 47, 30, 48, 30, 47, 30, 48, 30, 47, 30, 48, 30, 47, 30, 48, 30, 47, 30, 48, 30, 47, 30, 48, 30, 47, 30, 48, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 49, 30, 47, 30, 48, 30, 47, 30, 48, 30, 47, 30, 48, 30, 47, 30, 48, 30, 47, 30, 48, 30, 47, 30, 48, 30, 47, 30, 48, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 0, 0,
|
||||
Instrument6List db 30, 25, 25, 25, 25, 25, 0, 46, 25, 25, 25, 25, 25, 25, 0, 46, 25, 25, 25, 25, 25, 25, 0, 46, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 30, 25, 25, 25, 25, 25, 0, 0, 30, 25, 25, 25, 25, 25, 0, 46, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 0, 0, 0, 0,
|
||||
Instrument7List db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 51, 52, 53, 54, 55, 56, 57, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 54, 55, 56, 57, 62, 63, 64, 65, 54, 55, 56, 57, 58, 59, 60, 61, 54, 55, 56, 57, 62, 63, 64, 65, 54, 55, 56, 57, 54, 66, 56, 67, 54, 66, 56, 67, 54, 66, 56, 67, 54, 66, 56, 67, 68, 69, 70, 71, 72, 73, 74, 75, 62, 63, 64, 65, 54, 55, 74, 75, 68, 69, 70, 71, 72, 73, 74, 75, 62, 63, 64, 65, 54, 55, 56, 57, 54, 55, 56, 57, 54, 55, 56, 57, 54, 55, 76, 25,
|
||||
Instrument8List db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, 25, 25, 25, 25, 25, 25, 25, 31, 25, 25, 25, 25, 25, 25, 25, 31, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 31, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
Instrument9List db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 0, 78, 79, 80, 0, 81, 82, 83, 0, 84, 85, 80, 0, 81, 86, 77, 0, 78, 79, 80, 0, 81, 82, 83, 0, 84, 85, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 87, 87, 87, 87, 87, 87, 87, 88, 89, 23, 0, 90, 91, 37, 0, 92, 93, 13, 0, 94, 95, 10, 0, 96, 89, 23, 0, 90, 91, 37, 0, 92, 97, 41, 0, 98, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
go4k_pattern_lists_end
|
||||
%ifdef USE_SECTIONS
|
||||
section .g4kmuc3 data align=1
|
||||
%else
|
||||
section .data
|
||||
%endif
|
||||
go4k_synth_instructions
|
||||
GO4K_BEGIN_CMDDEF(Instrument0)
|
||||
db GO4K_ENV_ID
|
||||
db GO4K_VCO_ID
|
||||
db GO4K_FOP_ID
|
||||
db GO4K_VCF_ID
|
||||
db GO4K_DLL_ID
|
||||
db GO4K_PAN_ID
|
||||
db GO4K_DLL_ID
|
||||
db GO4K_OUT_ID
|
||||
GO4K_END_CMDDEF
|
||||
GO4K_BEGIN_CMDDEF(Instrument1)
|
||||
db GO4K_ENV_ID
|
||||
db GO4K_VCO_ID
|
||||
db GO4K_FST_ID
|
||||
db GO4K_FOP_ID
|
||||
db GO4K_VCO_ID
|
||||
db GO4K_DST_ID
|
||||
db GO4K_VCF_ID
|
||||
db GO4K_VCO_ID
|
||||
db GO4K_FOP_ID
|
||||
db GO4K_FOP_ID
|
||||
db GO4K_VCF_ID
|
||||
db GO4K_VCF_ID
|
||||
db GO4K_PAN_ID
|
||||
db GO4K_OUT_ID
|
||||
GO4K_END_CMDDEF
|
||||
GO4K_BEGIN_CMDDEF(Instrument2)
|
||||
db GO4K_ENV_ID
|
||||
db GO4K_VCO_ID
|
||||
db GO4K_VCF_ID
|
||||
db GO4K_FST_ID
|
||||
db GO4K_FST_ID
|
||||
db GO4K_FOP_ID
|
||||
db GO4K_VCO_ID
|
||||
db GO4K_VCO_ID
|
||||
db GO4K_VCO_ID
|
||||
db GO4K_VCO_ID
|
||||
db GO4K_FOP_ID
|
||||
db GO4K_FOP_ID
|
||||
db GO4K_FOP_ID
|
||||
db GO4K_FOP_ID
|
||||
db GO4K_VCF_ID
|
||||
db GO4K_DST_ID
|
||||
db GO4K_VCF_ID
|
||||
db GO4K_VCF_ID
|
||||
db GO4K_VCF_ID
|
||||
db GO4K_DLL_ID
|
||||
db GO4K_PAN_ID
|
||||
db GO4K_OUT_ID
|
||||
GO4K_END_CMDDEF
|
||||
GO4K_BEGIN_CMDDEF(Instrument3)
|
||||
db GO4K_ENV_ID
|
||||
db GO4K_FSTG_ID
|
||||
db GO4K_FSTG_ID
|
||||
db GO4K_FSTG_ID
|
||||
db GO4K_FSTG_ID
|
||||
db GO4K_FSTG_ID
|
||||
db GO4K_FSTG_ID
|
||||
db GO4K_FSTG_ID
|
||||
db GO4K_FOP_ID
|
||||
GO4K_END_CMDDEF
|
||||
GO4K_BEGIN_CMDDEF(Instrument4)
|
||||
db GO4K_ENV_ID
|
||||
db GO4K_VCO_ID
|
||||
db GO4K_VCF_ID
|
||||
db GO4K_FOP_ID
|
||||
db GO4K_ENV_ID
|
||||
db GO4K_VCO_ID
|
||||
db GO4K_VCF_ID
|
||||
db GO4K_FOP_ID
|
||||
db GO4K_ENV_ID
|
||||
db GO4K_FST_ID
|
||||
db GO4K_FOP_ID
|
||||
db GO4K_ENV_ID
|
||||
db GO4K_VCO_ID
|
||||
db GO4K_FOP_ID
|
||||
db GO4K_FOP_ID
|
||||
db GO4K_FOP_ID
|
||||
db GO4K_FOP_ID
|
||||
db GO4K_FOP_ID
|
||||
db GO4K_PAN_ID
|
||||
db GO4K_OUT_ID
|
||||
GO4K_END_CMDDEF
|
||||
GO4K_BEGIN_CMDDEF(Instrument5)
|
||||
db GO4K_ENV_ID
|
||||
db GO4K_FST_ID
|
||||
db GO4K_ENV_ID
|
||||
db GO4K_DST_ID
|
||||
db GO4K_FST_ID
|
||||
db GO4K_FOP_ID
|
||||
db GO4K_VCO_ID
|
||||
db GO4K_FOP_ID
|
||||
db GO4K_PAN_ID
|
||||
db GO4K_OUT_ID
|
||||
GO4K_END_CMDDEF
|
||||
GO4K_BEGIN_CMDDEF(Instrument6)
|
||||
db GO4K_ENV_ID
|
||||
db GO4K_FSTG_ID
|
||||
db GO4K_FSTG_ID
|
||||
db GO4K_FOP_ID
|
||||
GO4K_END_CMDDEF
|
||||
GO4K_BEGIN_CMDDEF(Instrument7)
|
||||
db GO4K_ENV_ID
|
||||
db GO4K_FST_ID
|
||||
db GO4K_FST_ID
|
||||
db GO4K_ENV_ID
|
||||
db GO4K_FST_ID
|
||||
db GO4K_FOP_ID
|
||||
db GO4K_VCO_ID
|
||||
db GO4K_VCO_ID
|
||||
db GO4K_FOP_ID
|
||||
db GO4K_VCF_ID
|
||||
db GO4K_DST_ID
|
||||
db GO4K_VCF_ID
|
||||
db GO4K_FOP_ID
|
||||
db GO4K_VCF_ID
|
||||
db GO4K_PAN_ID
|
||||
db GO4K_OUT_ID
|
||||
GO4K_END_CMDDEF
|
||||
GO4K_BEGIN_CMDDEF(Instrument8)
|
||||
db GO4K_ENV_ID
|
||||
db GO4K_VCO_ID
|
||||
db GO4K_VCO_ID
|
||||
db GO4K_VCF_ID
|
||||
db GO4K_VCF_ID
|
||||
db GO4K_FOP_ID
|
||||
db GO4K_FOP_ID
|
||||
db GO4K_PAN_ID
|
||||
db GO4K_OUT_ID
|
||||
GO4K_END_CMDDEF
|
||||
GO4K_BEGIN_CMDDEF(Instrument9)
|
||||
db GO4K_ENV_ID
|
||||
db GO4K_ENV_ID
|
||||
db GO4K_FOP_ID
|
||||
db GO4K_FOP_ID
|
||||
db GO4K_VCO_ID
|
||||
db GO4K_FOP_ID
|
||||
db GO4K_FST_ID
|
||||
db GO4K_FST_ID
|
||||
db GO4K_FST_ID
|
||||
db GO4K_FOP_ID
|
||||
db GO4K_VCO_ID
|
||||
db GO4K_VCO_ID
|
||||
db GO4K_VCO_ID
|
||||
db GO4K_FOP_ID
|
||||
db GO4K_FOP_ID
|
||||
db GO4K_VCF_ID
|
||||
db GO4K_DST_ID
|
||||
db GO4K_FOP_ID
|
||||
db GO4K_VCF_ID
|
||||
db GO4K_VCF_ID
|
||||
db GO4K_VCF_ID
|
||||
db GO4K_DLL_ID
|
||||
db GO4K_PAN_ID
|
||||
db GO4K_OUT_ID
|
||||
GO4K_END_CMDDEF
|
||||
GO4K_BEGIN_CMDDEF(Global)
|
||||
db GO4K_ACC_ID
|
||||
db GO4K_VCF_ID
|
||||
db GO4K_DLL_ID
|
||||
db GO4K_FOP_ID
|
||||
db GO4K_VCF_ID
|
||||
db GO4K_DLL_ID
|
||||
db GO4K_ACC_ID
|
||||
db GO4K_FOP_ID
|
||||
db GO4K_VCO_ID
|
||||
db GO4K_FSTG_ID
|
||||
db GO4K_FSTG_ID
|
||||
db GO4K_FOP_ID
|
||||
db GO4K_VCO_ID
|
||||
db GO4K_FSTG_ID
|
||||
db GO4K_FOP_ID
|
||||
db GO4K_VCF_ID
|
||||
db GO4K_VCF_ID
|
||||
db GO4K_VCF_ID
|
||||
db GO4K_FOP_ID
|
||||
db GO4K_VCF_ID
|
||||
db GO4K_VCF_ID
|
||||
db GO4K_VCF_ID
|
||||
db GO4K_OUT_ID
|
||||
GO4K_END_CMDDEF
|
||||
go4k_synth_instructions_end
|
||||
%ifdef USE_SECTIONS
|
||||
section .g4kmuc4 data align=1
|
||||
%else
|
||||
section .data
|
||||
%endif
|
||||
go4k_synth_parameter_values
|
||||
GO4K_BEGIN_PARAMDEF(Instrument0)
|
||||
GO4K_ENV ATTAC(16),DECAY(68),SUSTAIN(0),RELEASE(32),GAIN(72)
|
||||
GO4K_VCO TRANSPOSE(64),DETUNE(64),PHASE(64),GATES(0),COLOR(32),SHAPE(96),GAIN(128),FLAGS(TRISAW)
|
||||
GO4K_FOP OP(FOP_MULP)
|
||||
GO4K_VCF FREQUENCY(16),RESONANCE(128),VCFTYPE(LOWPASS)
|
||||
GO4K_DLL PREGAIN(64),DRY(96),FEEDBACK(16),DAMP(64),FREQUENCY(64),DEPTH(0),DELAY(17),COUNT(1)
|
||||
GO4K_PAN PANNING(0)
|
||||
GO4K_DLL PREGAIN(128),DRY(64),FEEDBACK(0),DAMP(128),FREQUENCY(0),DEPTH(128),DELAY(18),COUNT(1)
|
||||
GO4K_OUT GAIN(64), AUXSEND(48)
|
||||
GO4K_END_PARAMDEF
|
||||
GO4K_BEGIN_PARAMDEF(Instrument1)
|
||||
GO4K_ENV ATTAC(64),DECAY(64),SUSTAIN(64),RELEASE(64),GAIN(128)
|
||||
GO4K_VCO TRANSPOSE(52),DETUNE(60),PHASE(0),GATES(0),COLOR(128),SHAPE(64),GAIN(8),FLAGS(SINE)
|
||||
GO4K_FST AMOUNT(68),DEST(4*MAX_UNIT_SLOTS+3+FST_SET)
|
||||
GO4K_FOP OP(FOP_POP)
|
||||
GO4K_VCO TRANSPOSE(48),DETUNE(64),PHASE(0),GATES(0),COLOR(64),SHAPE(96),GAIN(128),FLAGS(TRISAW|LFO)
|
||||
GO4K_DST DRIVE(112), SNHFREQ(64), FLAGS(0)
|
||||
GO4K_VCF FREQUENCY(32),RESONANCE(64),VCFTYPE(LOWPASS)
|
||||
GO4K_VCO TRANSPOSE(52),DETUNE(68),PHASE(64),GATES(0),COLOR(64),SHAPE(64),GAIN(128),FLAGS(TRISAW)
|
||||
GO4K_FOP OP(FOP_ADDP)
|
||||
GO4K_FOP OP(FOP_MULP)
|
||||
GO4K_VCF FREQUENCY(8),RESONANCE(128),VCFTYPE(LOWPASS)
|
||||
GO4K_VCF FREQUENCY(16),RESONANCE(128),VCFTYPE(LOWPASS)
|
||||
GO4K_PAN PANNING(40)
|
||||
GO4K_OUT GAIN(48), AUXSEND(24)
|
||||
GO4K_END_PARAMDEF
|
||||
GO4K_BEGIN_PARAMDEF(Instrument2)
|
||||
GO4K_ENV ATTAC(80),DECAY(64),SUSTAIN(64),RELEASE(72),GAIN(128)
|
||||
GO4K_VCO TRANSPOSE(64),DETUNE(64),PHASE(0),GATES(0),COLOR(64),SHAPE(64),GAIN(24),FLAGS(NOISE)
|
||||
GO4K_VCF FREQUENCY(2),RESONANCE(128),VCFTYPE(LOWPASS)
|
||||
GO4K_FST AMOUNT(65),DEST(7*MAX_UNIT_SLOTS+3+FST_SET)
|
||||
GO4K_FST AMOUNT(63),DEST(6*MAX_UNIT_SLOTS+3+FST_SET)
|
||||
GO4K_FOP OP(FOP_POP)
|
||||
GO4K_VCO TRANSPOSE(64),DETUNE(60),PHASE(0),GATES(0),COLOR(32),SHAPE(112),GAIN(24),FLAGS(TRISAW)
|
||||
GO4K_VCO TRANSPOSE(52),DETUNE(62),PHASE(32),GATES(0),COLOR(80),SHAPE(40),GAIN(48),FLAGS(TRISAW)
|
||||
GO4K_VCO TRANSPOSE(60),DETUNE(68),PHASE(64),GATES(0),COLOR(48),SHAPE(88),GAIN(32),FLAGS(TRISAW)
|
||||
GO4K_VCO TRANSPOSE(48),DETUNE(66),PHASE(96),GATES(0),COLOR(96),SHAPE(16),GAIN(32),FLAGS(TRISAW)
|
||||
GO4K_FOP OP(FOP_ADDP)
|
||||
GO4K_FOP OP(FOP_ADDP)
|
||||
GO4K_FOP OP(FOP_ADDP)
|
||||
GO4K_FOP OP(FOP_ADDP)
|
||||
GO4K_VCF FREQUENCY(64),RESONANCE(128),VCFTYPE(LOWPASS)
|
||||
GO4K_DST DRIVE(64), SNHFREQ(96), FLAGS(0)
|
||||
GO4K_VCF FREQUENCY(72),RESONANCE(128),VCFTYPE(LOWPASS)
|
||||
GO4K_VCF FREQUENCY(8),RESONANCE(128),VCFTYPE(LOWPASS)
|
||||
GO4K_VCF FREQUENCY(16),RESONANCE(128),VCFTYPE(LOWPASS)
|
||||
GO4K_DLL PREGAIN(64),DRY(64),FEEDBACK(64),DAMP(64),FREQUENCY(0),DEPTH(0),DELAY(19),COUNT(1)
|
||||
GO4K_PAN PANNING(96)
|
||||
GO4K_OUT GAIN(16), AUXSEND(32)
|
||||
GO4K_END_PARAMDEF
|
||||
GO4K_BEGIN_PARAMDEF(Instrument3)
|
||||
GO4K_ENV ATTAC(112),DECAY(128),SUSTAIN(128),RELEASE(112),GAIN(128)
|
||||
GO4K_FSTG AMOUNT(100),DEST((0*go4k_instrument.size*MAX_VOICES/4)+(3*MAX_UNIT_SLOTS+4)+(go4k_instrument.workspace/4)+FST_SET)
|
||||
GO4K_FSTG AMOUNT(100),DEST((1*go4k_instrument.size*MAX_VOICES/4)+(11*MAX_UNIT_SLOTS+4)+(go4k_instrument.workspace/4)+FST_SET)
|
||||
GO4K_FSTG AMOUNT(100),DEST((2*go4k_instrument.size*MAX_VOICES/4)+(18*MAX_UNIT_SLOTS+4)+(go4k_instrument.workspace/4)+FST_SET)
|
||||
GO4K_FSTG AMOUNT(80),DEST((9*go4k_instrument.size*MAX_VOICES/4)+(23*MAX_UNIT_SLOTS+1)+(go4k_instrument.workspace/4)+FST_SET)
|
||||
GO4K_FSTG AMOUNT(80),DEST((8*go4k_instrument.size*MAX_VOICES/4)+(2*MAX_UNIT_SLOTS+7)+(go4k_instrument.workspace/4)+FST_SET)
|
||||
GO4K_FSTG AMOUNT(112),DEST((7*go4k_instrument.size*MAX_VOICES/4)+(13*MAX_UNIT_SLOTS+4)+(go4k_instrument.workspace/4)+FST_SET)
|
||||
GO4K_FSTG AMOUNT(88),DEST((7*go4k_instrument.size*MAX_VOICES/4)+(15*MAX_UNIT_SLOTS+1)+(go4k_instrument.workspace/4)+FST_SET)
|
||||
GO4K_FOP OP(FOP_POP)
|
||||
GO4K_END_PARAMDEF
|
||||
GO4K_BEGIN_PARAMDEF(Instrument4)
|
||||
GO4K_ENV ATTAC(0),DECAY(70),SUSTAIN(0),RELEASE(0),GAIN(128)
|
||||
GO4K_VCO TRANSPOSE(64),DETUNE(64),PHASE(0),GATES(0),COLOR(64),SHAPE(64),GAIN(128),FLAGS(NOISE)
|
||||
GO4K_VCF FREQUENCY(24),RESONANCE(128),VCFTYPE(BANDPASS)
|
||||
GO4K_FOP OP(FOP_MULP)
|
||||
GO4K_ENV ATTAC(0),DECAY(48),SUSTAIN(0),RELEASE(64),GAIN(96)
|
||||
GO4K_VCO TRANSPOSE(64),DETUNE(64),PHASE(0),GATES(0),COLOR(64),SHAPE(64),GAIN(24),FLAGS(NOISE)
|
||||
GO4K_VCF FREQUENCY(96),RESONANCE(128),VCFTYPE(BANDSTOP)
|
||||
GO4K_FOP OP(FOP_MULP)
|
||||
GO4K_ENV ATTAC(0),DECAY(72),SUSTAIN(64),RELEASE(64),GAIN(16)
|
||||
GO4K_FST AMOUNT(66),DEST(12*MAX_UNIT_SLOTS+3+FST_SET)
|
||||
GO4K_FOP OP(FOP_POP)
|
||||
GO4K_ENV ATTAC(0),DECAY(68),SUSTAIN(0),RELEASE(64),GAIN(128)
|
||||
GO4K_VCO TRANSPOSE(0),DETUNE(64),PHASE(0),GATES(0),COLOR(128),SHAPE(64),GAIN(32),FLAGS(SINE|LFO)
|
||||
GO4K_FOP OP(FOP_MULP)
|
||||
GO4K_FOP OP(FOP_ADDP)
|
||||
GO4K_FOP OP(FOP_ADDP)
|
||||
GO4K_FOP OP(FOP_PUSH)
|
||||
GO4K_FOP OP(FOP_ADDP)
|
||||
GO4K_PAN PANNING(56)
|
||||
GO4K_OUT GAIN(64), AUXSEND(32)
|
||||
GO4K_END_PARAMDEF
|
||||
GO4K_BEGIN_PARAMDEF(Instrument5)
|
||||
GO4K_ENV ATTAC(0),DECAY(76),SUSTAIN(0),RELEASE(64),GAIN(128)
|
||||
GO4K_FST AMOUNT(96),DEST(0*MAX_UNIT_SLOTS+2+FST_SET)
|
||||
GO4K_ENV ATTAC(0),DECAY(72),SUSTAIN(0),RELEASE(0),GAIN(128)
|
||||
GO4K_DST DRIVE(32), SNHFREQ(128), FLAGS(0)
|
||||
GO4K_FST AMOUNT(80),DEST(6*MAX_UNIT_SLOTS+1+FST_SET)
|
||||
GO4K_FOP OP(FOP_POP)
|
||||
GO4K_VCO TRANSPOSE(40),DETUNE(64),PHASE(0),GATES(85),COLOR(64),SHAPE(64),GAIN(128),FLAGS(TRISAW)
|
||||
GO4K_FOP OP(FOP_MULP)
|
||||
GO4K_PAN PANNING(64)
|
||||
GO4K_OUT GAIN(64), AUXSEND(8)
|
||||
GO4K_END_PARAMDEF
|
||||
GO4K_BEGIN_PARAMDEF(Instrument6)
|
||||
GO4K_ENV ATTAC(90),DECAY(128),SUSTAIN(128),RELEASE(90),GAIN(128)
|
||||
GO4K_FSTG AMOUNT(112),DEST((1*go4k_instrument.size*MAX_VOICES/4)+(10*MAX_UNIT_SLOTS+4)+(go4k_instrument.workspace/4)+FST_SET)
|
||||
GO4K_FSTG AMOUNT(112),DEST((2*go4k_instrument.size*MAX_VOICES/4)+(17*MAX_UNIT_SLOTS+4)+(go4k_instrument.workspace/4)+FST_SET)
|
||||
GO4K_FOP OP(FOP_POP)
|
||||
GO4K_END_PARAMDEF
|
||||
GO4K_BEGIN_PARAMDEF(Instrument7)
|
||||
GO4K_ENV ATTAC(32),DECAY(72),SUSTAIN(0),RELEASE(32),GAIN(88)
|
||||
GO4K_FST AMOUNT(108),DEST(0*MAX_UNIT_SLOTS+2+FST_SET)
|
||||
GO4K_FST AMOUNT(88),DEST(11*MAX_UNIT_SLOTS+4+FST_SET)
|
||||
GO4K_ENV ATTAC(0),DECAY(60),SUSTAIN(0),RELEASE(0),GAIN(128)
|
||||
GO4K_FST AMOUNT(52),DEST(7*MAX_UNIT_SLOTS+6+FST_SET)
|
||||
GO4K_FOP OP(FOP_POP)
|
||||
GO4K_VCO TRANSPOSE(64),DETUNE(70),PHASE(32),GATES(85),COLOR(128),SHAPE(80),GAIN(64),FLAGS(SINE)
|
||||
GO4K_VCO TRANSPOSE(64),DETUNE(48),PHASE(48),GATES(85),COLOR(128),SHAPE(96),GAIN(64),FLAGS(SINE)
|
||||
GO4K_FOP OP(FOP_ADDP)
|
||||
GO4K_VCF FREQUENCY(32),RESONANCE(128),VCFTYPE(LOWPASS)
|
||||
GO4K_DST DRIVE(112), SNHFREQ(128), FLAGS(0)
|
||||
GO4K_VCF FREQUENCY(32),RESONANCE(128),VCFTYPE(ALLPASS)
|
||||
GO4K_FOP OP(FOP_MULP)
|
||||
GO4K_VCF FREQUENCY(24),RESONANCE(128),VCFTYPE(LOWPASS)
|
||||
GO4K_PAN PANNING(48)
|
||||
GO4K_OUT GAIN(8), AUXSEND(8)
|
||||
GO4K_END_PARAMDEF
|
||||
GO4K_BEGIN_PARAMDEF(Instrument8)
|
||||
GO4K_ENV ATTAC(0),DECAY(128),SUSTAIN(128),RELEASE(0),GAIN(128)
|
||||
GO4K_VCO TRANSPOSE(64),DETUNE(64),PHASE(0),GATES(1),COLOR(3),SHAPE(64),GAIN(128),FLAGS(GATE|LFO)
|
||||
GO4K_VCO TRANSPOSE(64),DETUNE(64),PHASE(0),GATES(0),COLOR(64),SHAPE(64),GAIN(32),FLAGS(NOISE)
|
||||
GO4K_VCF FREQUENCY(112),RESONANCE(128),VCFTYPE(BANDPASS)
|
||||
GO4K_VCF FREQUENCY(112),RESONANCE(128),VCFTYPE(LOWPASS)
|
||||
GO4K_FOP OP(FOP_MULP)
|
||||
GO4K_FOP OP(FOP_MULP)
|
||||
GO4K_PAN PANNING(80)
|
||||
GO4K_OUT GAIN(12), AUXSEND(8)
|
||||
GO4K_END_PARAMDEF
|
||||
GO4K_BEGIN_PARAMDEF(Instrument9)
|
||||
GO4K_ENV ATTAC(48),DECAY(64),SUSTAIN(64),RELEASE(88),GAIN(128)
|
||||
GO4K_ENV ATTAC(80),DECAY(128),SUSTAIN(128),RELEASE(128),GAIN(128)
|
||||
GO4K_FOP OP(FOP_PUSH)
|
||||
GO4K_FOP OP(FOP_MULP)
|
||||
GO4K_VCO TRANSPOSE(64),DETUNE(64),PHASE(0),GATES(0),COLOR(128),SHAPE(64),GAIN(8),FLAGS(SINE|LFO)
|
||||
GO4K_FOP OP(FOP_MULP)
|
||||
GO4K_FST AMOUNT(66),DEST(10*MAX_UNIT_SLOTS+1+FST_SET)
|
||||
GO4K_FST AMOUNT(66),DEST(11*MAX_UNIT_SLOTS+1+FST_SET)
|
||||
GO4K_FST AMOUNT(66),DEST(12*MAX_UNIT_SLOTS+1+FST_SET)
|
||||
GO4K_FOP OP(FOP_POP)
|
||||
GO4K_VCO TRANSPOSE(64),DETUNE(62),PHASE(0),GATES(0),COLOR(32),SHAPE(64),GAIN(64),FLAGS(TRISAW)
|
||||
GO4K_VCO TRANSPOSE(64),DETUNE(66),PHASE(48),GATES(0),COLOR(64),SHAPE(64),GAIN(64),FLAGS(TRISAW)
|
||||
GO4K_VCO TRANSPOSE(64),DETUNE(64),PHASE(96),GATES(0),COLOR(128),SHAPE(96),GAIN(64),FLAGS(SINE)
|
||||
GO4K_FOP OP(FOP_ADDP)
|
||||
GO4K_FOP OP(FOP_ADDP)
|
||||
GO4K_VCF FREQUENCY(8),RESONANCE(128),VCFTYPE(HIGHPASS)
|
||||
GO4K_DST DRIVE(80), SNHFREQ(96), FLAGS(0)
|
||||
GO4K_FOP OP(FOP_MULP)
|
||||
GO4K_VCF FREQUENCY(96),RESONANCE(0),VCFTYPE(BANDSTOP)
|
||||
GO4K_VCF FREQUENCY(64),RESONANCE(0),VCFTYPE(BANDSTOP)
|
||||
GO4K_VCF FREQUENCY(32),RESONANCE(0),VCFTYPE(BANDSTOP)
|
||||
GO4K_DLL PREGAIN(96),DRY(96),FEEDBACK(64),DAMP(64),FREQUENCY(0),DEPTH(0),DELAY(19),COUNT(1)
|
||||
GO4K_PAN PANNING(64)
|
||||
GO4K_OUT GAIN(32), AUXSEND(24)
|
||||
GO4K_END_PARAMDEF
|
||||
GO4K_BEGIN_PARAMDEF(Global)
|
||||
GO4K_ACC ACCTYPE(AUX)
|
||||
GO4K_VCF FREQUENCY(32),RESONANCE(64),VCFTYPE(HIGHPASS)
|
||||
GO4K_DLL PREGAIN(64),DRY(0),FEEDBACK(112),DAMP(32),FREQUENCY(128),DEPTH(0),DELAY(1),COUNT(8)
|
||||
GO4K_FOP OP(FOP_XCH)
|
||||
GO4K_VCF FREQUENCY(32),RESONANCE(64),VCFTYPE(HIGHPASS)
|
||||
GO4K_DLL PREGAIN(64),DRY(0),FEEDBACK(112),DAMP(32),FREQUENCY(128),DEPTH(0),DELAY(9),COUNT(8)
|
||||
GO4K_ACC ACCTYPE(OUTPUT)
|
||||
GO4K_FOP OP(FOP_ADDP2)
|
||||
GO4K_VCO TRANSPOSE(40),DETUNE(64),PHASE(32),GATES(0),COLOR(128),SHAPE(64),GAIN(128),FLAGS(SINE|LFO)
|
||||
GO4K_FSTG AMOUNT(80),DEST((0*go4k_instrument.size*MAX_VOICES/4)+(1*MAX_UNIT_SLOTS+7)+(go4k_instrument.workspace/4)+FST_SET)
|
||||
GO4K_FSTG AMOUNT(65),DEST((1*go4k_instrument.size*MAX_VOICES/4)+(1*MAX_UNIT_SLOTS+7)+(go4k_instrument.workspace/4)+FST_SET)
|
||||
GO4K_FOP OP(FOP_POP)
|
||||
GO4K_VCO TRANSPOSE(52),DETUNE(64),PHASE(33),GATES(0),COLOR(128),SHAPE(64),GAIN(128),FLAGS(SINE|LFO)
|
||||
GO4K_FSTG AMOUNT(88),DEST((8*go4k_instrument.size*MAX_VOICES/4)+(2*MAX_UNIT_SLOTS+7)+(go4k_instrument.workspace/4)+FST_SET)
|
||||
GO4K_FOP OP(FOP_POP)
|
||||
GO4K_VCF FREQUENCY(72),RESONANCE(32),VCFTYPE(ALLPASS)
|
||||
GO4K_VCF FREQUENCY(96),RESONANCE(64),VCFTYPE(ALLPASS)
|
||||
GO4K_VCF FREQUENCY(48),RESONANCE(128),VCFTYPE(PEAK)
|
||||
GO4K_FOP OP(FOP_XCH)
|
||||
GO4K_VCF FREQUENCY(72),RESONANCE(32),VCFTYPE(ALLPASS)
|
||||
GO4K_VCF FREQUENCY(96),RESONANCE(64),VCFTYPE(ALLPASS)
|
||||
GO4K_VCF FREQUENCY(48),RESONANCE(128),VCFTYPE(PEAK)
|
||||
GO4K_OUT GAIN(64), AUXSEND(0)
|
||||
GO4K_END_PARAMDEF
|
||||
go4k_synth_parameter_values_end
|
||||
%ifdef USE_SECTIONS
|
||||
section .g4kmuc5 data align=1
|
||||
%else
|
||||
section .data
|
||||
%endif
|
||||
%ifdef GO4K_USE_DLL
|
||||
global _go4k_delay_times
|
||||
_go4k_delay_times
|
||||
dw 0
|
||||
dw 1116
|
||||
dw 1188
|
||||
dw 1276
|
||||
dw 1356
|
||||
dw 1422
|
||||
dw 1492
|
||||
dw 1556
|
||||
dw 1618
|
||||
dw 1140
|
||||
dw 1212
|
||||
dw 1300
|
||||
dw 1380
|
||||
dw 1446
|
||||
dw 1516
|
||||
dw 1580
|
||||
dw 1642
|
||||
dw 30384
|
||||
dw 512
|
||||
dw 15192
|
||||
%endif
|
||||
BIN
hgplus/revision15-8k/src/intro/framework/8klang.merge
Normal file
BIN
hgplus/revision15-8k/src/intro/framework/8klang.merge
Normal file
Binary file not shown.
577
hgplus/revision15-8k/src/intro/framework/authoring.h
Normal file
577
hgplus/revision15-8k/src/intro/framework/authoring.h
Normal file
@@ -0,0 +1,577 @@
|
||||
#pragma once
|
||||
|
||||
#include <Shlwapi.h>
|
||||
#include "mutexlock.h"
|
||||
|
||||
static HANDLE shaderCompileEvent;
|
||||
|
||||
struct SharedMemoryToolType
|
||||
{
|
||||
int WindowLeft;
|
||||
int WindowTop;
|
||||
int WindowWidth;
|
||||
int WindowHeight;
|
||||
int MaxSamples;
|
||||
int SampleSize;
|
||||
int SamplesPerTick;
|
||||
int TicksPerScene;
|
||||
float IntroPosition;
|
||||
int AudioRenderPosition;
|
||||
int SeekToScene;
|
||||
bool KeepAlive;
|
||||
HWND introHandle;
|
||||
HWND analysisHandle;
|
||||
bool UseMinifiedShader;
|
||||
};
|
||||
|
||||
static D3D11_TEXTURE1D_DESC histogramTextureDesc =
|
||||
{
|
||||
256,
|
||||
1,
|
||||
1,
|
||||
DXGI_FORMAT_R32G32B32A32_FLOAT,
|
||||
D3D11_USAGE_DEFAULT,
|
||||
D3D11_BIND_UNORDERED_ACCESS,
|
||||
0,
|
||||
0
|
||||
};
|
||||
|
||||
static D3D11_TEXTURE1D_DESC histogramStagingTextureDesc =
|
||||
{
|
||||
256,
|
||||
1,
|
||||
1,
|
||||
DXGI_FORMAT_R32G32B32A32_FLOAT,
|
||||
D3D11_USAGE_STAGING,
|
||||
0,
|
||||
D3D11_CPU_ACCESS_READ,
|
||||
0
|
||||
};
|
||||
|
||||
static D3D11_TEXTURE1D_DESC histogramBucketTextureDesc =
|
||||
{
|
||||
257,
|
||||
1,
|
||||
1,
|
||||
DXGI_FORMAT_R32_UINT,
|
||||
D3D11_USAGE_DEFAULT,
|
||||
D3D11_BIND_UNORDERED_ACCESS,
|
||||
0,
|
||||
0
|
||||
};
|
||||
|
||||
static D3D11_TEXTURE2D_DESC paradeVectorScopeBucketTextureDesc =
|
||||
{
|
||||
257,
|
||||
256,
|
||||
1,
|
||||
1,
|
||||
DXGI_FORMAT_R32_UINT,
|
||||
{ 1, 0 },
|
||||
D3D11_USAGE_DEFAULT,
|
||||
D3D11_BIND_UNORDERED_ACCESS,
|
||||
0,
|
||||
0
|
||||
};
|
||||
|
||||
static D3D11_TEXTURE2D_DESC paradeTextureDesc =
|
||||
{
|
||||
256,
|
||||
256,
|
||||
1,
|
||||
1,
|
||||
DXGI_FORMAT_R8G8B8A8_UINT,
|
||||
{ 1, 0 },
|
||||
D3D11_USAGE_DEFAULT,
|
||||
D3D11_BIND_UNORDERED_ACCESS,
|
||||
0,
|
||||
0
|
||||
};
|
||||
|
||||
static D3D11_TEXTURE2D_DESC paradeStagingTextureDesc =
|
||||
{
|
||||
256,
|
||||
256,
|
||||
1,
|
||||
1,
|
||||
DXGI_FORMAT_R8G8B8A8_UINT,
|
||||
{ 1, 0 },
|
||||
D3D11_USAGE_STAGING,
|
||||
0,
|
||||
D3D11_CPU_ACCESS_READ,
|
||||
0
|
||||
};
|
||||
|
||||
static D3D11_TEXTURE2D_DESC vectorScopeTextureDesc =
|
||||
{
|
||||
256,
|
||||
256,
|
||||
1,
|
||||
1,
|
||||
DXGI_FORMAT_R8G8B8A8_UINT,
|
||||
{ 1, 0 },
|
||||
D3D11_USAGE_DEFAULT,
|
||||
D3D11_BIND_UNORDERED_ACCESS,
|
||||
0,
|
||||
0
|
||||
};
|
||||
|
||||
static D3D11_TEXTURE2D_DESC vectorScopeStagingTextureDesc =
|
||||
{
|
||||
256,
|
||||
256,
|
||||
1,
|
||||
1,
|
||||
DXGI_FORMAT_R8G8B8A8_UINT,
|
||||
{ 1, 0 },
|
||||
D3D11_USAGE_STAGING,
|
||||
0,
|
||||
D3D11_CPU_ACCESS_READ,
|
||||
0
|
||||
};
|
||||
|
||||
static D3D11_UNORDERED_ACCESS_VIEW_DESC histogramUAVdesc =
|
||||
{
|
||||
DXGI_FORMAT_R32G32B32A32_FLOAT,
|
||||
D3D11_UAV_DIMENSION_TEXTURE1D,
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
static D3D11_UNORDERED_ACCESS_VIEW_DESC histogramBucketUAVdesc =
|
||||
{
|
||||
DXGI_FORMAT_R32_UINT,
|
||||
D3D11_UAV_DIMENSION_TEXTURE1D,
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
static D3D11_UNORDERED_ACCESS_VIEW_DESC paradeUAVdesc =
|
||||
{
|
||||
DXGI_FORMAT_R8G8B8A8_UINT,
|
||||
D3D11_UAV_DIMENSION_TEXTURE2D,
|
||||
{ 0, 1 }
|
||||
};
|
||||
|
||||
static D3D11_UNORDERED_ACCESS_VIEW_DESC paradeVectorScopeBucketUAVdesc =
|
||||
{
|
||||
DXGI_FORMAT_R32_UINT,
|
||||
D3D11_UAV_DIMENSION_TEXTURE2D,
|
||||
{ 0, 1 }
|
||||
};
|
||||
|
||||
static D3D11_UNORDERED_ACCESS_VIEW_DESC vectorScopeUAVdesc =
|
||||
{
|
||||
DXGI_FORMAT_R8G8B8A8_UINT,
|
||||
D3D11_UAV_DIMENSION_TEXTURE2D,
|
||||
{ 0, 1 }
|
||||
};
|
||||
|
||||
static D3D11_SHADER_RESOURCE_VIEW_DESC analysisSRVdesc =
|
||||
{
|
||||
DXGI_FORMAT_R8G8B8A8_UNORM,
|
||||
D3D11_SRV_DIMENSION_TEXTURE2D,
|
||||
{ 0, 1 }
|
||||
};
|
||||
|
||||
static SharedMemoryToolType* SharedMemoryTool;
|
||||
static char* SharedImage;
|
||||
static HANDLE AudioFileMapping;
|
||||
static HANDLE ImageFileMapping;
|
||||
static HANDLE HistogramFileMapping;
|
||||
static HANDLE ParadeFileMapping;
|
||||
static HANDLE VectorscopeFileMapping;
|
||||
static HANDLE SharedMemoryFileMapping;
|
||||
static bool playMusic;
|
||||
static long musicStartOffset;
|
||||
static HANDLE SharedMemoryMutex;
|
||||
static D3D11_TEXTURE2D_DESC analysisDesc;
|
||||
static ID3D11Texture2D* resolvedTexture;
|
||||
static ID3D11Texture2D* stagingTexture;
|
||||
static ID3D11Texture1D* histogramTexture;
|
||||
static ID3D11Texture1D* histogramRedBucketTexture;
|
||||
static ID3D11Texture1D* histogramGreenBucketTexture;
|
||||
static ID3D11Texture1D* histogramBlueBucketTexture;
|
||||
static ID3D11Texture1D* histogramStagingTexture;
|
||||
static ID3D11Texture2D* paradeRedBucketTexture;
|
||||
static ID3D11Texture2D* paradeGreenBucketTexture;
|
||||
static ID3D11Texture2D* paradeBlueBucketTexture;
|
||||
static ID3D11Texture2D* paradeAlphaBucketTexture;
|
||||
static ID3D11Texture2D* paradeTexture;
|
||||
static ID3D11Texture2D* paradeStagingTexture;
|
||||
static ID3D11Texture2D* vectorScopeBucketTexture;
|
||||
static ID3D11Texture2D* vectorScopeTexture;
|
||||
static ID3D11Texture2D* vectorScopeStagingTexture;
|
||||
static ID3D11ComputeShader* csHistogramGather;
|
||||
static ID3D11ComputeShader* csHistogramMaximum;
|
||||
static ID3D11ComputeShader* csHistogramSpread;
|
||||
static ID3D11ComputeShader* csParadeVectorscopeGather;
|
||||
static ID3D11ComputeShader* csParadeVectorscopeMaximum;
|
||||
static ID3D11ComputeShader* csParadeVectorscopeSpread;
|
||||
static ID3D11UnorderedAccessView* histogramUAV;
|
||||
static ID3D11UnorderedAccessView* histogramRedBucketUAV;
|
||||
static ID3D11UnorderedAccessView* histogramGreenBucketUAV;
|
||||
static ID3D11UnorderedAccessView* histogramBlueBucketUAV;
|
||||
static ID3D11UnorderedAccessView* paradeUAV;
|
||||
static ID3D11UnorderedAccessView* paradeRedBucketUAV;
|
||||
static ID3D11UnorderedAccessView* paradeGreenBucketUAV;
|
||||
static ID3D11UnorderedAccessView* paradeBlueBucketUAV;
|
||||
static ID3D11UnorderedAccessView* paradeAlphaBucketUAV;
|
||||
static ID3D11UnorderedAccessView* vectorScopeUAV;
|
||||
static ID3D11UnorderedAccessView* vectorScopeBucketUAV;
|
||||
static ID3D11ShaderResourceView* analysisSRV;
|
||||
static D3D11_MAPPED_SUBRESOURCE mappedResource;
|
||||
static float* histogram;
|
||||
static float* parade;
|
||||
static float* vectorscope;
|
||||
static HANDLE hShaderErrorPipe;
|
||||
|
||||
extern "C" int _4klang_current_tick;
|
||||
|
||||
float AuthoringGetIntroPosition()
|
||||
{
|
||||
float time = SoundGetIntroPosition();
|
||||
return time + musicStartOffset / (float)(SAMPLES_PER_TICK * SOUND_TICKS_PER_SCENE);
|
||||
}
|
||||
|
||||
void ReadFile(char* path, char** content, size_t* length)
|
||||
{
|
||||
FILE* shaderFile;
|
||||
auto error = fopen_s(&shaderFile, path, "rb");
|
||||
fseek(shaderFile, 0, SEEK_END);
|
||||
*length = ftell(shaderFile);
|
||||
*content = new char[*length];
|
||||
fseek(shaderFile, 0, SEEK_SET);
|
||||
fread_s(*content, *length, sizeof(char), *length, shaderFile);
|
||||
fclose(shaderFile);
|
||||
}
|
||||
|
||||
void AuthoringInit()
|
||||
{
|
||||
MutexLock("IntroAuthorMutex");
|
||||
|
||||
Log("IntroInit");
|
||||
SharedMemoryFileMapping = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, sizeof(SharedMemoryToolType), "IntroAuthor");
|
||||
AudioFileMapping = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, sizeof(SAMPLE_TYPE)* MAX_SAMPLES * 2, "IntroAudio");
|
||||
ImageFileMapping = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, 4 * SCREENWIDTH * SCREENHEIGHT, "IntroImage");
|
||||
HistogramFileMapping = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, 4 * 4 * 256, "IntroHistogram");
|
||||
ParadeFileMapping = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, 4 * 256 * 256, "IntroParade");
|
||||
VectorscopeFileMapping = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, 4 * 256 * 256, "IntroVectorscope");
|
||||
|
||||
SharedMemoryTool = (SharedMemoryToolType*)MapViewOfFile(SharedMemoryFileMapping, FILE_MAP_ALL_ACCESS, 0, 0, sizeof(SharedMemoryToolType));
|
||||
soundBuffer = (SAMPLE_TYPE*)MapViewOfFile(AudioFileMapping, FILE_MAP_ALL_ACCESS, 0, 0, sizeof(SAMPLE_TYPE)* MAX_SAMPLES * 2);
|
||||
SharedImage = (char*)MapViewOfFile(ImageFileMapping, FILE_MAP_ALL_ACCESS, 0, 0, 4 * SCREENWIDTH * SCREENHEIGHT);
|
||||
histogram = (float*)MapViewOfFile(HistogramFileMapping, FILE_MAP_ALL_ACCESS, 0, 0, 4 * 4 * 256);
|
||||
parade = (float*)MapViewOfFile(ParadeFileMapping, FILE_MAP_ALL_ACCESS, 0, 0, 4 * 256 * 256);
|
||||
vectorscope = (float*)MapViewOfFile(VectorscopeFileMapping, FILE_MAP_ALL_ACCESS, 0, 0, 4 * 256 * 256);
|
||||
|
||||
WaveHDR.lpData = (LPSTR)soundBuffer;
|
||||
|
||||
RECT rect;
|
||||
GetWindowRect(windowHandle, &rect);
|
||||
SharedMemoryTool->WindowLeft = rect.left;
|
||||
SharedMemoryTool->WindowTop = rect.top;
|
||||
SharedMemoryTool->WindowWidth = rect.right - rect.left - 16;
|
||||
SharedMemoryTool->WindowHeight = rect.bottom - rect.top - 39;
|
||||
SharedMemoryTool->MaxSamples = MAX_SAMPLES;
|
||||
SharedMemoryTool->SampleSize = sizeof(SAMPLE_TYPE);
|
||||
SharedMemoryTool->SamplesPerTick = SAMPLES_PER_TICK;
|
||||
SharedMemoryTool->TicksPerScene = SOUND_TICKS_PER_SCENE;
|
||||
SharedMemoryTool->SeekToScene = -1;
|
||||
SharedMemoryTool->KeepAlive = true;
|
||||
SharedMemoryTool->UseMinifiedShader = true;
|
||||
|
||||
backBufferTexture->GetDesc(&analysisDesc);
|
||||
analysisDesc.Usage = D3D11_USAGE_DEFAULT;
|
||||
analysisDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
|
||||
analysisDesc.BindFlags = D3D11_BIND_SHADER_RESOURCE;
|
||||
analysisDesc.SampleDesc.Count = 1;
|
||||
device->CreateTexture2D(&analysisDesc, NULL, &resolvedTexture);
|
||||
|
||||
analysisDesc.Usage = D3D11_USAGE_STAGING;
|
||||
analysisDesc.BindFlags = 0;
|
||||
analysisDesc.CPUAccessFlags |= D3D11_CPU_ACCESS_READ;
|
||||
device->CreateTexture2D(&analysisDesc, NULL, &stagingTexture);
|
||||
device->CreateShaderResourceView(resolvedTexture, &analysisSRVdesc, &analysisSRV);
|
||||
|
||||
device->CreateTexture1D(&histogramTextureDesc, NULL, &histogramTexture);
|
||||
device->CreateTexture1D(&histogramBucketTextureDesc, NULL, &histogramRedBucketTexture);
|
||||
device->CreateTexture1D(&histogramBucketTextureDesc, NULL, &histogramGreenBucketTexture);
|
||||
device->CreateTexture1D(&histogramBucketTextureDesc, NULL, &histogramBlueBucketTexture);
|
||||
device->CreateUnorderedAccessView(histogramTexture, &histogramUAVdesc, &histogramUAV);
|
||||
device->CreateUnorderedAccessView(histogramRedBucketTexture, &histogramBucketUAVdesc, &histogramRedBucketUAV);
|
||||
device->CreateUnorderedAccessView(histogramGreenBucketTexture, &histogramBucketUAVdesc, &histogramGreenBucketUAV);
|
||||
device->CreateUnorderedAccessView(histogramBlueBucketTexture, &histogramBucketUAVdesc, &histogramBlueBucketUAV);
|
||||
device->CreateTexture1D(&histogramStagingTextureDesc, NULL, &histogramStagingTexture);
|
||||
|
||||
device->CreateTexture2D(¶deVectorScopeBucketTextureDesc, NULL, ¶deRedBucketTexture);
|
||||
device->CreateTexture2D(¶deVectorScopeBucketTextureDesc, NULL, ¶deGreenBucketTexture);
|
||||
device->CreateTexture2D(¶deVectorScopeBucketTextureDesc, NULL, ¶deBlueBucketTexture);
|
||||
device->CreateTexture2D(¶deVectorScopeBucketTextureDesc, NULL, ¶deAlphaBucketTexture);
|
||||
device->CreateTexture2D(¶deVectorScopeBucketTextureDesc, NULL, &vectorScopeBucketTexture);
|
||||
|
||||
device->CreateTexture2D(¶deTextureDesc, NULL, ¶deTexture);
|
||||
device->CreateTexture2D(¶deStagingTextureDesc, NULL, ¶deStagingTexture);
|
||||
device->CreateTexture2D(&vectorScopeTextureDesc, NULL, &vectorScopeTexture);
|
||||
device->CreateTexture2D(&vectorScopeStagingTextureDesc, NULL, &vectorScopeStagingTexture);
|
||||
|
||||
device->CreateUnorderedAccessView(paradeRedBucketTexture, ¶deVectorScopeBucketUAVdesc, ¶deRedBucketUAV);
|
||||
device->CreateUnorderedAccessView(paradeGreenBucketTexture, ¶deVectorScopeBucketUAVdesc, ¶deGreenBucketUAV);
|
||||
device->CreateUnorderedAccessView(paradeBlueBucketTexture, ¶deVectorScopeBucketUAVdesc, ¶deBlueBucketUAV);
|
||||
device->CreateUnorderedAccessView(paradeAlphaBucketTexture, ¶deVectorScopeBucketUAVdesc, ¶deAlphaBucketUAV);
|
||||
device->CreateUnorderedAccessView(vectorScopeBucketTexture, ¶deVectorScopeBucketUAVdesc, &vectorScopeBucketUAV);
|
||||
device->CreateUnorderedAccessView(vectorScopeTexture, &vectorScopeUAVdesc, &vectorScopeUAV);
|
||||
device->CreateUnorderedAccessView(paradeTexture, ¶deUAVdesc, ¶deUAV);
|
||||
|
||||
static char shaderPath[MAX_PATH];
|
||||
static char exePath[MAX_PATH];
|
||||
static char* shaderCode;
|
||||
static size_t shaderLength;
|
||||
|
||||
GetModuleFileName(NULL, exePath, MAX_PATH);
|
||||
PathRemoveFileSpec(exePath);
|
||||
|
||||
PathCombine(shaderPath, exePath, "histogramGather.cso");
|
||||
ReadFile(shaderPath, &shaderCode, &shaderLength);
|
||||
device->CreateComputeShader(shaderCode, shaderLength, NULL, &csHistogramGather);
|
||||
|
||||
PathCombine(shaderPath, exePath, "histogramMaximum.cso");
|
||||
ReadFile(shaderPath, &shaderCode, &shaderLength);
|
||||
device->CreateComputeShader(shaderCode, shaderLength, NULL, &csHistogramMaximum);
|
||||
|
||||
PathCombine(shaderPath, exePath, "histogramSpread.cso");
|
||||
ReadFile(shaderPath, &shaderCode, &shaderLength);
|
||||
device->CreateComputeShader(shaderCode, shaderLength, NULL, &csHistogramSpread);
|
||||
|
||||
PathCombine(shaderPath, exePath, "paradeVectorscopeGather.cso");
|
||||
ReadFile(shaderPath, &shaderCode, &shaderLength);
|
||||
device->CreateComputeShader(shaderCode, shaderLength, NULL, &csParadeVectorscopeGather);
|
||||
|
||||
PathCombine(shaderPath, exePath, "paradeVectorscopeMaximum.cso");
|
||||
ReadFile(shaderPath, &shaderCode, &shaderLength);
|
||||
device->CreateComputeShader(shaderCode, shaderLength, NULL, &csParadeVectorscopeMaximum);
|
||||
|
||||
PathCombine(shaderPath, exePath, "paradeVectorscopeSpread.cso");
|
||||
ReadFile(shaderPath, &shaderCode, &shaderLength);
|
||||
device->CreateComputeShader(shaderCode, shaderLength, NULL, &csParadeVectorscopeSpread);
|
||||
|
||||
while (1)
|
||||
{
|
||||
auto pipeName = "\\\\.\\pipe\\8kode";
|
||||
hShaderErrorPipe = CreateFileA(
|
||||
pipeName, // pipe name
|
||||
GENERIC_WRITE |
|
||||
GENERIC_WRITE, // read/write access
|
||||
0, // no sharing
|
||||
NULL, // default security attributes
|
||||
OPEN_EXISTING, // opens existing pipe
|
||||
0, // default attributes
|
||||
NULL); // no template file
|
||||
|
||||
// Break if the pipe handle is valid.
|
||||
if (hShaderErrorPipe != INVALID_HANDLE_VALUE)
|
||||
break;
|
||||
|
||||
// Exit if an error other than ERROR_PIPE_BUSY occurs.
|
||||
DWORD error;
|
||||
if (error = GetLastError() != ERROR_PIPE_BUSY)
|
||||
{
|
||||
Error("Could not open pipe");
|
||||
}
|
||||
|
||||
// All pipe instances are busy, so wait for 2 seconds.
|
||||
if (WaitNamedPipe(pipeName, 2000))
|
||||
{
|
||||
printf("Could not open pipe: 2 second wait timed out.");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool audio_IsPaused = false;
|
||||
|
||||
void SoundSeekToRow(void *d, int row)
|
||||
{
|
||||
if (row < 0)
|
||||
row = 0;
|
||||
|
||||
musicStartOffset = row * (long)(SAMPLES_PER_TICK * SOUND_TICKS_PER_SCENE) / SYNC_ROWS_PER_SCENE;
|
||||
|
||||
WaveHDR.lpData = (LPSTR)(float*)(soundBuffer + musicStartOffset * 2);
|
||||
WaveHDR.dwBufferLength = (MAX_SAMPLES - musicStartOffset) * sizeof(SAMPLE_TYPE) * 2;
|
||||
|
||||
//send buffer to waveOut
|
||||
waveOutReset(hWaveOut);
|
||||
waveOutPrepareHeader(hWaveOut, &WaveHDR, sizeof(WaveHDR));
|
||||
waveOutWrite(hWaveOut, &WaveHDR, sizeof(WaveHDR));
|
||||
|
||||
//put on pause
|
||||
if (audio_IsPaused)
|
||||
waveOutPause(hWaveOut);
|
||||
}
|
||||
|
||||
void SoundSeekToScene(void *d, int scene)
|
||||
{
|
||||
SoundSeekToRow(d, scene * SYNC_ROWS_PER_SCENE);
|
||||
}
|
||||
|
||||
void SoundPause(void *d, int iPause)
|
||||
{
|
||||
// Check if there is change of current play/pause state?
|
||||
if (audio_IsPaused != (bool)iPause)
|
||||
{
|
||||
// Assign new state
|
||||
audio_IsPaused = (bool)iPause;
|
||||
|
||||
// Change audio play state
|
||||
if (audio_IsPaused)
|
||||
waveOutPause(hWaveOut);
|
||||
else
|
||||
waveOutRestart(hWaveOut);
|
||||
}
|
||||
}
|
||||
|
||||
int SoundIsPlaying(void *d)
|
||||
{
|
||||
return (int)!audio_IsPaused;
|
||||
}
|
||||
|
||||
struct sync_cb usync_cb =
|
||||
{
|
||||
SoundPause,
|
||||
SoundSeekToRow,
|
||||
SoundIsPlaying
|
||||
};
|
||||
|
||||
void *usync_data = NULL;
|
||||
|
||||
bool AuthoringUpdate()
|
||||
{
|
||||
SharedMemoryTool->IntroPosition = AuthoringGetIntroPosition();
|
||||
SharedMemoryTool->AudioRenderPosition = _4klang_current_tick * SAMPLES_PER_TICK;
|
||||
SetWindowPos(windowHandle, 0, SharedMemoryTool->WindowLeft, SharedMemoryTool->WindowTop, SharedMemoryTool->WindowWidth + 16, SharedMemoryTool->WindowHeight + 39, 0);
|
||||
|
||||
static ID3D11Buffer* empty[16];
|
||||
|
||||
context->CSSetConstantBuffers(0, 8, empty);
|
||||
context->VSSetConstantBuffers(0, 8, empty);
|
||||
context->GSSetConstantBuffers(0, 8, empty);
|
||||
context->HSSetConstantBuffers(0, 8, empty);
|
||||
context->DSSetConstantBuffers(0, 8, empty);
|
||||
context->PSSetConstantBuffers(0, 8, empty);
|
||||
|
||||
context->ResolveSubresource(resolvedTexture, 0, backBufferTexture, 0, analysisDesc.Format);
|
||||
context->CopyResource(stagingTexture, resolvedTexture);
|
||||
context->Map(stagingTexture, 0, D3D11_MAP_READ, 0, &mappedResource);
|
||||
memcpy(SharedImage, mappedResource.pData, 4 * SCREENWIDTH * SCREENHEIGHT);
|
||||
context->Unmap(stagingTexture, 0);
|
||||
|
||||
static ID3D11UnorderedAccessView* histogramUAVs[] =
|
||||
{
|
||||
backBufferUAV,
|
||||
histogramRedBucketUAV,
|
||||
histogramGreenBucketUAV,
|
||||
histogramBlueBucketUAV,
|
||||
histogramUAV,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
};
|
||||
|
||||
static ID3D11UnorderedAccessView* paradeVectorscopeUAVs[] =
|
||||
{
|
||||
backBufferUAV,
|
||||
paradeRedBucketUAV,
|
||||
paradeGreenBucketUAV,
|
||||
paradeBlueBucketUAV,
|
||||
paradeAlphaBucketUAV,
|
||||
vectorScopeBucketUAV,
|
||||
paradeUAV,
|
||||
vectorScopeUAV
|
||||
};
|
||||
|
||||
static UINT zero[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
|
||||
context->ClearUnorderedAccessViewUint(histogramRedBucketUAV, zero);
|
||||
context->ClearUnorderedAccessViewUint(histogramGreenBucketUAV, zero);
|
||||
context->ClearUnorderedAccessViewUint(histogramBlueBucketUAV, zero);
|
||||
context->ClearUnorderedAccessViewUint(vectorScopeBucketUAV, zero);
|
||||
context->ClearUnorderedAccessViewUint(paradeRedBucketUAV, zero);
|
||||
context->ClearUnorderedAccessViewUint(paradeGreenBucketUAV, zero);
|
||||
context->ClearUnorderedAccessViewUint(paradeBlueBucketUAV, zero);
|
||||
context->ClearUnorderedAccessViewUint(paradeAlphaBucketUAV, zero);
|
||||
|
||||
context->CSSetShaderResources(0, 1, &analysisSRV);
|
||||
|
||||
context->OMSetRenderTargets(1, (ID3D11RenderTargetView* const *)zero, NULL);
|
||||
context->CSSetUnorderedAccessViews(0, 8, histogramUAVs, NULL);
|
||||
context->CSSetShader(csHistogramGather, NULL, 0);
|
||||
context->Dispatch(SCREENWIDTH / 16, SCREENHEIGHT / 16, 1);
|
||||
context->CSSetShader(csHistogramMaximum, NULL, 0);
|
||||
context->Dispatch(16, 1, 1);
|
||||
context->CSSetShader(csHistogramSpread, NULL, 0);
|
||||
context->Dispatch(16, 1, 1);
|
||||
|
||||
context->CSSetUnorderedAccessViews(0, 8, paradeVectorscopeUAVs, NULL);
|
||||
context->CSSetShader(csParadeVectorscopeGather, NULL, 0);
|
||||
context->Dispatch(SCREENWIDTH / 16, SCREENHEIGHT / 16, 1);
|
||||
context->CSSetShader(csParadeVectorscopeMaximum, NULL, 0);
|
||||
context->Dispatch(16, 16, 1);
|
||||
context->CSSetShader(csParadeVectorscopeSpread, NULL, 0);
|
||||
context->Dispatch(16, 16, 1);
|
||||
|
||||
context->CSSetShaderResources(0, 1, (ID3D11ShaderResourceView* const*)zero);
|
||||
context->CSSetUnorderedAccessViews(0, 8, (ID3D11UnorderedAccessView* const *)zero, NULL);
|
||||
|
||||
context->CopyResource(histogramStagingTexture, histogramTexture);
|
||||
context->Map(histogramStagingTexture, 0, D3D11_MAP_READ, 0, &mappedResource);
|
||||
memcpy(histogram, mappedResource.pData, 4 * 4 * 256);
|
||||
context->Unmap(histogramStagingTexture, 0);
|
||||
|
||||
context->CopyResource(paradeStagingTexture, paradeTexture);
|
||||
context->Map(paradeStagingTexture, 0, D3D11_MAP_READ, 0, &mappedResource);
|
||||
memcpy(parade, mappedResource.pData, 4 * 256 * 256);
|
||||
context->Unmap(paradeStagingTexture, 0);
|
||||
|
||||
context->CopyResource(vectorScopeStagingTexture, vectorScopeTexture);
|
||||
context->Map(vectorScopeStagingTexture, 0, D3D11_MAP_READ, 0, &mappedResource);
|
||||
memcpy(vectorscope, mappedResource.pData, 4 * 256 * 256);
|
||||
context->Unmap(vectorScopeStagingTexture, 0);
|
||||
|
||||
if (::WaitForSingleObject(shaderCompileEvent, 0) == WAIT_OBJECT_0)
|
||||
{
|
||||
::Sleep(100);
|
||||
FrameworkShadersCompile();
|
||||
}
|
||||
|
||||
if (SharedMemoryTool->SeekToScene != -1)
|
||||
{
|
||||
auto scene = SharedMemoryTool->SeekToScene;
|
||||
SharedMemoryTool->SeekToScene = -1;
|
||||
SoundSeekToScene(NULL, scene);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void AuthoringDispose()
|
||||
{
|
||||
usync_export();
|
||||
|
||||
Log("AuthoringDispose");
|
||||
|
||||
UnmapViewOfFile(SharedMemoryTool);
|
||||
UnmapViewOfFile(soundBuffer);
|
||||
UnmapViewOfFile(SharedImage);
|
||||
UnmapViewOfFile(histogram);
|
||||
UnmapViewOfFile(parade);
|
||||
UnmapViewOfFile(vectorscope);
|
||||
|
||||
CloseHandle(SharedMemoryFileMapping);
|
||||
CloseHandle(AudioFileMapping);
|
||||
CloseHandle(ImageFileMapping);
|
||||
CloseHandle(HistogramFileMapping);
|
||||
CloseHandle(ParadeFileMapping);
|
||||
CloseHandle(VectorscopeFileMapping);
|
||||
|
||||
CloseHandle(SharedMemoryMutex);
|
||||
}
|
||||
91
hgplus/revision15-8k/src/intro/framework/directx.h
Normal file
91
hgplus/revision15-8k/src/intro/framework/directx.h
Normal file
@@ -0,0 +1,91 @@
|
||||
#pragma once
|
||||
|
||||
#include <d3d11.h>
|
||||
|
||||
//#define DEPTH_STENCIL
|
||||
|
||||
#ifndef RELEASE
|
||||
#define D3D_DEVICE_FLAGS D3D11_CREATE_DEVICE_DEBUG
|
||||
#else
|
||||
#define D3D_DEVICE_FLAGS 0
|
||||
#endif
|
||||
|
||||
#pragma bss_seg(".directxBss")
|
||||
static ID3D11Device* device;
|
||||
static ID3D11DeviceContext* context;
|
||||
static IDXGISwapChain* swapChain;
|
||||
static ID3D11Texture2D* backBufferTexture;
|
||||
static ID3D11UnorderedAccessView* backBufferUAV;
|
||||
static ID3D11RenderTargetView* backBufferRTV;
|
||||
|
||||
#ifdef DEPTH_STENCIL
|
||||
static ID3D11Texture2D* depthStencilBuffer;
|
||||
static ID3D11DepthStencilState* depthStencilState;
|
||||
static ID3D11DepthStencilView* depthStencilView;
|
||||
static ID3D11ShaderResourceView* depthStencilSRV;
|
||||
#endif
|
||||
|
||||
#pragma data_seg(".backBufferUAVdesc")
|
||||
static D3D11_UNORDERED_ACCESS_VIEW_DESC backBufferUAVdesc =
|
||||
{
|
||||
DXGI_FORMAT_R8G8B8A8_UNORM,
|
||||
D3D11_UAV_DIMENSION_TEXTURE2D,
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
#pragma data_seg(".backBufferRTVdesc")
|
||||
static D3D11_RENDER_TARGET_VIEW_DESC backBufferRTVdesc =
|
||||
{
|
||||
DXGI_FORMAT_R8G8B8A8_UNORM,
|
||||
D3D11_RTV_DIMENSION_TEXTURE2D,
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
#pragma data_seg(".directxFeatureLevel")
|
||||
static D3D_FEATURE_LEVEL featureLevel[] = { D3D_FEATURE_LEVEL_11_0 };
|
||||
|
||||
#pragma data_seg(".directxSwapChainDesc")
|
||||
static DXGI_SWAP_CHAIN_DESC swapChainDesc =
|
||||
{
|
||||
{
|
||||
SCREENWIDTH,
|
||||
SCREENHEIGHT,
|
||||
{
|
||||
0, 1
|
||||
},
|
||||
DXGI_FORMAT_R8G8B8A8_UNORM,
|
||||
DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED,
|
||||
DXGI_MODE_SCALING_UNSPECIFIED
|
||||
},
|
||||
{
|
||||
1, 0
|
||||
},
|
||||
DXGI_USAGE_RENDER_TARGET_OUTPUT | DXGI_USAGE_UNORDERED_ACCESS,
|
||||
1,
|
||||
0,
|
||||
WINDOWED,
|
||||
DXGI_SWAP_EFFECT_DISCARD,
|
||||
0
|
||||
};
|
||||
|
||||
#pragma data_seg(".swapChainViewport")
|
||||
static D3D11_VIEWPORT swapChainViewport =
|
||||
{
|
||||
0.0f,
|
||||
0.0f,
|
||||
SCREENWIDTH,
|
||||
SCREENHEIGHT,
|
||||
0.0f,
|
||||
1.0f,
|
||||
};
|
||||
|
||||
#pragma code_seg(".directxInit")
|
||||
INLINE void DirectXInit()
|
||||
{
|
||||
Log("DirectXInit");
|
||||
swapChainDesc.OutputWindow = windowHandle;
|
||||
CHECK(D3D11CreateDeviceAndSwapChain(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, D3D_DEVICE_FLAGS, featureLevel, 1, D3D11_SDK_VERSION, &swapChainDesc, &swapChain, &device, NULL, &context));
|
||||
CHECK(swapChain->GetBuffer(0, __uuidof(ID3D11Texture2D), (LPVOID*)&backBufferTexture));
|
||||
CHECK(device->CreateUnorderedAccessView(backBufferTexture, &backBufferUAVdesc, &backBufferUAV));
|
||||
CHECK(device->CreateRenderTargetView(backBufferTexture, &backBufferRTVdesc, &backBufferRTV));
|
||||
}
|
||||
128
hgplus/revision15-8k/src/intro/framework/framework.h
Normal file
128
hgplus/revision15-8k/src/intro/framework/framework.h
Normal file
@@ -0,0 +1,128 @@
|
||||
#pragma once
|
||||
|
||||
#ifndef _DEBUG
|
||||
#define INLINE __forceinline
|
||||
#else
|
||||
#define INLINE
|
||||
#endif
|
||||
|
||||
#define VC_EXTRALEAN
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <Windows.h>
|
||||
#include "log.h"
|
||||
#include "window.h"
|
||||
#include "directx.h"
|
||||
#include "4klang.h"
|
||||
#include "sound.h"
|
||||
#include "video.h"
|
||||
|
||||
#pragma bss_seg(".shadersbss")
|
||||
static void* shaderCode;
|
||||
static size_t shaderSize;
|
||||
|
||||
#ifdef AUTHORING
|
||||
bool CompileShader_Authoring(char* entryPoint, char* profile);
|
||||
#define CompileShader(entryPoint, profile) { if (!CompileShader_Authoring(entryPoint, profile)) return; }
|
||||
#else
|
||||
void CompileShader_Release(char* entryPoint, char* profile);
|
||||
#define CompileShader(entryPoint, profile) CompileShader_Release(entryPoint, profile)
|
||||
#endif
|
||||
|
||||
#include "sync/usync.h"
|
||||
#include "shaders_shc.h"
|
||||
|
||||
#pragma code_seg(".introforward")
|
||||
void IntroInit();
|
||||
void IntroUpdate(float _introPosition);
|
||||
|
||||
#ifdef AUTHORING
|
||||
#include "authoring.h"
|
||||
#endif
|
||||
|
||||
#include "shaders.h"
|
||||
|
||||
INLINE void FrameworkInit()
|
||||
{
|
||||
Log("FrameworkInit");
|
||||
WindowInit();
|
||||
DirectXInit();
|
||||
ShadersInit();
|
||||
SyncInit();
|
||||
|
||||
#ifdef AUTHORING
|
||||
AuthoringInit();
|
||||
#endif
|
||||
|
||||
FrameworkShadersCompile();
|
||||
IntroInit();
|
||||
SoundInit();
|
||||
|
||||
#ifdef AUTHORING
|
||||
SoundPause(NULL, (int)true);
|
||||
#endif
|
||||
|
||||
#ifdef VIDEO
|
||||
VideoInit();
|
||||
#endif
|
||||
}
|
||||
|
||||
INLINE float FrameworkGetIntroPosition()
|
||||
{
|
||||
#ifdef AUTHORING
|
||||
return AuthoringGetIntroPosition();
|
||||
#elif VIDEO
|
||||
return VideoGetPosition();
|
||||
#else
|
||||
return SoundGetIntroPosition();
|
||||
#endif
|
||||
}
|
||||
|
||||
INLINE void FrameworkUpdate()
|
||||
{
|
||||
#ifdef VIDEO
|
||||
float t = VideoGetPosition();
|
||||
#else
|
||||
float t = FrameworkGetIntroPosition();
|
||||
#endif
|
||||
|
||||
SyncUpdate(t);
|
||||
|
||||
#ifdef AUTHORING
|
||||
if (AuthoringUpdate())
|
||||
{
|
||||
IntroUpdate(t);
|
||||
}
|
||||
#else
|
||||
IntroUpdate(t);
|
||||
#endif
|
||||
|
||||
#ifdef VIDEO
|
||||
VideoUpdate();
|
||||
#endif
|
||||
}
|
||||
|
||||
INLINE void FrameworkDispose()
|
||||
{
|
||||
Log("FrameworkDispose");
|
||||
#ifdef AUTHORING
|
||||
AuthoringDispose();
|
||||
#endif
|
||||
|
||||
#ifdef VIDEO
|
||||
VideoDispose();
|
||||
#endif
|
||||
}
|
||||
|
||||
static const float introLength = (float)MAX_SAMPLES / (float)(SAMPLES_PER_TICK * SOUND_TICKS_PER_SCENE);
|
||||
|
||||
INLINE bool FrameworkContinueExecuting()
|
||||
{
|
||||
#ifndef AUTHORING
|
||||
if (FrameworkGetIntroPosition() >= introLength)
|
||||
return false;
|
||||
|
||||
return !GetAsyncKeyState(VK_ESCAPE);
|
||||
#else
|
||||
return SharedMemoryTool->KeepAlive;
|
||||
#endif
|
||||
}
|
||||
513
hgplus/revision15-8k/src/intro/framework/intro_hlsl.h
Normal file
513
hgplus/revision15-8k/src/intro/framework/intro_hlsl.h
Normal file
@@ -0,0 +1,513 @@
|
||||
/* File generated with Shader Minifier 1.1.3
|
||||
* http://www.ctrl-alt-test.fr
|
||||
*/
|
||||
#ifndef INTRO_HLSL_H_
|
||||
# define INTRO_HLSL_H_
|
||||
# define VAR_AP0 "l"
|
||||
# define VAR_AP1 "s"
|
||||
# define VAR_CIT0 "p"
|
||||
# define VAR_O2D0 "f"
|
||||
# define VAR_O2D1 "i"
|
||||
# define VAR_O2D2 "r"
|
||||
# define VAR_O2D3 "u"
|
||||
# define VAR_O3D2 "c"
|
||||
# define VAR_OITT0 "a"
|
||||
# define VAR_OITT1 "d"
|
||||
# define VAR_OITU0 "m"
|
||||
# define VAR_OITU1 "e"
|
||||
# define VAR_SAMPLERSTATE "x"
|
||||
# define VAR_T2D0 "t"
|
||||
# define VAR_T2D1 "o"
|
||||
# define VAR_T2D2 "S"
|
||||
# define VAR_T2D3 "n"
|
||||
|
||||
char merged_hlsl[] = "#define _ [numthreads(16,16,1)]\n"
|
||||
"struct CIT{float3 world;float3 local;int type;uint age;};struct CPT{float3 world:S1;float4 local:S2;int type:S3;uint age:S4;float4 pos:SV_POSITION;};struct OIT{half4 color;float depth;uint next;};struct ST{float4 cameraPosition;float4 cameraCenter;float4 cameraUp;float fade;float cubeLifetime;float transition;};RWTexture2D<float4> f:register(u0),i:register(u1),r:register(u2),u:register(u3);"
|
||||
"AppendStructuredBuffer<CIT> l:register(u0),s:register(u1);"
|
||||
"RWTexture3D<uint> c:register(u2);"
|
||||
"RWStructuredBuffer<OIT> m:register(u0);"
|
||||
"RWByteAddressBuffer e:register(u1);"
|
||||
"Texture2D t:register(t0),o:register(t1),S:register(t2),n:register(t3);"
|
||||
"StructuredBuffer<CIT> p:register(t0);"
|
||||
"StructuredBuffer<OIT> a:register(t0);"
|
||||
"Buffer<uint> d:register(t1);"
|
||||
"SamplerState x:register(s0);cbuffer _cb0:register(b0){float time;float screenWidth;float aspectRatio;float dummy;};cbuffer _cb1:register(b1){ST _s;};\n"
|
||||
"#define pi 3.141592\n"
|
||||
"float w(float f)"
|
||||
"{"
|
||||
"return frac(sin(f)*43758.545312);"
|
||||
"}"
|
||||
"float h(float2 f)"
|
||||
"{"
|
||||
"float2 l=floor(f),s=frac(f);"
|
||||
"s=s*s*(3-2*s);"
|
||||
"float y=l.x+l.y*157;"
|
||||
"return lerp(lerp(w(y),w(y+1),s.x),lerp(w(y+157),w(y+158),s.x),s.y);"
|
||||
"}"
|
||||
"float C(float3 f)"
|
||||
"{"
|
||||
"float3 s=floor(f),m=frac(f);"
|
||||
"m=m*m*(3-2*m);"
|
||||
"float y=s.x+s.y*157+113*s.z;"
|
||||
"return lerp(lerp(lerp(w(y),w(y+1),m.x),lerp(w(y+157),w(y+158),m.x),m.y),lerp(lerp(w(y+113),w(y+114),m.x),lerp(w(y+270),w(y+271),m.x),m.y),m.z);"
|
||||
"}"
|
||||
"float C(float2 f,float y)"
|
||||
"{"
|
||||
"float2x2 m={1.100000,.900000,-.900000,1.100000};"
|
||||
"float z=0;"
|
||||
"for(int i=1;i<8;++i)"
|
||||
"z+=h(f*y)/pow(2,i),f=mul(f,m);"
|
||||
"return z;"
|
||||
"}"
|
||||
"float2 h(float2 f,float y)"
|
||||
"{"
|
||||
"return cos(y)*f+sin(y)*float2(-f.y,f.x);"
|
||||
"}"
|
||||
"float4 w(float4 f,float4 y)"
|
||||
"{"
|
||||
"if(f.x<y.x)"
|
||||
"return f;"
|
||||
"return y;"
|
||||
"}"
|
||||
"float4 g(float4 f,float4 y)"
|
||||
"{"
|
||||
"if(f.x>y.x)"
|
||||
"return f;"
|
||||
"return y;"
|
||||
"}"
|
||||
"float4 g(float4 f)"
|
||||
"{"
|
||||
"return float4(-f.x,f.y,f.z,f.w);"
|
||||
"}"
|
||||
"float v(float3 f,float y)"
|
||||
"{"
|
||||
"return length(f)-y;"
|
||||
"}"
|
||||
"float C(float3 f,float3 x,float y)"
|
||||
"{"
|
||||
"float3 s=abs(f)-x;"
|
||||
"return min(max(s.x,max(s.y,s.z)),0)+length(max(s,0))-y;"
|
||||
"}"
|
||||
"float b(float3 f,float3 y)"
|
||||
"{"
|
||||
"return length(f.xz-y.xy)-y.z;"
|
||||
"}"
|
||||
"float b(float y,float x,float f)"
|
||||
"{"
|
||||
"return log(exp(f*y)+exp(f*x))/f;"
|
||||
"}"
|
||||
"float g(float y,float x,float f)"
|
||||
"{"
|
||||
"return-log(exp(-f*y)+exp(-f*x))/f;"
|
||||
"}"
|
||||
"float4x4 h(float3 f,float3 y,float3 x)"
|
||||
"{"
|
||||
"float3 z=normalize(cross(x,y)),m=cross(y,z);"
|
||||
"float4x4 i={z,-dot(z,f),m,-dot(m,f),y,-dot(y,f),0,0,0,1};"
|
||||
"return transpose(i);"
|
||||
"}"
|
||||
"float3 v(float f,float y,float z)"
|
||||
"{"
|
||||
"return lerp(1,saturate(abs(frac(f+float3(3,2,1)/3)*6-3)-1),y)*z;"
|
||||
"}"
|
||||
"_ "
|
||||
"void cs_texture(int3 y:SV_DispatchThreadID)"
|
||||
"{"
|
||||
"float2 x;"
|
||||
"f.GetDimensions(x.x,x.y);"
|
||||
"float2 s=float2(y.xy)/x,m=smoothstep(0,.100000,s)*smoothstep(-1,-.900000,-s);"
|
||||
"float z=smoothstep(1.400000,1.600000,m.x+m.y);"
|
||||
"float2 l=floor((s/.950000-.025000)*5)%2;"
|
||||
"float c=z*step(2,l.x+l.y)*.500000,e=(1-.100000*smoothstep(.300000,.900000,C(s,20)))*(1-distance(s,.500000))*.750000,o=(1-.200000*smoothstep(.400000,1.000000,C(s,40)))*(1-distance(s,.500000))*.250000,w=(1-.200000*smoothstep(.200000,.800000,C(s,10)))*(1-distance(s,.500000))*1.250000;"
|
||||
"f[y.xy]=float4(z,e,0,.050000);"
|
||||
"i[y.xy]=float4(z,o,0,.400000);"
|
||||
"r[y.xy]=float4(z,w,c,.100000);"
|
||||
"float2x2 p={.700000,-.700000,.700000,.700000};"
|
||||
"s=mul(s,p);"
|
||||
"s.x+=sin(s.y*222)*.002000;"
|
||||
"float d=pow(C(s,20)+.100000,8),D=max(0,.800000-pow(1.100000-C(s,25),8)),t=.500000;"
|
||||
"t=max(t,C(s,10)+.100000);"
|
||||
"t=min(t,C(s,15)+.200000);"
|
||||
"t=max(t,d);"
|
||||
"t=min(t,D);"
|
||||
"float v=pow(t*(1-d)*D,4);"
|
||||
"u[y.xy]=float4(t*.500000+.500000,v,0,1);"
|
||||
"}"
|
||||
"void I(int3 y,float2 i)"
|
||||
"{"
|
||||
"float2 s;"
|
||||
"f.GetDimensions(s.x,s.y);"
|
||||
"float2 m;"
|
||||
"t.GetDimensions(m.x,m.y);"
|
||||
"float z=log2(m.x/s.x);"
|
||||
"float2 c=(y.xy+.500000)/s,p=i/s;"
|
||||
"float4 l=0;"
|
||||
"for(float e=-150;e<=150;++e)"
|
||||
"{"
|
||||
"float d=exp(-e*e/5000);"
|
||||
"float4 h=t.SampleLevel(x,e*p+c,z);"
|
||||
"l+=h*d;"
|
||||
"}"
|
||||
"f[y.xy]=l/sqrt(5000*pi);"
|
||||
"}"
|
||||
"_ "
|
||||
"void cs_BlurH(int3 f:SV_DispatchThreadID)"
|
||||
"{"
|
||||
"I(f,float2(1,0));"
|
||||
"}"
|
||||
"_ "
|
||||
"void cs_BlurV(int3 f:SV_DispatchThreadID)"
|
||||
"{"
|
||||
"I(f,float2(0,1));"
|
||||
"}"
|
||||
"_ "
|
||||
"void cs_Merge(int3 s:SV_DispatchThreadID)"
|
||||
"{"
|
||||
"float2 y;"
|
||||
"f.GetDimensions(y.x,y.y);"
|
||||
"float2 z=(s.xy+.500000)/y;"
|
||||
"f[s.xy]=float4(t.SampleLevel(x,z,0).xyz+o.SampleLevel(x,z,0).xyz+S.SampleLevel(x,z,0).xyz*.750000+n.SampleLevel(x,z,0).xyz*.550000,1);"
|
||||
"}"
|
||||
"_ "
|
||||
"void cs_Transition(int3 s:SV_DispatchThreadID)"
|
||||
"{"
|
||||
"float2 y;"
|
||||
"f.GetDimensions(y.x,y.y);"
|
||||
"float2 z=(s.xy+.500000)/y;"
|
||||
"float c=1.100000-pow(length(z-.500000),2);"
|
||||
"float2 m=z;"
|
||||
"float l=8;"
|
||||
"m=float2(C(m+time,4),C(m.yx,4))-.500000;"
|
||||
"m=float2(C(m-time,6),C(m.yx,6))-.500000;"
|
||||
"m=float2(C(m,8),C(m.yx+time,8))-.500000;"
|
||||
"z+=m*_s.transition*C(m+time*2,8);"
|
||||
"float e=clamp(_s.transition,0,1),p=1-e;"
|
||||
"float3 i=lerp(t.SampleLevel(x,z,0).xyz,o.SampleLevel(x,z,0).xyz,saturate(.500000*length(z-.500000))),u=float3(i*p*p*p+o.SampleLevel(x,z,0).xyz*3*e*p*p+S.SampleLevel(x,z,0).xyz*3*e*e*p+n.SampleLevel(x,z,0).xyz*e*e*e);"
|
||||
"u=lerp(lerp(0,u,min(1,_s.fade*2)),1,max(0,(_s.fade-.500000)*2));"
|
||||
"f[s.xy]=float4(u*c,1);"
|
||||
"}"
|
||||
"void I(float2 f,out float3 z,out float3 y)"
|
||||
"{"
|
||||
"float2 x=(f*2-1)*float2(aspectRatio,-1);"
|
||||
"float3 m=normalize((_s.cameraCenter-_s.cameraPosition).xyz),s=normalize(_s.cameraUp).xyz;"
|
||||
"z=_s.cameraPosition.xyz;"
|
||||
"y=mul(transpose(float3x3(cross(s,m),s,-m)),normalize(float3(x,-1/tan(pi/6))));"
|
||||
"}\n"
|
||||
"#define sgn(X)((X)<0?-1:1)\n"
|
||||
"float I(float3 f)"
|
||||
"{"
|
||||
"float y=max(b(f,float3(0,0,.040000)),C(f,.250000,0));"
|
||||
"y=g(y,v(f+float3(0,.300000,0),.080000),48);"
|
||||
"y=g(y,v(f-float3(0,.300000,0),.080000),48);"
|
||||
"return y;"
|
||||
"}"
|
||||
"float4 V(float3 f,float y)"
|
||||
"{"
|
||||
"float s=(y+time*2)%1,z=sgn(y-.500000)*min(1,max(0,-.200000+5*s))*pi/2,m=min(1,max(0,2*sin(min(s-.020000,.500000)*10))),x=C(f,.400000,.075000),i=v(f-float3(0,.600000,0),.200000);"
|
||||
"x=b(x,-i,32);"
|
||||
"f.y-=m*.200000-.200000;"
|
||||
"float2 l=f.xz+.500000;"
|
||||
"f.xz=h(f.xz,z);"
|
||||
"i=max(b(f,float3(0,0,.050000)),C(f,.800000,0));"
|
||||
"float3 e=f;"
|
||||
"e*=1.250000;"
|
||||
"e.y-=1;"
|
||||
"e.yz=h(e.yz,pi/2);"
|
||||
"i=g(i,I(e),16);"
|
||||
"e.xy=h(e.xy,pi/2);"
|
||||
"i=g(i,I(e),16);"
|
||||
"return w(float4(x,0,l),float4(i,1,l));"
|
||||
"}"
|
||||
"float4 O(float3 f,float y)"
|
||||
"{"
|
||||
"float x=C(f,.425000,.050000);"
|
||||
"x=b(x,-C(f+float3(0,0,.300000),float3(.300000,1,.010000),0),32);"
|
||||
"x=b(x,-C(f-float3(0,0,.300000),float3(.300000,1,.010000),0),32);"
|
||||
"x=b(x,-C(f+float3(.300000,0,0),float3(.010000,1,.300000),0),32);"
|
||||
"x=b(x,-C(f-float3(.300000,0,0),float3(.010000,1,.300000),0),32);"
|
||||
"float s=(y+sgn(y-.500000)*time*2)%1,z=max(-1,min(1,4*cos(s*2*pi))),m=max(-1,min(1,4*sin(s*2*pi)));"
|
||||
"z*=.300000;"
|
||||
"m*=.300000;"
|
||||
"float3 i=f+float3(z,0,m);"
|
||||
"float t=C(i,float3(.030000,.750000,.030000),0);"
|
||||
"i.y-=.750000;"
|
||||
"t=g(t,v(i,.100000),32);"
|
||||
"return w(float4(x,2,f.xz+.500000),float4(t,3.000000,f.xz+.500000));"
|
||||
"}"
|
||||
"float4 H(float3 f,float y)"
|
||||
"{"
|
||||
"float x=C(f+float3(0,.100000,0),.425000,.050000);"
|
||||
"x=b(x,-C(f+float3(.200000,0,0),float3(.010000,.500000,.300000),0),32);"
|
||||
"x=b(x,-C(f-float3(.200000,0,0),float3(.010000,.500000,.300000),0),32);"
|
||||
"float z=pow((y+sgn(y-.500000)*time*2)%1.000000,2)*2*pi,m=max(-.500000,min(.500000,sin(z)));"
|
||||
"float2 s=f.xz+.500000;"
|
||||
"f.yz=h(f.yz,m);"
|
||||
"float3 i=f+float3(0,.300000,0);"
|
||||
"float e=C(i-float3(.200000,0,0),float3(.020000,1,.020000),0);"
|
||||
"e=min(e,C(i+float3(.200000,0,0),float3(.020000,1,.020000),0));"
|
||||
"e=min(e,C(i-float3(0,1,0),float3(.175000,.020000,.020000),0));"
|
||||
"e=g(e,v(i-float3(.200000,1.010000,0),.030000),32);"
|
||||
"e=g(e,v(i-float3(-.200000,1.010000,0),.030000),32);"
|
||||
"i.y-=1;"
|
||||
"i.xy=h(i.xy,pi/2);"
|
||||
"e=g(e*.750000,max(b(i,float3(0,0,.030000)),C(i,.100000,0)),32);"
|
||||
"return w(float4(x,4,s),float4(e,5,s));"
|
||||
"}"
|
||||
"float4 y(float3 f,float y)"
|
||||
"{"
|
||||
"float x=C(f,.400000,.080000);"
|
||||
"int2 i=int2(f.xz/.150000+floor(y*815));"
|
||||
"float m=h(float2(i));"
|
||||
"float3 s=f;"
|
||||
"s.xz=s.xz%.150000*sgn(s.xz);"
|
||||
"s.xz-=.075000;"
|
||||
"s.y-=.500000;"
|
||||
"float z=max(C(s,float3(.050000,1,.050000),0),C(f,float3(.300000,2,.300000),0));"
|
||||
"x=b(x,-z,96);"
|
||||
"float e=m*2*pi+time*32;"
|
||||
"s.y-=.100000*max(-.500000,min(.500000,sin(e)));"
|
||||
"s.y+=.500000;"
|
||||
"float t=C(s,float3(.025000,.600000,.025000),0);"
|
||||
"t=max(t,C(f,float3(.300000,2,.300000),0));"
|
||||
"return w(float4(x,6,f.xz+.500000),float4(t,7,f.xz+.500000));"
|
||||
"}"
|
||||
"float4 z(float3 f,float y)"
|
||||
"{"
|
||||
"float z=floor(y*4)*.500000*pi;"
|
||||
"float2 m=f.xz+.500000;"
|
||||
"f.xz=h(f.xz,z);"
|
||||
"float x=C(f,.400000,.080000);"
|
||||
"x=b(x,-C(f-float3(.200000,0,.100000),float3(.100000,1,.200000),0),32);"
|
||||
"x=b(x,-C(f+float3(.200000,0,-.100000),float3(.100000,1,.200000),0),32);"
|
||||
"float3 s=f-float3(0,.800000,-.300000);"
|
||||
"float i=C(s+float3(0,.200000,0),float3(0,.150000,0),.100000)/.600000;"
|
||||
"s/=.600000;"
|
||||
"s.yz=h(s.yz,pi/2);"
|
||||
"float e=y+.750000*time;"
|
||||
"z=.450000*max(-1,min(1,4*cos(e*2*pi)));"
|
||||
"float t=.500000+.500000*max(-1,min(1,4*sin(e*2*pi)));"
|
||||
"t=pow(t,1.250000+.750000*cos(e*2*pi));"
|
||||
"s.xy=h(s.xy,z);"
|
||||
"s.y+=.400000;"
|
||||
"i=g(i,I(s),16);"
|
||||
"s+=float3(0,.350000,.050000);"
|
||||
"i=min(i,C(s,float3(0,0,-.100000),.200000));"
|
||||
"float c=C(s+float3(0,0,1.200000-t),.100000,0);"
|
||||
"return w(w(float4(x,8,m),float4(i,9,m)),float4(c,10,m));"
|
||||
"}"
|
||||
"float4 H(float3 f,float x,float m)"
|
||||
"{"
|
||||
"const int s=6;"
|
||||
"int i=int(x*float(s));"
|
||||
"f.y-=m*.200000-.200000;"
|
||||
"if(i==1)"
|
||||
"return y(f,m);"
|
||||
"else"
|
||||
" if(i==2)"
|
||||
"return O(f,m);"
|
||||
"else"
|
||||
" if(i==3)"
|
||||
"return H(f,m);"
|
||||
"else"
|
||||
" if(i==4)"
|
||||
"return V(f,m);"
|
||||
"else"
|
||||
" if(i==5)"
|
||||
"return z(f,m);"
|
||||
"return float4(C(f,.400000,.025000),10,f.xz+.500000);"
|
||||
"}"
|
||||
"float4 H(float3 f)"
|
||||
"{"
|
||||
"int3 s=int3(f+1550);"
|
||||
"float x=h(s.xz*15.500000)*(floor(f.z)-15)/150;"
|
||||
"s=int3(f+42);"
|
||||
"float y=h(s.xz);"
|
||||
"float3 i=f;"
|
||||
"i.xz=i.xz%1.000000*sgn(i.xz);"
|
||||
"i-=.500000;"
|
||||
"return w(float4(C(i+float3(0,1.500000,0),.500000,0),x,0,0),H(i,x,y));"
|
||||
"}"
|
||||
"float3 O(int f)"
|
||||
"{"
|
||||
"return f>9?1:v(1-smoothstep(0,1,w(f+4)),.200000,1);"
|
||||
"}"
|
||||
"float T(float3 f,float3 y)"
|
||||
"{"
|
||||
"int z=10;"
|
||||
"float x=.200000,m=.750000,e=0,s=1,i=x;"
|
||||
"for(int t=0;t<z;t++)"
|
||||
"e+=(i-H(f+y*i).x)*s,i+=x,s/=2;"
|
||||
"return saturate(1-e*m);"
|
||||
"}"
|
||||
"void vs_cube(uint f:SV_VertexID,out float2 i:X,out float4 m:SV_POSITION)"
|
||||
"{"
|
||||
"i=float2(f*2&2,f&2),m=float4(i*float2(2,-2)+float2(-1,1),0,1);"
|
||||
"}"
|
||||
"float4 ps_cube(sample float2 f:X):SV_Target0"
|
||||
"{"
|
||||
"float3 y,s;"
|
||||
"I(f,y,s);"
|
||||
"float i=(2-y.y)/s.y;"
|
||||
"float3 z=float3(.700000,.800000,.900000);"
|
||||
"if(i<=0)"
|
||||
"return float4(z,1);"
|
||||
"int e=56;"
|
||||
"float m=i+50,l=.000100,p=1.200000,u=i,w=99999,r=i,o=0,c=0;"
|
||||
"float4 d=0;"
|
||||
"for(float D=0;D<e;++D)"
|
||||
"{"
|
||||
"float3 h=s*u+y;"
|
||||
"h.xz=h.xz%1.000000*sgn(h.xz);"
|
||||
"h-=.500000;"
|
||||
"d=H(s*u+y);"
|
||||
"float n=d.x*lerp(.600000,1.000000,saturate(i/50)),v=abs(n);"
|
||||
"bool a=p>1.000000&&v+o<c;"
|
||||
"if(a)"
|
||||
"c-=p*c,p=.700000;"
|
||||
"else"
|
||||
" c=n*p;"
|
||||
"o=v;"
|
||||
"float C=v/(u+i);"
|
||||
"if(!a&&C<w)"
|
||||
"r=u,w=C;"
|
||||
"if(!a&&C<l||u>m)"
|
||||
"break;"
|
||||
"u+=c;"
|
||||
"}"
|
||||
"u=r;"
|
||||
"float3 h=s*u+y;"
|
||||
"float2 n=float2(.001000,0);"
|
||||
"float3 v=normalize(float3(H(h+n.xyy).x-H(h-n.xyy).x,H(h+n.yxy).x-H(h-n.yxy).x,H(h+n.yyx).x-H(h-n.yyx).x));"
|
||||
"float a=T(h,v);"
|
||||
"float3 C=t.Sample(x,d.zw).xyz,X=normalize(float3(1,1,-1));"
|
||||
"float S=max(0,dot(v,X)),k=.500000*(a*pow(1-abs(dot(v,s)),4)),N=C.y*a*.500000*pow(max(0,dot(reflect(s,v),X)),32),b=.500000;"
|
||||
"float3 R=C.x*(b+S*(1-b+N))*O(int(d.y))+k;"
|
||||
"R*=a*clamp(h.y,0,1);"
|
||||
"R=lerp(clamp(R,0,1),z,smoothstep(0,50,u));"
|
||||
"return float4(R,1);"
|
||||
"}"
|
||||
"[numthreads(16,1,1)]"
|
||||
"void cs_cubeInstances(int3 f:SV_DispatchThreadID)"
|
||||
"{"
|
||||
"float m=0,x=floor(h(float2(f.x,m++))*128-64),y=floor(h(float2(f.x,m++))*128);"
|
||||
"CIT i;"
|
||||
"uint z=uint(1+uint(_s.cubeLifetime)*h(float2(f.x,m++)));"
|
||||
"float3 e=float3(x,.500000,y);"
|
||||
"i.type=uint(C(e*.564000)*3);"
|
||||
"i.local.x=C(128.564000*e);"
|
||||
"i.local.yz=float2(i.local.x,0);"
|
||||
"i.world=2*e;"
|
||||
"i.age=0;"
|
||||
"uint t=0;"
|
||||
"int d=10,u=4;"
|
||||
"for(uint r=0;r<min(50,z);++r)"
|
||||
"{"
|
||||
"InterlockedAdd(c[uint3(e+float3(128,-.500000,64))],1,t);"
|
||||
"if(--d==0)"
|
||||
"u=int(h(float2(f.x,m++))*6),d=2+int(h(float2(f.x,m++))*5);"
|
||||
"if(u==0)"
|
||||
"e.x+=1;"
|
||||
"if(u==1)"
|
||||
"e.x-=1;"
|
||||
"if(u==2)"
|
||||
"e.z+=1;"
|
||||
"if(u==3)"
|
||||
"e.z-=1;"
|
||||
"if(u>3)"
|
||||
"e.y+=1;"
|
||||
"if(t==0)"
|
||||
"l.Append(i),i.world.y*=-1,s.Append(i);"
|
||||
"i.age=r+1;"
|
||||
"i.local.x=C(128.564000*e);"
|
||||
"i.type=int(C(e*.564000)*3);"
|
||||
"i.world=2*e;"
|
||||
"}"
|
||||
"}"
|
||||
"void vs_cube2(uint f:SV_VertexID,uint y:SV_InstanceID,out CPT i)"
|
||||
"{"
|
||||
"float c[36]={0,1,2,0,2,3,4,5,6,4,6,7,1,6,5,1,5,2,3,4,7,3,7,0,3,2,5,3,5,4,7,6,1,7,1,0};"
|
||||
"float3 m[8]={float3(1,-1,1),float3(1,1,1),float3(-1,1,1),float3(-1,-1,1),float3(-1,-1,-1),float3(-1,1,-1),float3(1,1,-1),float3(1,-1,-1)};"
|
||||
"CIT s=p[y];"
|
||||
"uint x=f%36;"
|
||||
"float3 e=m[c[x]];"
|
||||
"i.local=float4((x<12?e.xy:x<24?e.xz:e.yz)*.500000+.500000,s.local.xy);"
|
||||
"i.world=s.world+.995000*e;"
|
||||
"i.type=s.type;"
|
||||
"i.age=s.age;"
|
||||
"i.pos=mul(mul(float4(i.world,1),h(_s.cameraPosition.xyz,normalize((_s.cameraCenter-_s.cameraPosition).xyz),normalize(_s.cameraUp.xyz))),float4x4(1,0,0,0,0,1.500000,0,0,0,0,1,1,0,0,-.500000,0));"
|
||||
"}"
|
||||
"void ps_cube2(CPT f,float4 s:SV_Position)"
|
||||
"{"
|
||||
"float4 i=f.type==0?t.Sample(x,f.local.xy):f.type==1?o.Sample(x,f.local.xy):S.Sample(x,f.local.xy);"
|
||||
"float y=.800000;"
|
||||
"uint z=uint((floor(time*16)+floor(f.local.w*8))%8);"
|
||||
"if(f.age%8==z)"
|
||||
"y*=5*(1-pow(time*16%1,2));"
|
||||
"float c=floor(smoothstep(0,1,f.local.z)*6)/6+.040000;"
|
||||
"float4 u=lerp(float4(i.www,1),float4(v(c,.900000,y),1)*i.y,i.x);"
|
||||
"u=lerp(u,float4(v(c,.400000,y*.500000),1.500000)*i.y,i.z);"
|
||||
"uint l=m.IncrementCounter();"
|
||||
"uint2 p=uint2(s.xy);"
|
||||
"uint d=screenWidth*p.y+p.x,n;"
|
||||
"e.InterlockedExchange(4*d,l,n);"
|
||||
"OIT r;"
|
||||
"r.color=u;"
|
||||
"r.depth=s.z;"
|
||||
"r.next=n;"
|
||||
"m[l]=r;"
|
||||
"}"
|
||||
"_ "
|
||||
"void cs_cube2(uint3 s:SV_DispatchThreadID)"
|
||||
"{"
|
||||
"float4 i=S[s.xy];"
|
||||
"uint y=screenWidth*s.y+s.x,x=d.Load(y);"
|
||||
"if(x==-1)"
|
||||
"{"
|
||||
"f[s.xy]=i;"
|
||||
"return;"
|
||||
"}"
|
||||
"static uint m[56];"
|
||||
"uint z=0;"
|
||||
"while(x!=-1)"
|
||||
"m[z++]=x,x=z>=56?-1:a[x].next;"
|
||||
"uint e=z;"
|
||||
"while(e>0)"
|
||||
"{"
|
||||
"uint l=0;"
|
||||
"for(uint t=1;t<e;++t)"
|
||||
"{"
|
||||
"uint c=m[t-1],u=m[t];"
|
||||
"if(a[c].depth<a[u].depth)"
|
||||
"m[t-1]=u,m[t]=c,l=t;"
|
||||
"}"
|
||||
"e=l;"
|
||||
"}"
|
||||
"float3 t=i.xyz;"
|
||||
"for(uint r=0;r<z;++r)"
|
||||
"{"
|
||||
"float4 l=a[m[r]].color;"
|
||||
"t=lerp(t.xyz,l.xyz,l.w);"
|
||||
"}"
|
||||
"f[s.xy]=float4(t,1);"
|
||||
"}"
|
||||
"_ "
|
||||
"void cs_water(int3 s:SV_DispatchThreadID)"
|
||||
"{"
|
||||
"float2 y;"
|
||||
"f.GetDimensions(y.x,y.y);"
|
||||
"float3 i,m;"
|
||||
"I((s.xy+.500000)/y,i,m);"
|
||||
"float z=-i.y/m.y;"
|
||||
"i+=m*z;"
|
||||
"z=1+z/50;"
|
||||
"float2 x=i.xz;"
|
||||
"x=float2(C(x+time*4,z),C(x.yx,z))-.500000;"
|
||||
"x=float2(C(x-time*4,z),C(x.yx,z))-.500000;"
|
||||
"x=float2(C(x,z),C(x.yx+time*4,z))-.500000;"
|
||||
"float4 l=t[s.xy+(x+.100000)*32];"
|
||||
"float3 e=lerp(float3(0,.050000,.100000),0,smoothstep(.100000,.300000,abs(m.y)));"
|
||||
"e*=1-.500000*smoothstep(0,.050000,-m.y);"
|
||||
"f[s.xy]=float4(lerp(e,l.xyz*.250000,l.w),1);"
|
||||
"}";
|
||||
|
||||
#endif // INTRO_HLSL_H_
|
||||
65
hgplus/revision15-8k/src/intro/framework/log.h
Normal file
65
hgplus/revision15-8k/src/intro/framework/log.h
Normal file
@@ -0,0 +1,65 @@
|
||||
#pragma once
|
||||
|
||||
#ifdef _DEBUG
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
void Log(char* _text, ...)
|
||||
{
|
||||
va_list args;
|
||||
va_start(args, _text);
|
||||
vprintf(_text, args);
|
||||
va_end(args);
|
||||
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
void Warn(char* _text)
|
||||
{
|
||||
HANDLE hstdout = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||
|
||||
CONSOLE_SCREEN_BUFFER_INFO csbi;
|
||||
GetConsoleScreenBufferInfo(hstdout, &csbi);
|
||||
|
||||
SetConsoleTextAttribute(hstdout, FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_INTENSITY);
|
||||
OutputDebugString("WARNING: ");
|
||||
OutputDebugString(_text);
|
||||
OutputDebugString("\n");
|
||||
Log(_text);
|
||||
|
||||
SetConsoleTextAttribute(hstdout, csbi.wAttributes);
|
||||
}
|
||||
|
||||
void Error(char* _text)
|
||||
{
|
||||
HANDLE hstdout = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||
|
||||
CONSOLE_SCREEN_BUFFER_INFO csbi;
|
||||
GetConsoleScreenBufferInfo(hstdout, &csbi);
|
||||
|
||||
SetConsoleTextAttribute(hstdout, FOREGROUND_RED | FOREGROUND_INTENSITY);
|
||||
OutputDebugString("ERROR: ");
|
||||
OutputDebugString(_text);
|
||||
OutputDebugString("\n");
|
||||
Log(_text);
|
||||
SetConsoleTextAttribute(hstdout, csbi.wAttributes);
|
||||
}
|
||||
|
||||
void CHECK(HRESULT _hResult)
|
||||
{
|
||||
if (_hResult != S_OK)
|
||||
{
|
||||
HLOCAL pBuffer;
|
||||
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, _hResult, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPSTR)&pBuffer, 512, NULL);
|
||||
Error((char*)pBuffer);
|
||||
DebugBreak();
|
||||
}
|
||||
}
|
||||
|
||||
#else
|
||||
#define Log(text)
|
||||
#define Warn(text)
|
||||
#define Error(text)
|
||||
#define CHECK(hresult) hresult
|
||||
#endif
|
||||
870
hgplus/revision15-8k/src/intro/framework/merged.hlsl
Normal file
870
hgplus/revision15-8k/src/intro/framework/merged.hlsl
Normal file
@@ -0,0 +1,870 @@
|
||||
struct CIT /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\structs.hlsl|1)*/
|
||||
{ /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\structs.hlsl|2)*/
|
||||
float3 world; /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\structs.hlsl|3)*/
|
||||
float3 local; /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\structs.hlsl|4)*/
|
||||
int type; /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\structs.hlsl|5)*/
|
||||
uint age; /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\structs.hlsl|6)*/
|
||||
}; /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\structs.hlsl|7)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\structs.hlsl|8)*/
|
||||
struct CPT /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\structs.hlsl|9)*/
|
||||
{ /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\structs.hlsl|10)*/
|
||||
float3 world : S1; /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\structs.hlsl|11)*/
|
||||
float4 local : S2; /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\structs.hlsl|12)*/
|
||||
int type : S3; /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\structs.hlsl|13)*/
|
||||
uint age : S4; /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\structs.hlsl|14)*/
|
||||
float4 pos : SV_POSITION; /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\structs.hlsl|15)*/
|
||||
}; /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\structs.hlsl|16)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\structs.hlsl|17)*/
|
||||
struct OIT /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\structs.hlsl|18)*/
|
||||
{ /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\structs.hlsl|19)*/
|
||||
half4 color; /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\structs.hlsl|20)*/
|
||||
float depth; /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\structs.hlsl|21)*/
|
||||
uint next; /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\structs.hlsl|22)*/
|
||||
}; /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\structs.hlsl|23)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\structs.hlsl|24)*/
|
||||
struct ST /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\structs.hlsl|25)*/
|
||||
{ /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\structs.hlsl|26)*/
|
||||
float4 cameraPosition; /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\structs.hlsl|27)*/
|
||||
float4 cameraCenter; /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\structs.hlsl|28)*/
|
||||
float4 cameraUp; /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\structs.hlsl|29)*/
|
||||
float fade; /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\structs.hlsl|30)*/
|
||||
float cubeLifetime; /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\structs.hlsl|31)*/
|
||||
float transition; /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\structs.hlsl|32)*/
|
||||
}; /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\structs.hlsl|33)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\intro.hlsl|2)*/
|
||||
RWTexture2D<float4> o2d0 : register(u0); /*(E:\alcatraz\revision15-8k\src\intro\shaders\intro.hlsl|3)*/
|
||||
RWTexture2D<float4> o2d1 : register(u1); /*(E:\alcatraz\revision15-8k\src\intro\shaders\intro.hlsl|4)*/
|
||||
RWTexture2D<float4> o2d2 : register(u2); /*(E:\alcatraz\revision15-8k\src\intro\shaders\intro.hlsl|5)*/
|
||||
RWTexture2D<float4> o2d3 : register(u3); /*(E:\alcatraz\revision15-8k\src\intro\shaders\intro.hlsl|6)*/
|
||||
AppendStructuredBuffer<CIT> ap0 : register(u0); /*(E:\alcatraz\revision15-8k\src\intro\shaders\intro.hlsl|7)*/
|
||||
AppendStructuredBuffer<CIT> ap1 : register(u1); /*(E:\alcatraz\revision15-8k\src\intro\shaders\intro.hlsl|8)*/
|
||||
RWTexture3D<uint> o3d2 : register(u2); /*(E:\alcatraz\revision15-8k\src\intro\shaders\intro.hlsl|9)*/
|
||||
RWStructuredBuffer<OIT> oitu0 : register(u0); /*(E:\alcatraz\revision15-8k\src\intro\shaders\intro.hlsl|10)*/
|
||||
RWByteAddressBuffer oitu1 : register(u1); /*(E:\alcatraz\revision15-8k\src\intro\shaders\intro.hlsl|11)*/
|
||||
Texture2D t2d0 : register(t0); /*(E:\alcatraz\revision15-8k\src\intro\shaders\intro.hlsl|12)*/
|
||||
Texture2D t2d1 : register(t1); /*(E:\alcatraz\revision15-8k\src\intro\shaders\intro.hlsl|13)*/
|
||||
Texture2D t2d2 : register(t2); /*(E:\alcatraz\revision15-8k\src\intro\shaders\intro.hlsl|14)*/
|
||||
Texture2D t2d3 : register(t3); /*(E:\alcatraz\revision15-8k\src\intro\shaders\intro.hlsl|15)*/
|
||||
StructuredBuffer<CIT> cit0 : register(t0); /*(E:\alcatraz\revision15-8k\src\intro\shaders\intro.hlsl|16)*/
|
||||
StructuredBuffer<OIT> oitt0 : register(t0); /*(E:\alcatraz\revision15-8k\src\intro\shaders\intro.hlsl|17)*/
|
||||
Buffer<uint> oitt1 : register(t1); /*(E:\alcatraz\revision15-8k\src\intro\shaders\intro.hlsl|18)*/
|
||||
SamplerState samplerState : register(s0); /*(E:\alcatraz\revision15-8k\src\intro\shaders\intro.hlsl|19)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\intro.hlsl|20)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\constants.hlsl|2)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\constants.hlsl|3)*/
|
||||
cbuffer _cb0 : register(b0) /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\constants.hlsl|4)*/
|
||||
{ /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\constants.hlsl|5)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\constants.hlsl|6)*/
|
||||
float time; /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\constants.hlsl|7)*/
|
||||
float screenWidth; /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\constants.hlsl|8)*/
|
||||
float aspectRatio; /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\constants.hlsl|9)*/
|
||||
float dummy; /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\constants.hlsl|10)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\constants.hlsl|11)*/
|
||||
} /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\constants.hlsl|12)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\constants.hlsl|13)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\constants.hlsl|14)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\constants.hlsl|15)*/
|
||||
cbuffer _cb1 : register(b1) /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\constants.hlsl|16)*/
|
||||
{ /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\constants.hlsl|17)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\constants.hlsl|18)*/
|
||||
ST _s; /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\constants.hlsl|19)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\constants.hlsl|20)*/
|
||||
} /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\constants.hlsl|21)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\constants.hlsl|22)*/
|
||||
#define pi 3.141592
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|2)*/
|
||||
float hash(float n) /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|3)*/
|
||||
{ /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|4)*/
|
||||
return frac(sin(n)*43758.5453123); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|5)*/
|
||||
} /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|6)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|7)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|8)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|9)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|10)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|11)*/
|
||||
float noise2(float2 x) /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|12)*/
|
||||
{ /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|13)*/
|
||||
float2 p = floor(x); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|14)*/
|
||||
float2 f = frac(x); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|15)*/
|
||||
f = f*f*(3 - 2*f); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|16)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|17)*/
|
||||
float n = p.x + p.y*157; /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|18)*/
|
||||
return lerp(lerp(hash(n), hash(n + 1), f.x), lerp(hash(n + 157), hash(n + 158), f.x), f.y); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|19)*/
|
||||
} /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|20)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|21)*/
|
||||
float noise3(float3 x) /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|22)*/
|
||||
{ /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|23)*/
|
||||
float3 p = floor(x); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|24)*/
|
||||
float3 f = frac(x); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|25)*/
|
||||
f = f*f*(3 - 2*f); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|26)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|27)*/
|
||||
float n = p.x + p.y*157 + 113*p.z; /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|28)*/
|
||||
return lerp( /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|29)*/
|
||||
lerp(lerp(hash(n), hash(n + 1), f.x), lerp(hash(n + 157), hash(n + 158), f.x), f.y), /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|30)*/
|
||||
lerp(lerp(hash(n + 113), hash(n + 114), f.x), lerp(hash(n + 270), hash(n + 271), f.x), f.y), f.z); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|31)*/
|
||||
} /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|32)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|33)*/
|
||||
float smoothnoise(float2 uv, float scale) /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|34)*/
|
||||
{ /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|35)*/
|
||||
float2x2 r = { 1.1, 0.9, -0.9, 1.1 }; /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|36)*/
|
||||
float n = 0; /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|37)*/
|
||||
for (int i = 1; i < 8; ++i) /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|38)*/
|
||||
{ /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|39)*/
|
||||
n += noise2(uv * scale) / pow(2, i); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|40)*/
|
||||
uv = mul(uv, r); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|41)*/
|
||||
} /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|42)*/
|
||||
return n; /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|43)*/
|
||||
} /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|44)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|45)*/
|
||||
float2 r(float2 v, float y) /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|46)*/
|
||||
{ /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|47)*/
|
||||
return cos(y)*v + sin(y)*float2(-v.y, v.x); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|48)*/
|
||||
} /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|49)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|50)*/
|
||||
float4 smin(float4 a, float4 b) /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|51)*/
|
||||
{ /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|52)*/
|
||||
if (a.x < b.x) /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|53)*/
|
||||
return a; /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|54)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|55)*/
|
||||
return b; /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|56)*/
|
||||
} /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|57)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|58)*/
|
||||
float4 smax(float4 a, float4 b) /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|59)*/
|
||||
{ /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|60)*/
|
||||
if (a.x > b.x) /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|61)*/
|
||||
return a; /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|62)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|63)*/
|
||||
return b; /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|64)*/
|
||||
} /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|65)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|66)*/
|
||||
float4 sinv(float4 a) /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|67)*/
|
||||
{ /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|68)*/
|
||||
return float4(-a.x, a.y, a.z, a.w); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|69)*/
|
||||
} /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|70)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|71)*/
|
||||
float sdSphere(float3 p, float s) /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|72)*/
|
||||
{ /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|73)*/
|
||||
return length(p) - s; /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|74)*/
|
||||
} /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|75)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|76)*/
|
||||
float sdBox(float3 p, float3 b, float r) /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|77)*/
|
||||
{ /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|78)*/
|
||||
float3 d = abs(p) - b; /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|79)*/
|
||||
return min(max(d.x, max(d.y, d.z)), 0) + /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|80)*/
|
||||
length(max(d, 0)) - r; /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|81)*/
|
||||
} /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|82)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|83)*/
|
||||
float sdCylinder(float3 p, float3 c) /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|84)*/
|
||||
{ /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|85)*/
|
||||
return length(p.xz - c.xy) - c.z; /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|86)*/
|
||||
} /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|87)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|88)*/
|
||||
float smoothmax(float a, float b, float k) /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|89)*/
|
||||
{ /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|90)*/
|
||||
return log(exp(k*a) + exp(k*b)) / k; /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|91)*/
|
||||
} /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|92)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|93)*/
|
||||
float smoothmin(float a, float b, float k) /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|94)*/
|
||||
{ /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|95)*/
|
||||
return -log(exp(-k*a) + exp(-k*b)) / k; /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|96)*/
|
||||
} /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|97)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|98)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|99)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|100)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|101)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|102)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|103)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|104)*/
|
||||
float4x4 lookTo(float3 Eye, float3 zaxis, float3 Up) /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|105)*/
|
||||
{ /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|106)*/
|
||||
float3 xaxis = normalize(cross(Up, zaxis)); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|107)*/
|
||||
float3 yaxis = cross(zaxis, xaxis); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|108)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|109)*/
|
||||
float4x4 result = { /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|110)*/
|
||||
xaxis, -dot(xaxis, Eye), /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|111)*/
|
||||
yaxis, -dot(yaxis, Eye), /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|112)*/
|
||||
zaxis, -dot(zaxis, Eye), /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|113)*/
|
||||
0, 0, 0, 1 /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|114)*/
|
||||
}; /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|115)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|116)*/
|
||||
return transpose(result); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|117)*/
|
||||
} /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|118)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|119)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|120)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|121)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|122)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|123)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|124)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|125)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|126)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|127)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|128)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|129)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|130)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|131)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|132)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|133)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|134)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|135)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|136)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|137)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|138)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|139)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|140)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|141)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|142)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|143)*/
|
||||
float3 hsv2rgb(float h, float s, float v) { /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|144)*/
|
||||
return lerp(1,saturate(abs(frac(h+float3(3,2,1)/3)*6-3)-1),s)*v; /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|145)*/
|
||||
} /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\functions.hlsl|146)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\intro.hlsl|23)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|1)*/
|
||||
[numthreads(16, 16, 1)] void cs_texture(int3 id:SV_DispatchThreadID) /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|2)*/
|
||||
{ /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|3)*/
|
||||
float2 s; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|4)*/
|
||||
o2d0.GetDimensions(s.x, s.y); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|5)*/
|
||||
float2 uv = float2(id.xy) / s; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|6)*/
|
||||
float2 r2 = smoothstep(0, 0.1, uv) * smoothstep(-1, -0.9, -uv); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|7)*/
|
||||
float rand = smoothstep(1.4, 1.6, r2.x + r2.y); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|8)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|9)*/
|
||||
float2 c = floor((uv / 0.95 - 0.025) * 5) % 2; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|10)*/
|
||||
float rand2 = rand * step(2, c.x + c.y) * 0.5; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|11)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|12)*/
|
||||
float i1 = (1 - 0.1 * smoothstep(0.3, 0.9, smoothnoise(uv, 20))) * (1 - distance(uv, 0.5)) * 0.75; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|13)*/
|
||||
float i2 = (1 - 0.2 * smoothstep(0.4, 1.0, smoothnoise(uv, 40))) * (1 - distance(uv, 0.5)) * 0.25; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|14)*/
|
||||
float i3 = (1 - 0.2 * smoothstep(0.2, 0.8, smoothnoise(uv, 10))) * (1 - distance(uv, 0.5)) * 1.25; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|15)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|16)*/
|
||||
o2d0[id.xy] = float4(rand, i1, 0, 0.05); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|17)*/
|
||||
o2d1[id.xy] = float4(rand, i2, 0, 0.4); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|18)*/
|
||||
o2d2[id.xy] = float4(rand, i3, rand2, 0.1); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|19)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|20)*/
|
||||
float2x2 r = { 0.7, -0.7, 0.7, 0.7 }; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|21)*/
|
||||
uv = mul(uv, r); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|22)*/
|
||||
uv.x += sin(uv.y*222)*0.002; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|23)*/
|
||||
float salt = pow(smoothnoise(uv, 20)+0.1,8); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|24)*/
|
||||
float pepper = max(0,0.8-pow(1.1-smoothnoise(uv, 25),8)); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|25)*/
|
||||
float diffuse = 0.5; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|26)*/
|
||||
diffuse = max(diffuse, smoothnoise(uv, 10)+0.1); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|27)*/
|
||||
diffuse = min(diffuse, smoothnoise(uv, 15)+0.2); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|28)*/
|
||||
diffuse = max(diffuse, salt); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|29)*/
|
||||
diffuse = min(diffuse, pepper); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|30)*/
|
||||
float spec = pow(diffuse * (1-salt) * pepper, 4); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|31)*/
|
||||
o2d3[id.xy] = float4(diffuse*0.5+0.5, spec, 0, 1); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|32)*/
|
||||
} /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|33)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|34)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|35)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|36)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|37)*/
|
||||
void bBlur(int3 id, float2 direction) /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|38)*/
|
||||
{ /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|39)*/
|
||||
float2 resolution; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|40)*/
|
||||
o2d0.GetDimensions(resolution.x, resolution.y); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|41)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|42)*/
|
||||
float2 sourceResolution; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|43)*/
|
||||
t2d0.GetDimensions(sourceResolution.x, sourceResolution.y); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|44)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|45)*/
|
||||
float mipLevel = log2(sourceResolution.x / resolution.x); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|46)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|47)*/
|
||||
float2 tc = (id.xy + 0.5) / resolution; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|48)*/
|
||||
float2 d = direction / resolution; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|49)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|50)*/
|
||||
float4 a = 0; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|51)*/
|
||||
for (float i = -150; i <= 150; ++i) /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|52)*/
|
||||
{ /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|53)*/
|
||||
float weight = exp(-i*i / 5000); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|54)*/
|
||||
float4 b = t2d0.SampleLevel(samplerState, i * d + tc, mipLevel); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|55)*/
|
||||
a += b * weight; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|56)*/
|
||||
} /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|57)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|58)*/
|
||||
o2d0[id.xy] = a / sqrt(5000 * pi); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|59)*/
|
||||
} /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|60)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|61)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|62)*/
|
||||
[numthreads(16, 16, 1)] void cs_BlurH(int3 id:SV_DispatchThreadID) /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|63)*/
|
||||
{ /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|64)*/
|
||||
bBlur(id, float2(1,0)); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|65)*/
|
||||
} /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|66)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|67)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|68)*/
|
||||
[numthreads(16, 16, 1)] void cs_BlurV(int3 id:SV_DispatchThreadID) /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|69)*/
|
||||
{ /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|70)*/
|
||||
bBlur(id, float2(0, 1)); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|71)*/
|
||||
} /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|72)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|73)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|74)*/
|
||||
[numthreads(16, 16, 1)] void cs_Merge(int3 id:SV_DispatchThreadID) /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|75)*/
|
||||
{ /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|76)*/
|
||||
float2 resolution; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|77)*/
|
||||
o2d0.GetDimensions(resolution.x, resolution.y); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|78)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|79)*/
|
||||
float2 tc = (id.xy + 0.5) / resolution; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|80)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|81)*/
|
||||
o2d0[id.xy] = float4( /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|82)*/
|
||||
t2d0.SampleLevel(samplerState, tc, 0).xyz + /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|83)*/
|
||||
t2d1.SampleLevel(samplerState, tc, 0).xyz + /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|84)*/
|
||||
t2d2.SampleLevel(samplerState, tc, 0).xyz * 0.75 + /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|85)*/
|
||||
t2d3.SampleLevel(samplerState, tc, 0).xyz * 0.55, 1); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|86)*/
|
||||
} /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|87)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|88)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|89)*/
|
||||
[numthreads(16, 16, 1)] void cs_Transition(int3 id:SV_DispatchThreadID) /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|90)*/
|
||||
{ /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|91)*/
|
||||
float2 resolution; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|92)*/
|
||||
o2d0.GetDimensions(resolution.x, resolution.y); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|93)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|94)*/
|
||||
float2 tc = (id.xy + 0.5) / resolution; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|95)*/
|
||||
float vignette = 1.1 - pow(length(tc - 0.5),2); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|96)*/
|
||||
float2 n = tc; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|97)*/
|
||||
float s = 8; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|98)*/
|
||||
n = float2(smoothnoise(n + time, 4), smoothnoise(n.yx, 4))-0.5; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|99)*/
|
||||
n = float2(smoothnoise(n - time, 6), smoothnoise(n.yx, 6))-0.5; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|100)*/
|
||||
n = float2(smoothnoise(n, 8), smoothnoise(n.yx + time, 8))-0.5; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|101)*/
|
||||
tc += n * _s.transition * smoothnoise(n + time * 2, 8); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|102)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|103)*/
|
||||
float x = clamp(_s.transition, 0, 1); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|104)*/
|
||||
float y = 1 - x; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|105)*/
|
||||
float3 tex0 = /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|106)*/
|
||||
lerp( /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|107)*/
|
||||
t2d0.SampleLevel(samplerState, tc, 0).xyz, /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|108)*/
|
||||
t2d1.SampleLevel(samplerState, tc, 0).xyz, saturate(0.5 * length(tc - 0.5))); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|109)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|110)*/
|
||||
float3 color = float3( /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|111)*/
|
||||
tex0 * y*y*y + /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|112)*/
|
||||
t2d1.SampleLevel(samplerState, tc, 0).xyz * 3*x*y*y + /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|113)*/
|
||||
t2d2.SampleLevel(samplerState, tc, 0).xyz * 3*x*x*y + /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|114)*/
|
||||
t2d3.SampleLevel(samplerState, tc, 0).xyz * x*x*x); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|115)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|116)*/
|
||||
color = lerp(lerp(0, color, min(1, _s.fade * 2)), 1, max(0, (_s.fade - 0.5) * 2)); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|117)*/
|
||||
o2d0[id.xy] = float4(color * vignette, 1); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|118)*/
|
||||
} /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|119)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|120)*/
|
||||
void camera(float2 tc, out float3 p, out float3 q) /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|121)*/
|
||||
{ /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|122)*/
|
||||
float2 sc = (tc * 2 - 1) * float2(aspectRatio, -1); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|123)*/
|
||||
float3 viewDirection = normalize((_s.cameraCenter - _s.cameraPosition).xyz); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|124)*/
|
||||
float3 viewUp = normalize(_s.cameraUp).xyz; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|125)*/
|
||||
p = _s.cameraPosition.xyz; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|126)*/
|
||||
q = mul( /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|127)*/
|
||||
transpose(float3x3(cross(viewUp, viewDirection), viewUp, -viewDirection)), /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|128)*/
|
||||
normalize(float3(sc, -1 / tan(pi / 6)))); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|129)*/
|
||||
} /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\shared.hlsl|130)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|3)*/
|
||||
#define sgn(X) ((X)<0?-1:1)
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|5)*/
|
||||
float cylsphere(float3 p) /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|6)*/
|
||||
{ /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|7)*/
|
||||
float d = max(sdCylinder(p, float3(0, 0, 0.04)), sdBox(p, 0.25, 0)); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|8)*/
|
||||
d = smoothmin(d, sdSphere(p + float3(0, 0.3, 0), 0.08), 48); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|9)*/
|
||||
d = smoothmin(d, sdSphere(p - float3(0, 0.3, 0), 0.08), 48); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|10)*/
|
||||
return d; /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|11)*/
|
||||
} /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|12)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|13)*/
|
||||
float4 wasserhahn(float3 p, float phase) /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|14)*/
|
||||
{ /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|15)*/
|
||||
float t = (phase + time * 2) % 1; /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|16)*/
|
||||
float rotation = sgn(phase - 0.5) * min(1, max(0, -0.2 + 5 * t)) * pi / 2; /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|17)*/
|
||||
float translation = min(1, max(0, 2 * sin(min(t - 0.02, 0.5) * 10))); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|18)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|19)*/
|
||||
float d = sdBox(p, 0.4, 0.075); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|20)*/
|
||||
float e = sdSphere(p - float3(0, 0.6, 0), 0.2); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|21)*/
|
||||
d = smoothmax(d, -e, 32); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|22)*/
|
||||
p.y -= translation * 0.2 - 0.2; /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|23)*/
|
||||
float2 uv = p.xz+0.5; /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|24)*/
|
||||
p.xz = r(p.xz, rotation); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|25)*/
|
||||
e = max(sdCylinder(p, float3(0, 0, 0.05)), sdBox(p, 0.8, 0)); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|26)*/
|
||||
float3 q = p; /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|27)*/
|
||||
q *= 1.25; /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|28)*/
|
||||
q.y -= 1; /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|29)*/
|
||||
q.yz = r(q.yz, pi / 2); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|30)*/
|
||||
e = smoothmin(e, cylsphere(q), 16); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|31)*/
|
||||
q.xy = r(q.xy, pi / 2); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|32)*/
|
||||
e = smoothmin(e, cylsphere(q), 16); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|33)*/
|
||||
return smin(float4(d, 0, uv), float4(e, 1, uv)); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|34)*/
|
||||
} /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|35)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|36)*/
|
||||
float4 kupplung(float3 p, float phase) /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|37)*/
|
||||
{ /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|38)*/
|
||||
float d = sdBox(p, 0.425, 0.05); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|39)*/
|
||||
d = smoothmax(d, -sdBox(p + float3(0, 0, 0.3), float3(0.3, 1, 0.01), 0), 32); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|40)*/
|
||||
d = smoothmax(d, -sdBox(p - float3(0, 0, 0.3), float3(0.3, 1, 0.01), 0), 32); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|41)*/
|
||||
d = smoothmax(d, -sdBox(p + float3(0.3, 0, 0), float3(0.01, 1, 0.3), 0), 32); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|42)*/
|
||||
d = smoothmax(d, -sdBox(p - float3(0.3, 0, 0), float3(0.01, 1, 0.3), 0), 32); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|43)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|44)*/
|
||||
float t = (phase + sgn(phase - 0.5) * time * 2) % 1; /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|45)*/
|
||||
float x = max(-1, min(1, 4*cos(t*2*pi))); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|46)*/
|
||||
float y = max(-1, min(1, 4*sin(t*2*pi))); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|47)*/
|
||||
x *= 0.3; /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|48)*/
|
||||
y *= 0.3; /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|49)*/
|
||||
float3 q = p + float3(x, 0, y); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|50)*/
|
||||
float e = sdBox(q, float3(0.03, 0.75, 0.03), 0); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|51)*/
|
||||
q.y -= 0.75; /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|52)*/
|
||||
e = smoothmin(e, sdSphere(q, 0.1), 32); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|53)*/
|
||||
return smin(float4(d, 2, p.xz+0.5), float4(e, 3.0, p.xz+0.5)); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|54)*/
|
||||
} /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|55)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|56)*/
|
||||
float4 hebel(float3 p, float phase) /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|57)*/
|
||||
{ /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|58)*/
|
||||
float d = sdBox(p + float3(0, 0.1, 0), 0.425, 0.05); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|59)*/
|
||||
d = smoothmax(d, -sdBox(p + float3(0.2, 0, 0), float3(0.01, 0.5, 0.3), 0), 32); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|60)*/
|
||||
d = smoothmax(d, -sdBox(p - float3(0.2, 0, 0), float3(0.01, 0.5, 0.3), 0), 32); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|61)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|62)*/
|
||||
float x = pow((phase + sgn(phase - 0.5) * time * 2) % 1.0, 2) * 2 * pi; /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|63)*/
|
||||
float t = max(-0.5, min(0.5, sin(x))); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|64)*/
|
||||
float2 uv = p.xz+0.5; /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|65)*/
|
||||
p.yz = r(p.yz, t); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|66)*/
|
||||
float3 q = p + float3(0, 0.3, 0); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|67)*/
|
||||
float e = sdBox(q - float3(0.2, 0, 0), float3(0.02, 1, 0.02), 0); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|68)*/
|
||||
e = min(e, sdBox(q + float3(0.2, 0, 0), float3(0.02, 1, 0.02), 0)); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|69)*/
|
||||
e = min(e, sdBox(q - float3(0, 1, 0), float3(0.175, 0.02, 0.02), 0)); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|70)*/
|
||||
e = smoothmin(e, sdSphere(q - float3(0.2, 1.01, 0), 0.03), 32); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|71)*/
|
||||
e = smoothmin(e, sdSphere(q - float3(-0.2, 1.01, 0), 0.03), 32); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|72)*/
|
||||
q.y -= 1; /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|73)*/
|
||||
q.xy = r(q.xy, pi / 2); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|74)*/
|
||||
e = smoothmin(e*0.75, max(sdCylinder(q, float3(0, 0, 0.03)), sdBox(q, 0.1, 0)), 32); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|75)*/
|
||||
return smin(float4(d, 4, uv), float4(e, 5, uv)); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|76)*/
|
||||
} /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|77)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|78)*/
|
||||
float4 igel(float3 p, float phase) /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|79)*/
|
||||
{ /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|80)*/
|
||||
float d = sdBox(p, 0.4, 0.08); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|81)*/
|
||||
int2 i = int2(p.xz / 0.15 + floor(phase * 815)); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|82)*/
|
||||
float phase2 = noise2(float2(i)); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|83)*/
|
||||
float3 q = p; /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|84)*/
|
||||
q.xz = (q.xz % 0.15) * sgn(q.xz); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|85)*/
|
||||
q.xz -= 0.075; /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|86)*/
|
||||
q.y -= 0.5; /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|87)*/
|
||||
float hole = max(sdBox(q, float3(0.05, 1, 0.05), 0), sdBox(p, float3(0.3, 2, 0.3), 0)); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|88)*/
|
||||
d = smoothmax(d, -hole, 96); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|89)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|90)*/
|
||||
float t = phase2 * 2 * pi + time * 32; /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|91)*/
|
||||
q.y -= 0.1 * max(-0.5, min(0.5, sin(t))); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|92)*/
|
||||
q.y += 0.5; /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|93)*/
|
||||
float e = sdBox(q, float3(0.025, 0.6, 0.025), 0); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|94)*/
|
||||
e = max(e, sdBox(p, float3(0.3, 2, 0.3), 0)); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|95)*/
|
||||
return smin(float4(d, 6, p.xz+0.5), float4(e, 7, p.xz+0.5)); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|96)*/
|
||||
} /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|97)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|98)*/
|
||||
float4 kran(float3 p, float phase) /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|99)*/
|
||||
{ /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|100)*/
|
||||
float angle = floor(phase * 4) * 0.5 * pi; /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|101)*/
|
||||
float2 uv = p.xz+0.5; /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|102)*/
|
||||
p.xz = r(p.xz, angle); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|103)*/
|
||||
float d = sdBox(p, 0.4, 0.08); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|104)*/
|
||||
d = smoothmax(d, -sdBox(p - float3(0.2, 0, 0.1), float3(0.1, 1, 0.2), 0), 32); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|105)*/
|
||||
d = smoothmax(d, -sdBox(p + float3(0.2, 0, -0.1), float3(0.1, 1, 0.2), 0), 32); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|106)*/
|
||||
float3 q = p - float3(0, 0.8, -0.3); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|107)*/
|
||||
float e = sdBox(q + float3(0, 0.2, 0), float3(0, 0.15, 0), 0.1) / 0.6; /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|108)*/
|
||||
q /= 0.6; /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|109)*/
|
||||
q.yz = r(q.yz, pi / 2); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|110)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|111)*/
|
||||
float t = phase + 0.75 * time; /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|112)*/
|
||||
angle = 0.45 * max(-1, min(1, 4*cos(t*2*pi))); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|113)*/
|
||||
float y = 0.5 + 0.5 * max(-1, min(1, 4*sin(t*2*pi))); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|114)*/
|
||||
y = pow(y, 1.25 + 0.75 * cos(t*2*pi)); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|115)*/
|
||||
q.xy = r(q.xy, angle); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|116)*/
|
||||
q.y += 0.4; /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|117)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|118)*/
|
||||
e = smoothmin(e, cylsphere(q), 16); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|119)*/
|
||||
q += float3(0, 0.35, 0.05); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|120)*/
|
||||
e = min(e, sdBox(q, float3(0, 0, -0.1), 0.2)); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|121)*/
|
||||
float f = sdBox(q + float3(0, 0, 1.2 - y), 0.1, 0); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|122)*/
|
||||
return smin(smin(float4(d, 8, uv), float4(e, 9, uv)), float4(f, 10, uv)); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|123)*/
|
||||
} /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|124)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|125)*/
|
||||
float4 greeble(float3 p, float findex, float phase) /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|126)*/
|
||||
{ /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|127)*/
|
||||
const int indexCount = 6; /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|128)*/
|
||||
int index = int(findex * float(indexCount)); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|129)*/
|
||||
p.y -= phase * 0.2 - 0.2; /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|130)*/
|
||||
if (index == 1) /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|131)*/
|
||||
return igel(p, phase); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|132)*/
|
||||
else if (index == 2) /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|133)*/
|
||||
return kupplung(p, phase); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|134)*/
|
||||
else if (index == 3) /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|135)*/
|
||||
return hebel(p, phase); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|136)*/
|
||||
else if (index == 4) /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|137)*/
|
||||
return wasserhahn(p, phase); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|138)*/
|
||||
else if (index == 5) /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|139)*/
|
||||
return kran(p, phase); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|140)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|141)*/
|
||||
return float4(sdBox(p, 0.4, 0.025), 10, p.xz+0.5); /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|142)*/
|
||||
} /*(E:\alcatraz\revision15-8k\src\intro\shaders\lib\greeble.hlsl|143)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|2)*/
|
||||
float4 f(float3 p) /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|3)*/
|
||||
{ /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|4)*/
|
||||
int3 h = int3(p + 1550); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|5)*/
|
||||
float hash = noise2(h.xz * 15.50) * (floor(p.z)-15) / 150; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|6)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|7)*/
|
||||
h = int3(p + 42); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|8)*/
|
||||
float phase = noise2(h.xz); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|9)*/
|
||||
float3 q = p; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|10)*/
|
||||
q.xz = (q.xz % 1.0) * sgn(q.xz); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|11)*/
|
||||
q -= 0.5; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|12)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|13)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|14)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|15)*/
|
||||
return smin( /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|16)*/
|
||||
float4(sdBox(q + float3(0,1.5,0), 0.5, 0), hash, 0, 0), /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|17)*/
|
||||
greeble(q, hash, phase)); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|18)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|19)*/
|
||||
} /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|20)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|21)*/
|
||||
float3 colorize(int index) /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|22)*/
|
||||
{ /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|23)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|24)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|25)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|26)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|27)*/
|
||||
return index > 9 ? 1 : hsv2rgb(1-smoothstep(0,1,hash(index+4)), 0.2, 1); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|28)*/
|
||||
} /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|29)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|30)*/
|
||||
float ao(float3 v, float3 n) /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|31)*/
|
||||
{ /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|32)*/
|
||||
int ao_iterations = 10; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|33)*/
|
||||
float ao_step = 0.2; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|34)*/
|
||||
float ao_scale = 0.75; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|35)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|36)*/
|
||||
float sum = 0; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|37)*/
|
||||
float att = 1; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|38)*/
|
||||
float len = ao_step; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|39)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|40)*/
|
||||
for (int i = 0; i < ao_iterations; i++) /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|41)*/
|
||||
{ /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|42)*/
|
||||
sum += (len - f(v + n * len).x) * att; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|43)*/
|
||||
len += ao_step; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|44)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|45)*/
|
||||
att /= 2; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|46)*/
|
||||
} /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|47)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|48)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|49)*/
|
||||
return saturate(1 - sum*ao_scale); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|50)*/
|
||||
} /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|51)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|52)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|53)*/
|
||||
void vs_cube(uint id : SV_VertexID, out float2 t : X, out float4 p : SV_POSITION) /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|54)*/
|
||||
{ /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|55)*/
|
||||
t = float2((id * 2) & 2, id & 2); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|56)*/
|
||||
p = float4(t * float2(2, -2) + float2(-1, 1), 0, 1); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|57)*/
|
||||
} /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|58)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|59)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|60)*/
|
||||
float4 ps_cube(sample float2 tex : X) : SV_Target0 /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|61)*/
|
||||
{ /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|62)*/
|
||||
float3 p, q; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|63)*/
|
||||
camera(tex, p, q); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|64)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|65)*/
|
||||
float t_min = ((2-p.y)/q.y); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|66)*/
|
||||
float3 fog = float3(0.7, 0.8, 0.9); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|67)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|68)*/
|
||||
if (t_min <= 0) /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|69)*/
|
||||
return float4(fog, 1); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|70)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|71)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|72)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|73)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|74)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|75)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|76)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|77)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|78)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|79)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|80)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|81)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|82)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|83)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|84)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|85)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|86)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|87)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|88)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|89)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|90)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|91)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|92)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|93)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|94)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|95)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|96)*/
|
||||
int maxSteps = 56; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|97)*/
|
||||
float t_max = t_min + 50; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|98)*/
|
||||
float pixelRadius = 0.0001; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|99)*/
|
||||
float omega = 1.2; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|100)*/
|
||||
float t = t_min; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|101)*/
|
||||
float candidate_error = 99999; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|102)*/
|
||||
float candidate_t = t_min; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|103)*/
|
||||
float previousRadius = 0; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|104)*/
|
||||
float stepLength = 0; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|105)*/
|
||||
float4 d = 0; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|106)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|107)*/
|
||||
for (float i = 0; i < maxSteps; ++i) /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|108)*/
|
||||
{ /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|109)*/
|
||||
float3 tmp = q*t+p; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|110)*/
|
||||
tmp.xz = (tmp.xz % 1.0) * sgn(tmp.xz); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|111)*/
|
||||
tmp -= 0.5; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|112)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|113)*/
|
||||
d = f(q*t + p); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|114)*/
|
||||
float signedRadius = d.x * lerp(0.6, 1.0, saturate(t_min / 50)); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|115)*/
|
||||
float radius = abs(signedRadius); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|116)*/
|
||||
bool sorFail = omega > 1.0 && (radius + previousRadius) < stepLength; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|117)*/
|
||||
if (sorFail) /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|118)*/
|
||||
{ /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|119)*/
|
||||
stepLength -= omega * stepLength; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|120)*/
|
||||
omega = 0.7; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|121)*/
|
||||
} /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|122)*/
|
||||
else /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|123)*/
|
||||
{ /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|124)*/
|
||||
stepLength = signedRadius * omega; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|125)*/
|
||||
} /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|126)*/
|
||||
previousRadius = radius; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|127)*/
|
||||
float error = radius / (t + t_min); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|128)*/
|
||||
if (!sorFail && error < candidate_error) /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|129)*/
|
||||
{ /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|130)*/
|
||||
candidate_t = t; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|131)*/
|
||||
candidate_error = error; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|132)*/
|
||||
} /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|133)*/
|
||||
if (!sorFail && error < pixelRadius || t > t_max) /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|134)*/
|
||||
break; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|135)*/
|
||||
t += stepLength; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|136)*/
|
||||
} /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|137)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|138)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|139)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|140)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|141)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|142)*/
|
||||
t = candidate_t; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|143)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|144)*/
|
||||
float3 hit = q*t + p; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|145)*/
|
||||
float2 e = float2(0.001, 0); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|146)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|147)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|148)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|149)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|150)*/
|
||||
float3 normal = normalize(float3( /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|151)*/
|
||||
f(hit + e.xyy).x - f(hit - e.xyy).x, /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|152)*/
|
||||
f(hit + e.yxy).x - f(hit - e.yxy).x, /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|153)*/
|
||||
f(hit + e.yyx).x - f(hit - e.yyx).x)); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|154)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|155)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|156)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|157)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|158)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|159)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|160)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|161)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|162)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|163)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|164)*/
|
||||
float fao = ao(hit, normal); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|165)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|166)*/
|
||||
float3 map = t2d0.Sample(samplerState, d.zw).xyz; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|167)*/
|
||||
float3 ldir = normalize(float3(1, 1, -1)); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|168)*/
|
||||
float diffuse = max(0, dot(normal, ldir)); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|169)*/
|
||||
float rim = 0.5 * (fao * pow(1 - abs(dot(normal, q)), 4)); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|170)*/
|
||||
float specular = map.y * fao * 0.5 * pow(max(0, dot(reflect(q, normal), ldir)), 32); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|171)*/
|
||||
float ambient = 0.5; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|172)*/
|
||||
float3 color = map.x * (ambient + diffuse * ((1 - ambient) + specular)) * colorize(int(d.y)) + rim; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|173)*/
|
||||
color *= fao * clamp(hit.y, 0, 1); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|174)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|175)*/
|
||||
color = lerp(clamp(color, 0, 1), fog, smoothstep(0, 50, t)); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|176)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|177)*/
|
||||
return float4(color, 1); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|178)*/
|
||||
} /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part1.hlsl|179)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|1)*/
|
||||
[numthreads(16, 1, 1)] void cs_cubeInstances(int3 id:SV_DispatchThreadID) /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|2)*/
|
||||
{ /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|3)*/
|
||||
float seed = 0; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|4)*/
|
||||
float x = floor(noise2(float2(id.x, seed++)) * 128 - 64); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|5)*/
|
||||
float z = floor(noise2(float2(id.x, seed++)) * 128); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|6)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|7)*/
|
||||
CIT output; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|8)*/
|
||||
uint lifetime = uint(1 + uint(_s.cubeLifetime) * noise2(float2(id.x, seed++))); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|9)*/
|
||||
float3 position = float3(x, 0.5, z); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|10)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|11)*/
|
||||
output.type = uint(noise3(position * 0.564) * 3); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|12)*/
|
||||
output.local.x = noise3(128.564 * position); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|13)*/
|
||||
output.local.yz = float2(output.local.x, 0); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|14)*/
|
||||
output.world = 2 * position; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|15)*/
|
||||
output.age = 0; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|16)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|17)*/
|
||||
uint count = 0; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|18)*/
|
||||
int pathLength = 10; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|19)*/
|
||||
int rnd = 4; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|20)*/
|
||||
for (uint i = 0; i < min(50, lifetime); ++i) /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|21)*/
|
||||
{ /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|22)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|23)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|24)*/
|
||||
InterlockedAdd(o3d2[uint3(position + float3(128,-0.5,64))], 1, count); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|25)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|26)*/
|
||||
if (--pathLength == 0) /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|27)*/
|
||||
{ /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|28)*/
|
||||
rnd = int(noise2(float2(id.x, seed++)) * 6); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|29)*/
|
||||
pathLength = 2 + int(noise2(float2(id.x, seed++)) * 5); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|30)*/
|
||||
} /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|31)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|32)*/
|
||||
if (rnd == 0) position.x += 1; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|33)*/
|
||||
if (rnd == 1) position.x -= 1; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|34)*/
|
||||
if (rnd == 2) position.z += 1; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|35)*/
|
||||
if (rnd == 3) position.z -= 1; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|36)*/
|
||||
if (rnd > 3) position.y += 1; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|37)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|38)*/
|
||||
if (count == 0) /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|39)*/
|
||||
{ /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|40)*/
|
||||
ap0.Append(output); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|41)*/
|
||||
output.world.y *= -1; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|42)*/
|
||||
ap1.Append(output); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|43)*/
|
||||
} /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|44)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|45)*/
|
||||
output.age = i + 1; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|46)*/
|
||||
output.local.x = noise3(128.564 * position); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|47)*/
|
||||
output.type = int(noise3(position * 0.564) * 3); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|48)*/
|
||||
output.world = 2 * position; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|49)*/
|
||||
} /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|50)*/
|
||||
} /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|51)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|52)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|53)*/
|
||||
void vs_cube2(uint id : SV_VertexID, uint instanceID : SV_InstanceID, out CPT o) /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|54)*/
|
||||
{ /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|55)*/
|
||||
float indices[36] = /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|56)*/
|
||||
{ /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|57)*/
|
||||
0, 1, 2, 0, 2, 3, /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|58)*/
|
||||
4, 5, 6, 4, 6, 7, /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|59)*/
|
||||
1, 6, 5, 1, 5, 2, /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|60)*/
|
||||
3, 4, 7, 3, 7, 0, /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|61)*/
|
||||
3, 2, 5, 3, 5, 4, /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|62)*/
|
||||
7, 6, 1, 7, 1, 0 /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|63)*/
|
||||
}; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|64)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|65)*/
|
||||
float3 vertices[8] = /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|66)*/
|
||||
{ /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|67)*/
|
||||
float3(1, -1, 1), /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|68)*/
|
||||
float3(1, 1, 1), /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|69)*/
|
||||
float3(-1, 1, 1), /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|70)*/
|
||||
float3(-1, -1, 1), /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|71)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|72)*/
|
||||
float3(-1, -1, -1), /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|73)*/
|
||||
float3(-1, 1, -1), /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|74)*/
|
||||
float3(1, 1, -1), /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|75)*/
|
||||
float3(1, -1, -1) /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|76)*/
|
||||
}; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|77)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|78)*/
|
||||
CIT input = cit0[instanceID]; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|79)*/
|
||||
uint index = id % 36; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|80)*/
|
||||
float3 vertex = vertices[indices[index]]; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|81)*/
|
||||
o.local = float4(( /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|82)*/
|
||||
index < 12 ? vertex.xy : /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|83)*/
|
||||
index < 24 ? vertex.xz : /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|84)*/
|
||||
vertex.yz /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|85)*/
|
||||
) * 0.5 + 0.5, input.local.xy); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|86)*/
|
||||
o.world = input.world + 0.995 * vertex; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|87)*/
|
||||
o.type = input.type; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|88)*/
|
||||
o.age = input.age; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|89)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|90)*/
|
||||
o.pos = mul(mul( /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|91)*/
|
||||
float4(o.world, 1), /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|92)*/
|
||||
lookTo(_s.cameraPosition.xyz, normalize((_s.cameraCenter - _s.cameraPosition).xyz), normalize(_s.cameraUp.xyz))), /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|93)*/
|
||||
float4x4( /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|94)*/
|
||||
1, 0, 0, 0, /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|95)*/
|
||||
0, 1.5, 0, 0, /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|96)*/
|
||||
0, 0, 1, 1, /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|97)*/
|
||||
0, 0, -0.5, 0 /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|98)*/
|
||||
)); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|99)*/
|
||||
} /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|100)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|101)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|102)*/
|
||||
void ps_cube2(CPT input, float4 screen : SV_Position) /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|103)*/
|
||||
{ /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|104)*/
|
||||
float4 texData = input.type == 0 ? t2d0.Sample(samplerState, input.local.xy) : (input.type == 1 ? t2d1.Sample(samplerState, input.local.xy) : t2d2.Sample(samplerState, input.local.xy)); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|105)*/
|
||||
float intensityBoost = 0.8; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|106)*/
|
||||
uint idx = uint((floor(time * 16) + floor(input.local.w*8)) % 8); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|107)*/
|
||||
if ((input.age % 8) == idx) /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|108)*/
|
||||
{ /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|109)*/
|
||||
intensityBoost *= 5 * (1 - pow((time * 16) % 1, 2)); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|110)*/
|
||||
} /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|111)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|112)*/
|
||||
float hue = floor(smoothstep(0, 1, input.local.z)*6)/6 + 0.04; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|113)*/
|
||||
float4 color = lerp(float4(texData.www, 1), float4(hsv2rgb(hue, 0.9, intensityBoost), 1) * texData.y, texData.x); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|114)*/
|
||||
color = lerp(color, float4(hsv2rgb(hue, 0.4, intensityBoost * 0.5), 1.5) * texData.y, texData.z); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|115)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|116)*/
|
||||
uint uPixelCount = oitu0.IncrementCounter(); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|117)*/
|
||||
uint2 vPos = uint2(screen.xy); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|118)*/
|
||||
uint uStartOffsetAddress = (screenWidth*vPos.y) + vPos.x; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|119)*/
|
||||
uint uOldStartOffset; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|120)*/
|
||||
oitu1.InterlockedExchange(4 * uStartOffsetAddress, uPixelCount, uOldStartOffset); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|121)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|122)*/
|
||||
OIT e; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|123)*/
|
||||
e.color = color; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|124)*/
|
||||
e.depth = screen.z; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|125)*/
|
||||
e.next = uOldStartOffset; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|126)*/
|
||||
oitu0[uPixelCount] = e; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|127)*/
|
||||
} /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|128)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|129)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|130)*/
|
||||
[numthreads(16, 16, 1)] void cs_cube2(uint3 vPos: SV_DispatchThreadID) /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|131)*/
|
||||
{ /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|132)*/
|
||||
float4 tex = t2d2[vPos.xy]; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|133)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|134)*/
|
||||
uint uStartOffsetAddress = (screenWidth*vPos.y) + vPos.x; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|135)*/
|
||||
uint uOffset = oitt1.Load(uStartOffsetAddress); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|136)*/
|
||||
if (uOffset == -1) /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|137)*/
|
||||
{ /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|138)*/
|
||||
o2d0[vPos.xy] = tex; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|139)*/
|
||||
return; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|140)*/
|
||||
} /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|141)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|142)*/
|
||||
static uint addr[56]; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|143)*/
|
||||
uint nNumPixels = 0; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|144)*/
|
||||
while (uOffset != -1) /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|145)*/
|
||||
{ /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|146)*/
|
||||
addr[nNumPixels++] = uOffset; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|147)*/
|
||||
uOffset = (nNumPixels >= 56) ? -1 : oitt0[uOffset].next; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|148)*/
|
||||
} /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|149)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|150)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|151)*/
|
||||
uint n = nNumPixels; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|152)*/
|
||||
while (n > 0) /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|153)*/
|
||||
{ /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|154)*/
|
||||
uint newn = 0; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|155)*/
|
||||
for (uint i = 1; i < n; ++i) /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|156)*/
|
||||
{ /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|157)*/
|
||||
uint a = addr[i - 1]; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|158)*/
|
||||
uint b = addr[i]; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|159)*/
|
||||
if (oitt0[a].depth < oitt0[b].depth) /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|160)*/
|
||||
{ /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|161)*/
|
||||
addr[i - 1] = b; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|162)*/
|
||||
addr[i] = a; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|163)*/
|
||||
newn = i; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|164)*/
|
||||
} /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|165)*/
|
||||
} /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|166)*/
|
||||
n = newn; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|167)*/
|
||||
} /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|168)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|169)*/
|
||||
float3 vCurrentColor = tex.xyz; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|170)*/
|
||||
for (uint k = 0; k < nNumPixels; ++k) /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|171)*/
|
||||
{ /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|172)*/
|
||||
float4 color = oitt0[addr[k]].color; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|173)*/
|
||||
vCurrentColor = lerp(vCurrentColor.xyz, color.xyz, color.w); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|174)*/
|
||||
} /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|175)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|176)*/
|
||||
o2d0[vPos.xy] = float4(vCurrentColor, 1); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|177)*/
|
||||
} /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|178)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|179)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|180)*/
|
||||
[numthreads(16, 16, 1)] void cs_water(int3 id:SV_DispatchThreadID) /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|181)*/
|
||||
{ /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|182)*/
|
||||
float2 resolution; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|183)*/
|
||||
o2d0.GetDimensions(resolution.x, resolution.y); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|184)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|185)*/
|
||||
float3 p, q; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|186)*/
|
||||
camera((id.xy + 0.5) / resolution, p, q); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|187)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|188)*/
|
||||
float t_min = -p.y / q.y; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|189)*/
|
||||
p += q * t_min; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|190)*/
|
||||
t_min = 1 + t_min / 50; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|191)*/
|
||||
float2 n = p.xz; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|192)*/
|
||||
n = float2(smoothnoise(n + time*4, t_min), smoothnoise(n.yx, t_min)) - 0.5; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|193)*/
|
||||
n = float2(smoothnoise(n - time*4, t_min), smoothnoise(n.yx, t_min)) - 0.5; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|194)*/
|
||||
n = float2(smoothnoise(n, t_min), smoothnoise(n.yx + time*4, t_min)) - 0.5; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|195)*/
|
||||
/*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|196)*/
|
||||
float4 t = t2d0[id.xy + (n + 0.1) * 32]; /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|197)*/
|
||||
float3 sky = lerp(float3(0, 0.05, 0.1), 0, smoothstep(0.1, 0.3, abs(q.y))); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|198)*/
|
||||
sky *= 1 - 0.5 * smoothstep(0, 0.05, -q.y); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|199)*/
|
||||
o2d0[id.xy] = float4(lerp(sky, t.xyz * 0.25, t.w), 1); /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|200)*/
|
||||
} /*(E:\alcatraz\revision15-8k\src\intro\shaders\parts\part2.hlsl|201)*/
|
||||
22
hgplus/revision15-8k/src/intro/framework/mutexlock.h
Normal file
22
hgplus/revision15-8k/src/intro/framework/mutexlock.h
Normal file
@@ -0,0 +1,22 @@
|
||||
#pragma once
|
||||
|
||||
#ifdef AUTHORING
|
||||
struct MutexLock
|
||||
{
|
||||
public:
|
||||
MutexLock(const char* _mutexName)
|
||||
{
|
||||
m_MutexHandle = CreateMutex(NULL, FALSE, _mutexName);
|
||||
while (WaitForSingleObject(m_MutexHandle, 500) != WAIT_OBJECT_0)
|
||||
::Sleep(1);
|
||||
}
|
||||
|
||||
virtual ~MutexLock()
|
||||
{
|
||||
CloseHandle(m_MutexHandle);
|
||||
}
|
||||
|
||||
private:
|
||||
HANDLE m_MutexHandle;
|
||||
};
|
||||
#endif
|
||||
2128
hgplus/revision15-8k/src/intro/framework/patterns.dbg
Normal file
2128
hgplus/revision15-8k/src/intro/framework/patterns.dbg
Normal file
File diff suppressed because it is too large
Load Diff
139
hgplus/revision15-8k/src/intro/framework/shaders.h
Normal file
139
hgplus/revision15-8k/src/intro/framework/shaders.h
Normal file
@@ -0,0 +1,139 @@
|
||||
#pragma once
|
||||
|
||||
#include <d3dcompiler.h>
|
||||
|
||||
#pragma bss_seg(".shadersbss")
|
||||
static ID3DBlob* shaderBlob;
|
||||
static ID3DBlob* errorBlob;
|
||||
static pD3DCompile d3dCompile;
|
||||
|
||||
#pragma data_seg(".d3dcompiler")
|
||||
static char d3dcompiler[] = "d3dcompiler_47.dll";
|
||||
|
||||
#pragma data_seg(".minifiedShader")
|
||||
#include "intro_hlsl.h"
|
||||
|
||||
#ifdef AUTHORING
|
||||
|
||||
#include <process.h>
|
||||
#include <io.h>
|
||||
#include <stdio.h>
|
||||
|
||||
static char g_sMonitoredShaderPath[MAX_PATH];
|
||||
static __time64_t shaderChangedDate;
|
||||
|
||||
DWORD WINAPI filemon(void* args)
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
_finddata_t fdata;
|
||||
long hfile = _findfirst(g_sMonitoredShaderPath, &fdata);
|
||||
if (hfile != -1)
|
||||
{
|
||||
if (fdata.time_write != shaderChangedDate)
|
||||
{
|
||||
shaderChangedDate = fdata.time_write;
|
||||
::SetEvent(shaderCompileEvent);
|
||||
}
|
||||
_findclose(hfile);
|
||||
}
|
||||
::Sleep(100);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
INLINE void ShadersInit()
|
||||
{
|
||||
HINSTANCE hl = LoadLibrary(d3dcompiler);
|
||||
if (!hl)
|
||||
{
|
||||
d3dcompiler[13] = '3';
|
||||
hl = LoadLibrary(d3dcompiler);
|
||||
}
|
||||
d3dCompile = (pD3DCompile)GetProcAddress(hl, "D3DCompile");
|
||||
|
||||
#ifdef AUTHORING
|
||||
static char exePath[MAX_PATH];
|
||||
GetModuleFileName(NULL, exePath, MAX_PATH);
|
||||
PathRemoveFileSpec(exePath);
|
||||
PathCombine(g_sMonitoredShaderPath, exePath, "..\\src\\intro\\framework\\merged.hlsl");
|
||||
|
||||
_finddata_t fdata;
|
||||
long hfile = _findfirst(g_sMonitoredShaderPath, &fdata);
|
||||
if (hfile != -1)
|
||||
{
|
||||
shaderChangedDate = fdata.time_write;
|
||||
_findclose(hfile);
|
||||
}
|
||||
|
||||
shaderCompileEvent = ::CreateEvent(NULL, FALSE, FALSE, TEXT("WriteEvent"));
|
||||
SetThreadPriority((HANDLE)CreateThread(0, 0, &filemon, 0, 0, 0), THREAD_PRIORITY_BELOW_NORMAL);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef AUTHORING
|
||||
#pragma code_seg(".CompileShaderA")
|
||||
bool CompileShader_Authoring(char* entryPoint, char* profile)
|
||||
{
|
||||
ReadFile((char*)g_sMonitoredShaderPath, (char**)&shaderCode, &shaderSize);
|
||||
d3dCompile(shaderCode, shaderSize, g_sMonitoredShaderPath, NULL, NULL, entryPoint, profile, D3DCOMPILE_DEBUG, 0, &shaderBlob, &errorBlob);
|
||||
if (errorBlob != NULL)
|
||||
{
|
||||
auto error = (char*)errorBlob->GetBufferPointer();
|
||||
if (shaderBlob != NULL)
|
||||
{
|
||||
Warn(error);
|
||||
}
|
||||
else
|
||||
{
|
||||
Error(error);
|
||||
}
|
||||
|
||||
DWORD cbSize = strlen(error);
|
||||
DWORD cbWritten = 0;
|
||||
|
||||
WriteFile(
|
||||
hShaderErrorPipe, // pipe handle
|
||||
&cbSize, // message
|
||||
sizeof(DWORD), // message length
|
||||
&cbWritten, // bytes written
|
||||
NULL); // not overlapped
|
||||
|
||||
WriteFile(
|
||||
hShaderErrorPipe, // pipe handle
|
||||
error, // message
|
||||
cbSize, // message length
|
||||
&cbWritten, // bytes written
|
||||
NULL); // not overlapped
|
||||
|
||||
if (shaderBlob == NULL)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
shaderSize = shaderBlob->GetBufferSize();
|
||||
shaderCode = shaderBlob->GetBufferPointer();
|
||||
return true;
|
||||
};
|
||||
#endif
|
||||
|
||||
#pragma code_seg(".CompileShaderR")
|
||||
void CompileShader_Release(char* entryPoint, char* profile)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
d3dCompile(merged_hlsl, sizeof(merged_hlsl), NULL, NULL, NULL, entryPoint, profile, 0, 0, &shaderBlob, &errorBlob);
|
||||
if (errorBlob != NULL)
|
||||
{
|
||||
auto error = errorBlob->GetBufferPointer();
|
||||
Error((char*)error);
|
||||
}
|
||||
#else
|
||||
d3dCompile(merged_hlsl, sizeof(merged_hlsl), NULL, NULL, NULL, entryPoint, profile, 0, 0, &shaderBlob, 0);
|
||||
#endif
|
||||
|
||||
shaderSize = shaderBlob->GetBufferSize();
|
||||
shaderCode = shaderBlob->GetBufferPointer();
|
||||
};
|
||||
@@ -0,0 +1,15 @@
|
||||
Texture2D<float4> in0 : register(u0);
|
||||
RWTexture1D<uint> histogramBucketR : register(u1);
|
||||
RWTexture1D<uint> histogramBucketG : register(u2);
|
||||
RWTexture1D<uint> histogramBucketB : register(u3);
|
||||
RWTexture1D<float4> histogramOut : register(u4);
|
||||
|
||||
[numthreads(16, 16, 1)]
|
||||
void main(uint3 id : SV_DispatchThreadID)
|
||||
{
|
||||
int3 iPixel = in0[id.xy].rgb * 255.0f;
|
||||
|
||||
InterlockedAdd(histogramBucketR[iPixel.r], 1);
|
||||
InterlockedAdd(histogramBucketG[iPixel.g], 1);
|
||||
InterlockedAdd(histogramBucketB[iPixel.b], 1);
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
Texture2D<float4> in0 : register(u0);
|
||||
RWTexture1D<uint> histogramBucketR : register(u1);
|
||||
RWTexture1D<uint> histogramBucketG : register(u2);
|
||||
RWTexture1D<uint> histogramBucketB : register(u3);
|
||||
RWTexture1D<float4> histogramOut : register(u4);
|
||||
|
||||
[numthreads(16, 1, 1)]
|
||||
void main(uint3 id : SV_DispatchThreadID)
|
||||
{
|
||||
InterlockedMax(histogramBucketR[256], histogramBucketR[id.x]);
|
||||
InterlockedMax(histogramBucketG[256], histogramBucketG[id.x]);
|
||||
InterlockedMax(histogramBucketB[256], histogramBucketB[id.x]);
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
Texture2D<float4> in0 : register(u0);
|
||||
RWTexture1D<uint> histogramBucketR : register(u1);
|
||||
RWTexture1D<uint> histogramBucketG : register(u2);
|
||||
RWTexture1D<uint> histogramBucketB : register(u3);
|
||||
RWTexture1D<float4> histogramOut : register(u4);
|
||||
|
||||
[numthreads(16, 1, 1)]
|
||||
void main(uint3 id : SV_DispatchThreadID)
|
||||
{
|
||||
histogramOut[id.x] = float4(
|
||||
log(1.0 + histogramBucketR[id.x]) / log(1.0 + histogramBucketR[256]),
|
||||
log(1.0 + histogramBucketG[id.x]) / log(1.0 + histogramBucketG[256]),
|
||||
log(1.0 + histogramBucketB[id.x]) / log(1.0 + histogramBucketB[256]), 0.0f);
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
Texture2D<float4> in0 : register(u0);
|
||||
RWTexture2D<uint> paradeBucketR : register(u1);
|
||||
RWTexture2D<uint> paradeBucketG : register(u2);
|
||||
RWTexture2D<uint> paradeBucketB : register(u3);
|
||||
RWTexture2D<uint> paradeBucketA : register(u4);
|
||||
RWTexture2D<uint> vectorScopeBucket : register(u5);
|
||||
RWTexture2D<uint4> paradeOut : register(u6);
|
||||
RWTexture2D<uint4> vectorScopeOut : register(u7);
|
||||
|
||||
[numthreads(16, 16, 1)]
|
||||
void main(uint3 id : SV_DispatchThreadID)
|
||||
{
|
||||
float3 pixel = in0[id.xy].rgb;
|
||||
int3 iPixel = pixel * 255.0f;
|
||||
float luminance = dot(pixel, float3(0.2126f, 0.7152f, 0.0722f));
|
||||
float2 f = float2(0.492f, 0.877f) * (pixel.br - luminance);
|
||||
int2 uv = min(255, max(0, 128 * (1 + f / float2(0.436f, 0.615f))));
|
||||
|
||||
float2 resolution;
|
||||
in0.GetDimensions(resolution.x, resolution.y);
|
||||
int paradeCoord = (id.x * 255.0f) / resolution.x;
|
||||
|
||||
InterlockedAdd(paradeBucketR[int2(paradeCoord, 255 - iPixel.r)], 1);
|
||||
InterlockedAdd(paradeBucketG[int2(paradeCoord, 255 - iPixel.g)], 1);
|
||||
InterlockedAdd(paradeBucketB[int2(paradeCoord, 255 - iPixel.b)], 1);
|
||||
InterlockedAdd(paradeBucketA[int2(paradeCoord, 255 - (uint)(255.0f * luminance))], 1);
|
||||
InterlockedAdd(vectorScopeBucket[uv], 1);
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
Texture2D<float4> in0 : register(u0);
|
||||
RWTexture2D<uint> paradeBucketR : register(u1);
|
||||
RWTexture2D<uint> paradeBucketG : register(u2);
|
||||
RWTexture2D<uint> paradeBucketB : register(u3);
|
||||
RWTexture2D<uint> paradeBucketA : register(u4);
|
||||
RWTexture2D<uint> vectorScopeBucket : register(u5);
|
||||
RWTexture2D<uint4> paradeOut : register(u6);
|
||||
RWTexture2D<uint4> vectorScopeOut : register(u7);
|
||||
|
||||
[numthreads(16, 16, 1)]
|
||||
void main(uint3 id : SV_DispatchThreadID)
|
||||
{
|
||||
InterlockedMax(paradeBucketR[uint2(256, 0)], paradeBucketR[id.xy]);
|
||||
InterlockedMax(paradeBucketG[uint2(256, 0)], paradeBucketG[id.xy]);
|
||||
InterlockedMax(paradeBucketB[uint2(256, 0)], paradeBucketB[id.xy]);
|
||||
InterlockedMax(paradeBucketA[uint2(256, 0)], paradeBucketA[id.xy]);
|
||||
InterlockedMax(vectorScopeBucket[uint2(256, 0)], vectorScopeBucket[id.xy]);
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
Texture2D<float4> in0 : register(u0);
|
||||
RWTexture2D<uint> paradeBucketR : register(u1);
|
||||
RWTexture2D<uint> paradeBucketG : register(u2);
|
||||
RWTexture2D<uint> paradeBucketB : register(u3);
|
||||
RWTexture2D<uint> paradeBucketA : register(u4);
|
||||
RWTexture2D<uint> vectorScopeBucket : register(u5);
|
||||
RWTexture2D<uint4> paradeOut : register(u6);
|
||||
RWTexture2D<uint4> vectorScopeOut : register(u7);
|
||||
|
||||
[numthreads(16, 16, 1)]
|
||||
void main( uint3 id : SV_DispatchThreadID )
|
||||
{
|
||||
paradeOut[id.xy] = uint4(
|
||||
255.0f * log(1.0f + paradeBucketR[id.xy]) / log(1.0f + paradeBucketR[uint2(256, 0)]),
|
||||
255.0f * log(1.0f + paradeBucketG[id.xy]) / log(1.0f + paradeBucketG[uint2(256, 0)]),
|
||||
255.0f * log(1.0f + paradeBucketB[id.xy]) / log(1.0f + paradeBucketB[uint2(256, 0)]),
|
||||
255.0f * log(1.0f + paradeBucketA[id.xy]) / log(1.0f + paradeBucketA[uint2(256, 0)]));
|
||||
|
||||
float luminance = 1.0f - max(0.0f, min(1.0f, log(1.0f + vectorScopeBucket[id.xy]) / log(1.0f + vectorScopeBucket[uint2(256, 0)])));
|
||||
float2 f = (id.xy - 128.0f) / 128.0f;
|
||||
if (length(f) > 1)
|
||||
luminance = 0.0f;
|
||||
|
||||
float2 uv = ((id.xy / 128.0f) - 1.0f) * float2(0.436f, 0.615f);
|
||||
|
||||
float3 _a = float3(0, -0.3950f, 2.03252f);
|
||||
float3 _b = float3(1.14025f, -0.581f, 0);
|
||||
uint3 rgb = luminance * 255.0f * min(1, max(0, (0.5f + uv.x * _a + uv.y * _b)));
|
||||
|
||||
vectorScopeOut[id.xy] = uint4(rgb, 255);
|
||||
}
|
||||
140
hgplus/revision15-8k/src/intro/framework/shaders_shc.h
Normal file
140
hgplus/revision15-8k/src/intro/framework/shaders_shc.h
Normal file
@@ -0,0 +1,140 @@
|
||||
#pragma once
|
||||
// WARNING: This file is autogenerated by shc. Do not edit
|
||||
|
||||
#pragma data_seg(".cs_5_0")
|
||||
static char cs_5_0[] = "cs_5_0";
|
||||
|
||||
#pragma data_seg(".vs_5_0")
|
||||
static char vs_5_0[] = "vs_5_0";
|
||||
|
||||
#pragma data_seg(".gs_5_0")
|
||||
static char gs_5_0[] = "gs_5_0";
|
||||
|
||||
#pragma data_seg(".ds_5_0")
|
||||
static char ds_5_0[] = "ds_5_0";
|
||||
|
||||
#pragma data_seg(".hs_5_0")
|
||||
static char hs_5_0[] = "hs_5_0";
|
||||
|
||||
#pragma data_seg(".ps_5_0")
|
||||
static char ps_5_0[] = "ps_5_0";
|
||||
|
||||
#pragma bss_seg(".shaderbss")
|
||||
static ID3D11ComputeShader* cs_texture;
|
||||
static ID3D11ComputeShader* cs_BlurH;
|
||||
static ID3D11ComputeShader* cs_BlurV;
|
||||
static ID3D11ComputeShader* cs_Merge;
|
||||
static ID3D11ComputeShader* cs_Transition;
|
||||
static ID3D11VertexShader* vs_cube;
|
||||
static ID3D11PixelShader* ps_cube;
|
||||
static ID3D11ComputeShader* cs_cubeInstances;
|
||||
static ID3D11VertexShader* vs_cube2;
|
||||
static ID3D11PixelShader* ps_cube2;
|
||||
static ID3D11ComputeShader* cs_cube2;
|
||||
static ID3D11ComputeShader* cs_water;
|
||||
|
||||
#pragma code_seg(".FrameworkShadersCompile")
|
||||
INLINE void FrameworkShadersCompile()
|
||||
{
|
||||
CompileShader("cs_texture", cs_5_0);
|
||||
device->CreateComputeShader(shaderCode, shaderSize, NULL, &cs_texture);
|
||||
CompileShader("cs_BlurH", cs_5_0);
|
||||
device->CreateComputeShader(shaderCode, shaderSize, NULL, &cs_BlurH);
|
||||
CompileShader("cs_BlurV", cs_5_0);
|
||||
device->CreateComputeShader(shaderCode, shaderSize, NULL, &cs_BlurV);
|
||||
CompileShader("cs_Merge", cs_5_0);
|
||||
device->CreateComputeShader(shaderCode, shaderSize, NULL, &cs_Merge);
|
||||
CompileShader("cs_Transition", cs_5_0);
|
||||
device->CreateComputeShader(shaderCode, shaderSize, NULL, &cs_Transition);
|
||||
CompileShader("vs_cube", vs_5_0);
|
||||
device->CreateVertexShader(shaderCode, shaderSize, NULL, &vs_cube);
|
||||
CompileShader("ps_cube", ps_5_0);
|
||||
device->CreatePixelShader(shaderCode, shaderSize, NULL, &ps_cube);
|
||||
CompileShader("cs_cubeInstances", cs_5_0);
|
||||
device->CreateComputeShader(shaderCode, shaderSize, NULL, &cs_cubeInstances);
|
||||
CompileShader("vs_cube2", vs_5_0);
|
||||
device->CreateVertexShader(shaderCode, shaderSize, NULL, &vs_cube2);
|
||||
CompileShader("ps_cube2", ps_5_0);
|
||||
device->CreatePixelShader(shaderCode, shaderSize, NULL, &ps_cube2);
|
||||
CompileShader("cs_cube2", cs_5_0);
|
||||
device->CreateComputeShader(shaderCode, shaderSize, NULL, &cs_cube2);
|
||||
CompileShader("cs_water", cs_5_0);
|
||||
device->CreateComputeShader(shaderCode, shaderSize, NULL, &cs_water);
|
||||
}
|
||||
|
||||
struct ST
|
||||
{
|
||||
float cameraPosition_x;
|
||||
float cameraPosition_y;
|
||||
float cameraPosition_z;
|
||||
float cameraPosition_w;
|
||||
float cameraCenter_x;
|
||||
float cameraCenter_y;
|
||||
float cameraCenter_z;
|
||||
float cameraCenter_w;
|
||||
float cameraUp_x;
|
||||
float cameraUp_y;
|
||||
float cameraUp_z;
|
||||
float cameraUp_w;
|
||||
float fade;
|
||||
float cubeLifetime;
|
||||
float transition;
|
||||
float dummy_1;
|
||||
};
|
||||
|
||||
#define SYNC_TYPE_NAME ST
|
||||
#define SYNC_VAR_NAME s_ST
|
||||
|
||||
#pragma bss_seg(".syncbss")
|
||||
static SYNC_TYPE_NAME SYNC_VAR_NAME;
|
||||
|
||||
#pragma code_seg(".SyncInit")
|
||||
INLINE void SyncInit()
|
||||
{
|
||||
if (usync_init() < 0)
|
||||
return;
|
||||
|
||||
#ifndef SYNC_PLAYER
|
||||
usync_get_val(cameraPosition_x);
|
||||
usync_get_val(cameraPosition_y);
|
||||
usync_get_val(cameraPosition_z);
|
||||
usync_get_val(cameraPosition_w);
|
||||
usync_get_val(cameraCenter_x);
|
||||
usync_get_val(cameraCenter_y);
|
||||
usync_get_val(cameraCenter_z);
|
||||
usync_get_val(cameraCenter_w);
|
||||
usync_get_val(cameraUp_x);
|
||||
usync_get_val(cameraUp_y);
|
||||
usync_get_val(cameraUp_z);
|
||||
usync_get_val(cameraUp_w);
|
||||
usync_get_val(fade);
|
||||
usync_get_val(cubeLifetime);
|
||||
usync_get_val(transition);
|
||||
usync_update(0.0f, NULL);
|
||||
#endif
|
||||
}
|
||||
|
||||
INLINE void SyncUpdate(float t)
|
||||
{
|
||||
#ifndef SYNC_PLAYER
|
||||
usync_update(t * SYNC_ROWS_PER_SCENE, NULL);
|
||||
SYNC_VAR_NAME.cameraPosition_x = usync_get_val(cameraPosition_x);
|
||||
SYNC_VAR_NAME.cameraPosition_y = usync_get_val(cameraPosition_y);
|
||||
SYNC_VAR_NAME.cameraPosition_z = usync_get_val(cameraPosition_z);
|
||||
SYNC_VAR_NAME.cameraPosition_w = usync_get_val(cameraPosition_w);
|
||||
SYNC_VAR_NAME.cameraCenter_x = usync_get_val(cameraCenter_x);
|
||||
SYNC_VAR_NAME.cameraCenter_y = usync_get_val(cameraCenter_y);
|
||||
SYNC_VAR_NAME.cameraCenter_z = usync_get_val(cameraCenter_z);
|
||||
SYNC_VAR_NAME.cameraCenter_w = usync_get_val(cameraCenter_w);
|
||||
SYNC_VAR_NAME.cameraUp_x = usync_get_val(cameraUp_x);
|
||||
SYNC_VAR_NAME.cameraUp_y = usync_get_val(cameraUp_y);
|
||||
SYNC_VAR_NAME.cameraUp_z = usync_get_val(cameraUp_z);
|
||||
SYNC_VAR_NAME.cameraUp_w = usync_get_val(cameraUp_w);
|
||||
SYNC_VAR_NAME.fade = usync_get_val(fade);
|
||||
SYNC_VAR_NAME.cubeLifetime = usync_get_val(cubeLifetime);
|
||||
SYNC_VAR_NAME.transition = usync_get_val(transition);
|
||||
#else
|
||||
usync_update(t * SYNC_ROWS_PER_SCENE, (float*)&SYNC_VAR_NAME);
|
||||
#endif
|
||||
}
|
||||
|
||||
76
hgplus/revision15-8k/src/intro/framework/sound.h
Normal file
76
hgplus/revision15-8k/src/intro/framework/sound.h
Normal file
@@ -0,0 +1,76 @@
|
||||
#pragma once
|
||||
|
||||
#define SOUND_TICKS_PER_SCENE 64
|
||||
#define SYNC_ROWS_PER_SCENE 16
|
||||
|
||||
#include <mmsystem.h>
|
||||
#include <mmreg.h>
|
||||
|
||||
#pragma bss_seg(".audio_bss")
|
||||
#ifdef AUTHORING
|
||||
static SAMPLE_TYPE* soundBuffer;
|
||||
#else
|
||||
static SAMPLE_TYPE soundBuffer[MAX_SAMPLES * 2];
|
||||
#endif
|
||||
static HWAVEOUT hWaveOut;
|
||||
|
||||
#pragma data_seg(".wavehdr")
|
||||
#ifndef RELEASE
|
||||
WAVEHDR WaveHDR =
|
||||
{
|
||||
(LPSTR)soundBuffer,
|
||||
MAX_SAMPLES*sizeof(SAMPLE_TYPE)* 2,
|
||||
0, 0, 0, 0, 0, 0
|
||||
};
|
||||
#else
|
||||
WAVEHDR WaveHDR =
|
||||
{
|
||||
(LPSTR)soundBuffer,
|
||||
MAX_SAMPLES*sizeof(SAMPLE_TYPE) * 2,
|
||||
0, 0, WHDR_PREPARED, 0, 0, 0
|
||||
};
|
||||
#endif
|
||||
|
||||
#pragma data_seg(".wavefmt")
|
||||
WAVEFORMATEX WaveFMT =
|
||||
{
|
||||
#ifdef FLOAT_32BIT
|
||||
WAVE_FORMAT_IEEE_FLOAT,
|
||||
#else
|
||||
WAVE_FORMAT_PCM,
|
||||
#endif
|
||||
2, // channels
|
||||
SAMPLE_RATE, // samples per sec
|
||||
SAMPLE_RATE*sizeof(SAMPLE_TYPE)* 2, // bytes per sec
|
||||
sizeof(SAMPLE_TYPE)* 2, // block alignment;
|
||||
sizeof(SAMPLE_TYPE)* 8, // bits per sample
|
||||
0 // extension not needed
|
||||
};
|
||||
|
||||
#pragma data_seg(".mmtime")
|
||||
static MMTIME mmtime =
|
||||
{
|
||||
TIME_SAMPLES
|
||||
};
|
||||
|
||||
INLINE float SoundGetIntroPosition()
|
||||
{
|
||||
waveOutGetPosition(hWaveOut, &mmtime, sizeof(MMTIME));
|
||||
return mmtime.u.sample / (float)(SAMPLES_PER_TICK * SOUND_TICKS_PER_SCENE);
|
||||
}
|
||||
|
||||
#pragma code_seg(".initsnd")
|
||||
INLINE void SoundInit()
|
||||
{
|
||||
CreateThread(0, 0, (LPTHREAD_START_ROUTINE)_4klang_render, soundBuffer, 0, 0);
|
||||
|
||||
#ifndef VIDEO
|
||||
::Sleep(1024);// give the 4klang render call some time
|
||||
|
||||
waveOutOpen(&hWaveOut, -1, &WaveFMT, 0, 0, 0);
|
||||
#ifndef RELEASE
|
||||
waveOutPrepareHeader(hWaveOut, &WaveHDR, 0x20);
|
||||
#endif
|
||||
waveOutWrite(hWaveOut, &WaveHDR, 0x20);
|
||||
#endif
|
||||
}
|
||||
584
hgplus/revision15-8k/src/intro/framework/sync-data.h
Normal file
584
hgplus/revision15-8k/src/intro/framework/sync-data.h
Normal file
@@ -0,0 +1,584 @@
|
||||
#ifndef SYNC_DATA_H
|
||||
#define SYNC_DATA_H
|
||||
|
||||
enum sync_tracks {
|
||||
SYNC_TRACK_cameraPosition_x = 0,
|
||||
SYNC_TRACK_cameraPosition_y = 1,
|
||||
SYNC_TRACK_cameraPosition_z = 2,
|
||||
SYNC_TRACK_cameraPosition_w = 3,
|
||||
SYNC_TRACK_cameraCenter_x = 4,
|
||||
SYNC_TRACK_cameraCenter_y = 5,
|
||||
SYNC_TRACK_cameraCenter_z = 6,
|
||||
SYNC_TRACK_cameraCenter_w = 7,
|
||||
SYNC_TRACK_cameraUp_x = 8,
|
||||
SYNC_TRACK_cameraUp_y = 9,
|
||||
SYNC_TRACK_cameraUp_z = 10,
|
||||
SYNC_TRACK_cameraUp_w = 11,
|
||||
SYNC_TRACK_fade = 12,
|
||||
SYNC_TRACK_cubeLifetime = 13,
|
||||
SYNC_TRACK_transition = 14,
|
||||
SYNC_TRACK_COUNT = 15
|
||||
};
|
||||
|
||||
static const unsigned short sync_data_offset[SYNC_TRACK_COUNT] = {
|
||||
0, /* track: cameraPosition_x */
|
||||
16, /* track: cameraPosition_y */
|
||||
27, /* track: cameraPosition_z */
|
||||
47, /* track: cameraPosition_w */
|
||||
48, /* track: cameraCenter_x */
|
||||
59, /* track: cameraCenter_y */
|
||||
74, /* track: cameraCenter_z */
|
||||
85, /* track: cameraCenter_w */
|
||||
86, /* track: cameraUp_x */
|
||||
96, /* track: cameraUp_y */
|
||||
97, /* track: cameraUp_z */
|
||||
98, /* track: cameraUp_w */
|
||||
99, /* track: fade */
|
||||
127, /* track: cubeLifetime */
|
||||
138, /* track: transition */
|
||||
};
|
||||
|
||||
static const unsigned char sync_data_count[SYNC_TRACK_COUNT] = {
|
||||
16, /* track: cameraPosition_x */
|
||||
11, /* track: cameraPosition_y */
|
||||
20, /* track: cameraPosition_z */
|
||||
1, /* track: cameraPosition_w */
|
||||
11, /* track: cameraCenter_x */
|
||||
15, /* track: cameraCenter_y */
|
||||
11, /* track: cameraCenter_z */
|
||||
1, /* track: cameraCenter_w */
|
||||
10, /* track: cameraUp_x */
|
||||
1, /* track: cameraUp_y */
|
||||
1, /* track: cameraUp_z */
|
||||
1, /* track: cameraUp_w */
|
||||
28, /* track: fade */
|
||||
11, /* track: cubeLifetime */
|
||||
19, /* track: transition */
|
||||
};
|
||||
|
||||
static const unsigned short sync_data_rows[] = {
|
||||
/* track: cameraPosition_x */
|
||||
0,
|
||||
128,
|
||||
160,
|
||||
192,
|
||||
223,
|
||||
224,
|
||||
240,
|
||||
256,
|
||||
272,
|
||||
288,
|
||||
352,
|
||||
383,
|
||||
384,
|
||||
416,
|
||||
448,
|
||||
464,
|
||||
/* track: cameraPosition_y */
|
||||
0,
|
||||
128,
|
||||
160,
|
||||
192,
|
||||
223,
|
||||
224,
|
||||
288,
|
||||
384,
|
||||
415,
|
||||
416,
|
||||
448,
|
||||
/* track: cameraPosition_z */
|
||||
0,
|
||||
95,
|
||||
96,
|
||||
128,
|
||||
160,
|
||||
192,
|
||||
223,
|
||||
224,
|
||||
248,
|
||||
287,
|
||||
288,
|
||||
352,
|
||||
368,
|
||||
383,
|
||||
384,
|
||||
416,
|
||||
447,
|
||||
448,
|
||||
456,
|
||||
472,
|
||||
/* track: cameraPosition_w */
|
||||
0,
|
||||
/* track: cameraCenter_x */
|
||||
0,
|
||||
96,
|
||||
128,
|
||||
160,
|
||||
224,
|
||||
288,
|
||||
368,
|
||||
384,
|
||||
416,
|
||||
448,
|
||||
464,
|
||||
/* track: cameraCenter_y */
|
||||
0,
|
||||
96,
|
||||
128,
|
||||
160,
|
||||
192,
|
||||
224,
|
||||
287,
|
||||
288,
|
||||
352,
|
||||
360,
|
||||
384,
|
||||
416,
|
||||
448,
|
||||
472,
|
||||
512,
|
||||
/* track: cameraCenter_z */
|
||||
0,
|
||||
95,
|
||||
96,
|
||||
128,
|
||||
160,
|
||||
224,
|
||||
288,
|
||||
416,
|
||||
447,
|
||||
448,
|
||||
480,
|
||||
/* track: cameraCenter_w */
|
||||
0,
|
||||
/* track: cameraUp_x */
|
||||
0,
|
||||
160,
|
||||
192,
|
||||
223,
|
||||
224,
|
||||
352,
|
||||
384,
|
||||
448,
|
||||
456,
|
||||
472,
|
||||
/* track: cameraUp_y */
|
||||
0,
|
||||
/* track: cameraUp_z */
|
||||
0,
|
||||
/* track: cameraUp_w */
|
||||
0,
|
||||
/* track: fade */
|
||||
0,
|
||||
16,
|
||||
94,
|
||||
95,
|
||||
96,
|
||||
97,
|
||||
126,
|
||||
127,
|
||||
128,
|
||||
129,
|
||||
158,
|
||||
159,
|
||||
160,
|
||||
161,
|
||||
284,
|
||||
288,
|
||||
296,
|
||||
382,
|
||||
384,
|
||||
386,
|
||||
414,
|
||||
416,
|
||||
418,
|
||||
446,
|
||||
448,
|
||||
450,
|
||||
512,
|
||||
519,
|
||||
/* track: cubeLifetime */
|
||||
0,
|
||||
288,
|
||||
344,
|
||||
351,
|
||||
352,
|
||||
384,
|
||||
392,
|
||||
396,
|
||||
408,
|
||||
448,
|
||||
488,
|
||||
/* track: transition */
|
||||
0,
|
||||
96,
|
||||
216,
|
||||
224,
|
||||
228,
|
||||
256,
|
||||
288,
|
||||
352,
|
||||
380,
|
||||
384,
|
||||
388,
|
||||
412,
|
||||
416,
|
||||
420,
|
||||
444,
|
||||
448,
|
||||
452,
|
||||
480,
|
||||
512,
|
||||
};
|
||||
|
||||
static const float sync_data_values[] = {
|
||||
/* track: cameraPosition_x */
|
||||
0.000000f,
|
||||
-40.000000f,
|
||||
-5.000000f,
|
||||
5.000000f,
|
||||
-5.000000f,
|
||||
-5.500000f,
|
||||
-3.500000f,
|
||||
-5.500000f,
|
||||
-7.500000f,
|
||||
14.000000f,
|
||||
14.000000f,
|
||||
-40.000000f,
|
||||
-30.000000f,
|
||||
-10.000000f,
|
||||
20.000000f,
|
||||
40.000000f,
|
||||
/* track: cameraPosition_y */
|
||||
3.000000f,
|
||||
4.000000f,
|
||||
10.000000f,
|
||||
2.500000f,
|
||||
5.000000f,
|
||||
2.500000f,
|
||||
2.000000f,
|
||||
2.000000f,
|
||||
30.000000f,
|
||||
50.000000f,
|
||||
5.000000f,
|
||||
/* track: cameraPosition_z */
|
||||
0.000000f,
|
||||
50.000000f,
|
||||
75.000000f,
|
||||
100.000000f,
|
||||
125.000000f,
|
||||
140.000000f,
|
||||
175.000000f,
|
||||
203.000000f,
|
||||
208.500000f,
|
||||
225.000000f,
|
||||
65.000000f,
|
||||
65.000000f,
|
||||
40.000000f,
|
||||
50.000000f,
|
||||
70.000000f,
|
||||
130.000000f,
|
||||
30.000000f,
|
||||
25.000000f,
|
||||
25.000000f,
|
||||
30.000000f,
|
||||
/* track: cameraPosition_w */
|
||||
1.000000f,
|
||||
/* track: cameraCenter_x */
|
||||
10.000000f,
|
||||
-20.000000f,
|
||||
40.000000f,
|
||||
0.000000f,
|
||||
-6.000000f,
|
||||
50.000000f,
|
||||
50.000000f,
|
||||
0.000000f,
|
||||
0.000000f,
|
||||
30.000000f,
|
||||
50.000000f,
|
||||
/* track: cameraCenter_y */
|
||||
-10.000000f,
|
||||
-20.000000f,
|
||||
-40.000000f,
|
||||
-100.000000f,
|
||||
-40.000000f,
|
||||
1.000000f,
|
||||
-5.000000f,
|
||||
2.000000f,
|
||||
2.000000f,
|
||||
-5.000000f,
|
||||
20.000000f,
|
||||
20.000000f,
|
||||
5.000000f,
|
||||
5.000000f,
|
||||
-5.000000f,
|
||||
/* track: cameraCenter_z */
|
||||
25.000000f,
|
||||
75.000000f,
|
||||
100.000000f,
|
||||
125.000000f,
|
||||
250.000000f,
|
||||
205.500000f,
|
||||
100.000000f,
|
||||
100.000000f,
|
||||
30.000000f,
|
||||
25.000000f,
|
||||
45.000000f,
|
||||
/* track: cameraCenter_w */
|
||||
1.000000f,
|
||||
/* track: cameraUp_x */
|
||||
0.000000f,
|
||||
-0.100000f,
|
||||
0.000000f,
|
||||
0.100000f,
|
||||
0.000000f,
|
||||
0.000000f,
|
||||
0.100000f,
|
||||
0.000000f,
|
||||
-0.200000f,
|
||||
0.000000f,
|
||||
/* track: cameraUp_y */
|
||||
1.000000f,
|
||||
/* track: cameraUp_z */
|
||||
0.000000f,
|
||||
/* track: cameraUp_w */
|
||||
1.000000f,
|
||||
/* track: fade */
|
||||
0.000000f,
|
||||
0.500000f,
|
||||
0.500000f,
|
||||
0.000000f,
|
||||
0.000000f,
|
||||
0.500000f,
|
||||
0.500000f,
|
||||
0.000000f,
|
||||
0.000000f,
|
||||
0.500000f,
|
||||
0.500000f,
|
||||
0.000000f,
|
||||
0.000000f,
|
||||
0.500000f,
|
||||
0.500000f,
|
||||
0.900000f,
|
||||
0.500000f,
|
||||
0.500000f,
|
||||
0.600000f,
|
||||
0.500000f,
|
||||
0.500000f,
|
||||
0.600000f,
|
||||
0.500000f,
|
||||
0.500000f,
|
||||
0.600000f,
|
||||
0.500000f,
|
||||
0.500000f,
|
||||
0.000000f,
|
||||
/* track: cubeLifetime */
|
||||
0.000000f,
|
||||
17.000000f,
|
||||
17.000000f,
|
||||
1.000000f,
|
||||
1.000000f,
|
||||
17.000000f,
|
||||
17.000000f,
|
||||
1.000000f,
|
||||
50.000000f,
|
||||
50.000000f,
|
||||
4.000000f,
|
||||
/* track: transition */
|
||||
1.000000f,
|
||||
0.000000f,
|
||||
0.000000f,
|
||||
1.000000f,
|
||||
0.000000f,
|
||||
0.000000f,
|
||||
1.000000f,
|
||||
0.000000f,
|
||||
0.000000f,
|
||||
1.000000f,
|
||||
0.000000f,
|
||||
0.000000f,
|
||||
1.000000f,
|
||||
0.000000f,
|
||||
0.000000f,
|
||||
1.000000f,
|
||||
0.000000f,
|
||||
0.000000f,
|
||||
1.000000f,
|
||||
};
|
||||
|
||||
static const unsigned char sync_data_type[] = {
|
||||
/* track: cameraPosition_x */
|
||||
0,
|
||||
0,
|
||||
2,
|
||||
2,
|
||||
0,
|
||||
2,
|
||||
2,
|
||||
2,
|
||||
0,
|
||||
0,
|
||||
2,
|
||||
0,
|
||||
1,
|
||||
3,
|
||||
2,
|
||||
0,
|
||||
/* track: cameraPosition_y */
|
||||
0,
|
||||
0,
|
||||
2,
|
||||
2,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
2,
|
||||
0,
|
||||
/* track: cameraPosition_z */
|
||||
1,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
3,
|
||||
1,
|
||||
0,
|
||||
2,
|
||||
3,
|
||||
0,
|
||||
0,
|
||||
2,
|
||||
3,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
2,
|
||||
0,
|
||||
/* track: cameraPosition_w */
|
||||
0,
|
||||
/* track: cameraCenter_x */
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
3,
|
||||
0,
|
||||
3,
|
||||
2,
|
||||
0,
|
||||
/* track: cameraCenter_y */
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
2,
|
||||
0,
|
||||
3,
|
||||
0,
|
||||
0,
|
||||
2,
|
||||
2,
|
||||
0,
|
||||
2,
|
||||
0,
|
||||
2,
|
||||
0,
|
||||
/* track: cameraCenter_z */
|
||||
1,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
2,
|
||||
0,
|
||||
/* track: cameraCenter_w */
|
||||
0,
|
||||
/* track: cameraUp_x */
|
||||
0,
|
||||
2,
|
||||
2,
|
||||
0,
|
||||
0,
|
||||
3,
|
||||
0,
|
||||
2,
|
||||
2,
|
||||
0,
|
||||
/* track: cameraUp_y */
|
||||
0,
|
||||
/* track: cameraUp_z */
|
||||
0,
|
||||
/* track: cameraUp_w */
|
||||
0,
|
||||
/* track: fade */
|
||||
2,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
0,
|
||||
3,
|
||||
0,
|
||||
/* track: cubeLifetime */
|
||||
0,
|
||||
0,
|
||||
3,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
3,
|
||||
1,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
/* track: transition */
|
||||
2,
|
||||
0,
|
||||
3,
|
||||
2,
|
||||
0,
|
||||
3,
|
||||
3,
|
||||
0,
|
||||
3,
|
||||
2,
|
||||
0,
|
||||
3,
|
||||
2,
|
||||
0,
|
||||
3,
|
||||
2,
|
||||
0,
|
||||
3,
|
||||
0,
|
||||
};
|
||||
|
||||
#endif /* !defined(SYNC_DATA_H) */
|
||||
123
hgplus/revision15-8k/src/intro/framework/sync/base.h
Normal file
123
hgplus/revision15-8k/src/intro/framework/sync/base.h
Normal file
@@ -0,0 +1,123 @@
|
||||
/* Copyright (C) 2007-2010 Erik Faye-Lund and Egbert Teeselink
|
||||
* For conditions of distribution and use, see copyright notice in COPYING
|
||||
*/
|
||||
|
||||
#ifndef SYNC_BASE_H
|
||||
#define SYNC_BASE_H
|
||||
|
||||
/* configure inline keyword */
|
||||
#if (!defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L)) && !defined(__cplusplus)
|
||||
#if defined(_MSC_VER) || defined(__GNUC__) || defined(__SASC)
|
||||
#define inline __inline
|
||||
#else
|
||||
/* compiler does not support inline, make function static instead */
|
||||
#define inline static
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* configure lacking CRT features */
|
||||
#ifdef _MSC_VER
|
||||
#define strdup _strdup
|
||||
#define snprintf _snprintf
|
||||
/* int is 32-bit for both x86 and x64 */
|
||||
typedef unsigned int uint32_t;
|
||||
#define UINT32_MAX UINT_MAX
|
||||
#elif defined(__GNUC__)
|
||||
#include <stdint.h>
|
||||
#elif defined(M68000)
|
||||
typedef unsigned int uint32_t;
|
||||
#endif
|
||||
|
||||
/* configure socket-stack */
|
||||
#ifdef _WIN32
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#define NOMINMAX
|
||||
#include <winsock2.h>
|
||||
#include <windows.h>
|
||||
#include <limits.h>
|
||||
#include <Shlwapi.h>
|
||||
#elif defined(USE_AMITCP)
|
||||
#include <sys/socket.h>
|
||||
#include <proto/exec.h>
|
||||
#include <proto/socket.h>
|
||||
#include <netdb.h>
|
||||
#define SOCKET int
|
||||
#define INVALID_SOCKET -1
|
||||
#define select(n,r,w,e,t) WaitSelect(n,r,w,e,t,0)
|
||||
#define closesocket(x) CloseSocket(x)
|
||||
#else
|
||||
#include <sys/socket.h>
|
||||
#include <sys/time.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netdb.h>
|
||||
#include <unistd.h>
|
||||
#define SOCKET int
|
||||
#define INVALID_SOCKET -1
|
||||
#define closesocket(x) close(x)
|
||||
#endif
|
||||
|
||||
#define CLIENT_GREET "hello, synctracker!"
|
||||
#define SERVER_GREET "hello, demo!"
|
||||
|
||||
enum {
|
||||
SET_KEY = 0,
|
||||
DELETE_KEY = 1,
|
||||
GET_TRACK = 2,
|
||||
SET_ROW = 3,
|
||||
PAUSE = 4,
|
||||
SAVE_TRACKS = 5
|
||||
};
|
||||
|
||||
static inline int socket_poll(SOCKET socket)
|
||||
{
|
||||
struct timeval to = { 0, 0 };
|
||||
fd_set fds;
|
||||
|
||||
FD_ZERO(&fds);
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable: 4127)
|
||||
#endif
|
||||
FD_SET(socket, &fds);
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
return select((int)socket + 1, &fds, NULL, NULL, &to) > 0;
|
||||
}
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
static inline int xsend(SOCKET s, const void *buf, size_t len, int flags)
|
||||
{
|
||||
#ifdef WIN32
|
||||
assert(len <= INT_MAX);
|
||||
return send(s, (const char *)buf, (int)len, flags) != (int)len;
|
||||
#else
|
||||
return send(s, (const char *)buf, len, flags) != len;
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline int xrecv(SOCKET s, void *buf, size_t len, int flags)
|
||||
{
|
||||
#ifdef WIN32
|
||||
assert(len <= INT_MAX);
|
||||
return recv(s, (char *)buf, (int)len, flags) != (int)len;
|
||||
#else
|
||||
return recv(s, (char *)buf, len, flags) != len;
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef NEED_STRDUP
|
||||
static inline char *rocket_strdup(const char *str)
|
||||
{
|
||||
char *ret = malloc(strlen(str) + 1);
|
||||
if (ret)
|
||||
strcpy(ret, str);
|
||||
return ret;
|
||||
}
|
||||
#define strdup rocket_strdup
|
||||
#endif
|
||||
|
||||
#endif /* SYNC_BASE_H */
|
||||
33
hgplus/revision15-8k/src/intro/framework/sync/data.cpp
Normal file
33
hgplus/revision15-8k/src/intro/framework/sync/data.cpp
Normal file
@@ -0,0 +1,33 @@
|
||||
/* Copyright (C) 2007-2008 Erik Faye-Lund and Egbert Teeselink
|
||||
* For conditions of distribution and use, see copyright notice in COPYING
|
||||
*/
|
||||
|
||||
#include "data.h"
|
||||
|
||||
void sync_data_deinit(struct sync_data *d)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < (int)d->num_tracks; ++i) {
|
||||
free(d->tracks[i]->name);
|
||||
free(d->tracks[i]->keys);
|
||||
free(d->tracks[i]);
|
||||
}
|
||||
free(d->tracks);
|
||||
}
|
||||
|
||||
int sync_create_track(struct sync_data *d, const char *name)
|
||||
{
|
||||
struct sync_track *t;
|
||||
assert(sync_find_track(d, name) < 0);
|
||||
|
||||
t = (sync_track*)malloc(sizeof(*t));
|
||||
t->name = strdup(name);
|
||||
t->keys = NULL;
|
||||
t->num_keys = 0;
|
||||
|
||||
d->num_tracks++;
|
||||
d->tracks = (sync_track**)realloc(d->tracks, sizeof(d->tracks[0]) * d->num_tracks);
|
||||
d->tracks[d->num_tracks - 1] = t;
|
||||
|
||||
return (int)d->num_tracks - 1;
|
||||
}
|
||||
28
hgplus/revision15-8k/src/intro/framework/sync/data.h
Normal file
28
hgplus/revision15-8k/src/intro/framework/sync/data.h
Normal file
@@ -0,0 +1,28 @@
|
||||
/* Copyright (C) 2007-2010 Erik Faye-Lund and Egbert Teeselink
|
||||
* For conditions of distribution and use, see copyright notice in COPYING
|
||||
*/
|
||||
|
||||
#ifndef SYNC_DATA_H
|
||||
#define SYNC_DATA_H
|
||||
|
||||
#include "track.h"
|
||||
|
||||
struct sync_data {
|
||||
struct sync_track **tracks;
|
||||
size_t num_tracks;
|
||||
};
|
||||
|
||||
static inline int sync_find_track(const struct sync_data *data,
|
||||
const char *name)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < (int)data->num_tracks; ++i)
|
||||
if (!strcmp(name, data->tracks[i]->name))
|
||||
return i;
|
||||
return -1; /* not found */
|
||||
}
|
||||
|
||||
void sync_data_deinit(struct sync_data *);
|
||||
int sync_create_track(struct sync_data *, const char *);
|
||||
|
||||
#endif /* SYNC_DATA_H */
|
||||
359
hgplus/revision15-8k/src/intro/framework/sync/device.cpp
Normal file
359
hgplus/revision15-8k/src/intro/framework/sync/device.cpp
Normal file
@@ -0,0 +1,359 @@
|
||||
/* Copyright (C) 2007-2008 Erik Faye-Lund and Egbert Teeselink
|
||||
* For conditions of distribution and use, see copyright notice in COPYING
|
||||
*/
|
||||
|
||||
#include "device.h"
|
||||
#include "sync.h"
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
|
||||
static const char *sync_track_path(const char *base, const char *name)
|
||||
{
|
||||
static char temp[FILENAME_MAX];
|
||||
strncpy(temp, base, sizeof(temp) - 1);
|
||||
temp[sizeof(temp) - 1] = '\0';
|
||||
strncat(temp, "_", sizeof(temp) - 1);
|
||||
strncat(temp, name, sizeof(temp) - 1);
|
||||
strncat(temp, ".track", sizeof(temp) - 1);
|
||||
return temp;
|
||||
}
|
||||
|
||||
#ifndef SYNC_PLAYER
|
||||
|
||||
#ifdef USE_AMITCP
|
||||
static struct Library *socket_base = NULL;
|
||||
#endif
|
||||
|
||||
static SOCKET server_connect(const char *host, unsigned short nport)
|
||||
{
|
||||
struct hostent *he;
|
||||
struct sockaddr_in sa;
|
||||
char greet[128], **ap;
|
||||
SOCKET sock = INVALID_SOCKET;
|
||||
|
||||
#ifdef WIN32
|
||||
static int need_init = 1;
|
||||
if (need_init) {
|
||||
WSADATA wsa;
|
||||
if (WSAStartup(MAKEWORD(2, 0), &wsa))
|
||||
return INVALID_SOCKET;
|
||||
need_init = 0;
|
||||
}
|
||||
#elif defined(USE_AMITCP)
|
||||
if (!socket_base) {
|
||||
socket_base = OpenLibrary("bsdsocket.library", 4);
|
||||
if (!socket_base)
|
||||
return INVALID_SOCKET;
|
||||
}
|
||||
#endif
|
||||
|
||||
he = gethostbyname(host);
|
||||
if (!he)
|
||||
return INVALID_SOCKET;
|
||||
|
||||
for (ap = he->h_addr_list; *ap; ++ap) {
|
||||
sa.sin_family = he->h_addrtype;
|
||||
sa.sin_port = htons(nport);
|
||||
memcpy(&sa.sin_addr, *ap, he->h_length);
|
||||
|
||||
sock = socket(he->h_addrtype, SOCK_STREAM, 0);
|
||||
if (sock == INVALID_SOCKET)
|
||||
continue;
|
||||
|
||||
if (connect(sock, (struct sockaddr *)&sa, sizeof(sa)) >= 0)
|
||||
break;
|
||||
|
||||
closesocket(sock);
|
||||
sock = INVALID_SOCKET;
|
||||
}
|
||||
|
||||
if (sock == INVALID_SOCKET)
|
||||
return INVALID_SOCKET;
|
||||
|
||||
if (xsend(sock, CLIENT_GREET, strlen(CLIENT_GREET), 0) ||
|
||||
xrecv(sock, greet, strlen(SERVER_GREET), 0))
|
||||
return INVALID_SOCKET;
|
||||
|
||||
if (!strncmp(SERVER_GREET, greet, strlen(SERVER_GREET)))
|
||||
return sock;
|
||||
|
||||
closesocket(sock);
|
||||
return INVALID_SOCKET;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
void sync_set_io_cb(struct sync_device *d, struct sync_io_cb *cb)
|
||||
{
|
||||
d->io_cb.open = cb->open;
|
||||
d->io_cb.read = cb->read;
|
||||
d->io_cb.close = cb->close;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
struct sync_device *sync_create_device(const char *base)
|
||||
{
|
||||
struct sync_device *d = (sync_device*)malloc(sizeof(*d));
|
||||
if (!d)
|
||||
return NULL;
|
||||
|
||||
d->base = strdup(base);
|
||||
if (!d->base) {
|
||||
free(d);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
d->data.tracks = NULL;
|
||||
d->data.num_tracks = 0;
|
||||
|
||||
#ifndef SYNC_PLAYER
|
||||
d->row = -1;
|
||||
d->sock = INVALID_SOCKET;
|
||||
#else
|
||||
d->io_cb.open = (LPFNCBOPEN)fopen;
|
||||
d->io_cb.read = (LPFNCBREAD)fread;
|
||||
d->io_cb.close = (LPFNCBCLOSE)fclose;
|
||||
#endif
|
||||
|
||||
return d;
|
||||
}
|
||||
|
||||
void sync_destroy_device(struct sync_device *d)
|
||||
{
|
||||
free(d->base);
|
||||
sync_data_deinit(&d->data);
|
||||
free(d);
|
||||
|
||||
#if defined(USE_AMITCP) && !defined(SYNC_PLAYER)
|
||||
if (socket_base) {
|
||||
CloseLibrary(socket_base);
|
||||
socket_base = NULL;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef SYNC_PLAYER
|
||||
|
||||
static int get_track_data(struct sync_device *d, struct sync_track *t)
|
||||
{
|
||||
int i;
|
||||
void *fp = d->io_cb.open(sync_track_path(d->base, t->name), "rb");
|
||||
if (!fp)
|
||||
return -1;
|
||||
|
||||
d->io_cb.read(&t->num_keys, sizeof(size_t), 1, fp);
|
||||
t->keys = (track_key*)malloc(sizeof(struct track_key) * t->num_keys);
|
||||
if (!t->keys)
|
||||
return -1;
|
||||
|
||||
for (i = 0; i < (int)t->num_keys; ++i) {
|
||||
struct track_key *key = t->keys + i;
|
||||
char type;
|
||||
d->io_cb.read(&key->row, sizeof(int), 1, fp);
|
||||
d->io_cb.read(&key->value, sizeof(float), 1, fp);
|
||||
d->io_cb.read(&type, sizeof(char), 1, fp);
|
||||
key->type = (enum key_type)type;
|
||||
}
|
||||
|
||||
d->io_cb.close(fp);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
static int save_track(const struct sync_track *t, const char *path)
|
||||
{
|
||||
int i;
|
||||
FILE *fp = fopen(path, "wb");
|
||||
if (!fp)
|
||||
return -1;
|
||||
|
||||
fwrite(&t->num_keys, sizeof(size_t), 1, fp);
|
||||
for (i = 0; i < (int)t->num_keys; ++i) {
|
||||
char type = (char)t->keys[i].type;
|
||||
fwrite(&t->keys[i].row, sizeof(int), 1, fp);
|
||||
fwrite(&t->keys[i].value, sizeof(float), 1, fp);
|
||||
fwrite(&type, sizeof(char), 1, fp);
|
||||
}
|
||||
|
||||
fclose(fp);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void sync_save_tracks(const struct sync_device *d)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < (int)d->data.num_tracks; ++i) {
|
||||
const struct sync_track *t = d->data.tracks[i];
|
||||
save_track(t, sync_track_path(d->base, t->name));
|
||||
}
|
||||
}
|
||||
|
||||
static int get_track_data(struct sync_device *d, struct sync_track *t)
|
||||
{
|
||||
unsigned char cmd = GET_TRACK;
|
||||
uint32_t name_len;
|
||||
|
||||
assert(strlen(t->name) <= UINT32_MAX);
|
||||
name_len = htonl((uint32_t)strlen(t->name));
|
||||
|
||||
/* send request data */
|
||||
if (xsend(d->sock, (char *)&cmd, 1, 0) ||
|
||||
xsend(d->sock, (char *)&name_len, sizeof(name_len), 0) ||
|
||||
xsend(d->sock, t->name, (int)strlen(t->name), 0))
|
||||
{
|
||||
closesocket(d->sock);
|
||||
d->sock = INVALID_SOCKET;
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int handle_set_key_cmd(SOCKET sock, struct sync_data *data)
|
||||
{
|
||||
uint32_t track, row;
|
||||
union {
|
||||
float f;
|
||||
uint32_t i;
|
||||
} v;
|
||||
struct track_key key;
|
||||
unsigned char type;
|
||||
|
||||
if (xrecv(sock, (char *)&track, sizeof(track), 0) ||
|
||||
xrecv(sock, (char *)&row, sizeof(row), 0) ||
|
||||
xrecv(sock, (char *)&v.i, sizeof(v.i), 0) ||
|
||||
xrecv(sock, (char *)&type, 1, 0))
|
||||
return -1;
|
||||
|
||||
track = ntohl(track);
|
||||
v.i = ntohl(v.i);
|
||||
|
||||
key.row = ntohl(row);
|
||||
key.value = v.f;
|
||||
|
||||
assert(type < KEY_TYPE_COUNT);
|
||||
assert(track < data->num_tracks);
|
||||
key.type = (enum key_type)type;
|
||||
return sync_set_key(data->tracks[track], &key);
|
||||
}
|
||||
|
||||
static int handle_del_key_cmd(SOCKET sock, struct sync_data *data)
|
||||
{
|
||||
uint32_t track, row;
|
||||
|
||||
if (xrecv(sock, (char *)&track, sizeof(track), 0) ||
|
||||
xrecv(sock, (char *)&row, sizeof(row), 0))
|
||||
return -1;
|
||||
|
||||
track = ntohl(track);
|
||||
row = ntohl(row);
|
||||
|
||||
assert(track < data->num_tracks);
|
||||
return sync_del_key(data->tracks[track], row);
|
||||
}
|
||||
|
||||
int sync_connect(struct sync_device *d, const char *host, unsigned short port)
|
||||
{
|
||||
int i;
|
||||
if (d->sock != INVALID_SOCKET)
|
||||
closesocket(d->sock);
|
||||
|
||||
d->sock = server_connect(host, port);
|
||||
if (d->sock == INVALID_SOCKET)
|
||||
return -1;
|
||||
|
||||
for (i = 0; i < (int)d->data.num_tracks; ++i) {
|
||||
free(d->data.tracks[i]->keys);
|
||||
d->data.tracks[i]->keys = NULL;
|
||||
d->data.tracks[i]->num_keys = 0;
|
||||
}
|
||||
|
||||
for (i = 0; i < (int)d->data.num_tracks; ++i) {
|
||||
if (get_track_data(d, d->data.tracks[i])) {
|
||||
closesocket(d->sock);
|
||||
d->sock = INVALID_SOCKET;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int sync_update(struct sync_device *d, int row, struct sync_cb *cb,
|
||||
void *cb_param)
|
||||
{
|
||||
if (d->sock == INVALID_SOCKET)
|
||||
return -1;
|
||||
|
||||
/* look for new commands */
|
||||
while (socket_poll(d->sock)) {
|
||||
unsigned char cmd = 0, flag;
|
||||
uint32_t row;
|
||||
if (xrecv(d->sock, (char *)&cmd, 1, 0))
|
||||
goto sockerr;
|
||||
|
||||
switch (cmd) {
|
||||
case SET_KEY:
|
||||
if (handle_set_key_cmd(d->sock, &d->data))
|
||||
goto sockerr;
|
||||
break;
|
||||
case DELETE_KEY:
|
||||
if (handle_del_key_cmd(d->sock, &d->data))
|
||||
goto sockerr;
|
||||
break;
|
||||
case SET_ROW:
|
||||
if (xrecv(d->sock, (char *)&row, sizeof(row), 0))
|
||||
goto sockerr;
|
||||
if (cb && cb->set_row)
|
||||
cb->set_row(cb_param, ntohl(row));
|
||||
break;
|
||||
case PAUSE:
|
||||
if (xrecv(d->sock, (char *)&flag, 1, 0))
|
||||
goto sockerr;
|
||||
if (cb && cb->pause)
|
||||
cb->pause(cb_param, flag);
|
||||
break;
|
||||
case SAVE_TRACKS:
|
||||
sync_save_tracks(d);
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr, "unknown cmd: %02x\n", cmd);
|
||||
goto sockerr;
|
||||
}
|
||||
}
|
||||
|
||||
if (cb && cb->is_playing && cb->is_playing(cb_param)) {
|
||||
if (d->row != row && d->sock != INVALID_SOCKET) {
|
||||
unsigned char cmd = SET_ROW;
|
||||
uint32_t nrow = htonl(row);
|
||||
if (xsend(d->sock, (char*)&cmd, 1, 0) ||
|
||||
xsend(d->sock, (char*)&nrow, sizeof(nrow), 0))
|
||||
goto sockerr;
|
||||
d->row = row;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
||||
sockerr:
|
||||
closesocket(d->sock);
|
||||
d->sock = INVALID_SOCKET;
|
||||
return -1;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
const struct sync_track *sync_get_track(struct sync_device *d,
|
||||
const char *name)
|
||||
{
|
||||
struct sync_track *t;
|
||||
int idx = sync_find_track(&d->data, name);
|
||||
if (idx >= 0)
|
||||
return d->data.tracks[idx];
|
||||
|
||||
idx = sync_create_track(&d->data, name);
|
||||
t = d->data.tracks[idx];
|
||||
|
||||
get_track_data(d, t);
|
||||
return t;
|
||||
}
|
||||
23
hgplus/revision15-8k/src/intro/framework/sync/device.h
Normal file
23
hgplus/revision15-8k/src/intro/framework/sync/device.h
Normal file
@@ -0,0 +1,23 @@
|
||||
/* Copyright (C) 2007-2008 Erik Faye-Lund and Egbert Teeselink
|
||||
* For conditions of distribution and use, see copyright notice in COPYING
|
||||
*/
|
||||
|
||||
#ifndef SYNC_DEVICE_H
|
||||
#define SYNC_DEVICE_H
|
||||
|
||||
#include "data.h"
|
||||
#include "sync.h"
|
||||
|
||||
struct sync_device {
|
||||
char *base;
|
||||
struct sync_data data;
|
||||
|
||||
#ifndef SYNC_PLAYER
|
||||
int row;
|
||||
SOCKET sock;
|
||||
#else
|
||||
struct sync_io_cb io_cb;
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif /* SYNC_DEVICE_H */
|
||||
47
hgplus/revision15-8k/src/intro/framework/sync/sync.h
Normal file
47
hgplus/revision15-8k/src/intro/framework/sync/sync.h
Normal file
@@ -0,0 +1,47 @@
|
||||
/* Copyright (C) 2010 Erik Faye-Lund and Egbert Teeselink
|
||||
* For conditions of distribution and use, see copyright notice in COPYING
|
||||
*/
|
||||
|
||||
#ifndef SYNC_H
|
||||
#define SYNC_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct sync_device;
|
||||
struct sync_track;
|
||||
|
||||
struct sync_device *sync_create_device(const char *);
|
||||
void sync_destroy_device(struct sync_device *);
|
||||
|
||||
#ifndef SYNC_PLAYER
|
||||
struct sync_cb {
|
||||
void (*pause)(void *, int);
|
||||
void (*set_row)(void *, int);
|
||||
int (*is_playing)(void *);
|
||||
};
|
||||
#define SYNC_DEFAULT_PORT 1338
|
||||
int sync_connect(struct sync_device *, const char *, unsigned short);
|
||||
int sync_update(struct sync_device *, int, struct sync_cb *, void *);
|
||||
void sync_save_tracks(const struct sync_device *);
|
||||
#else /* defined(SYNC_PLAYER) */
|
||||
typedef void *(*LPFNCBOPEN)(const char *filename, const char *mode);
|
||||
typedef size_t(*LPFNCBREAD)(void *ptr, size_t size, size_t nitems, void *stream);
|
||||
typedef int(*LPFNCBCLOSE)(void *stream);
|
||||
struct sync_io_cb {
|
||||
LPFNCBOPEN open;
|
||||
LPFNCBREAD read;
|
||||
LPFNCBCLOSE close;
|
||||
};
|
||||
void sync_set_io_cb(struct sync_device *d, struct sync_io_cb *cb);
|
||||
#endif /* defined(SYNC_PLAYER) */
|
||||
|
||||
const struct sync_track *sync_get_track(struct sync_device *, const char *);
|
||||
double sync_get_val(const struct sync_track *, double);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* !defined(SYNC_H) */
|
||||
128
hgplus/revision15-8k/src/intro/framework/sync/track.cpp
Normal file
128
hgplus/revision15-8k/src/intro/framework/sync/track.cpp
Normal file
@@ -0,0 +1,128 @@
|
||||
/* Copyright (C) 2010 Erik Faye-Lund and Egbert Teeselink
|
||||
* For conditions of distribution and use, see copyright notice in COPYING
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
#include <math.h>
|
||||
#ifndef M_PI
|
||||
#define M_PI 3.141926
|
||||
#endif
|
||||
|
||||
#include "sync.h"
|
||||
#include "track.h"
|
||||
#include "base.h"
|
||||
|
||||
static double key_linear(const struct track_key k[2], double row)
|
||||
{
|
||||
double t = (row - k[0].row) / (k[1].row - k[0].row);
|
||||
return k[0].value + (k[1].value - k[0].value) * t;
|
||||
}
|
||||
|
||||
static double key_smooth(const struct track_key k[2], double row)
|
||||
{
|
||||
double t = (row - k[0].row) / (k[1].row - k[0].row);
|
||||
t = t * t * (3 - 2 * t);
|
||||
return k[0].value + (k[1].value - k[0].value) * t;
|
||||
}
|
||||
|
||||
static double key_ramp(const struct track_key k[2], double row)
|
||||
{
|
||||
double t = (row - k[0].row) / (k[1].row - k[0].row);
|
||||
t = pow(t, 2.0);
|
||||
return k[0].value + (k[1].value - k[0].value) * t;
|
||||
}
|
||||
|
||||
double sync_get_val(const struct sync_track *t, double row)
|
||||
{
|
||||
int idx, irow;
|
||||
|
||||
/* If we have no keys at all, return a constant 0 */
|
||||
if (!t->num_keys)
|
||||
return 0.0f;
|
||||
|
||||
irow = (int)floor(row);
|
||||
idx = key_idx_floor(t, irow);
|
||||
|
||||
/* at the edges, return the first/last value */
|
||||
if (idx < 0)
|
||||
return t->keys[0].value;
|
||||
if (idx > (int)t->num_keys - 2)
|
||||
return t->keys[t->num_keys - 1].value;
|
||||
|
||||
/* interpolate according to key-type */
|
||||
switch (t->keys[idx].type) {
|
||||
case KEY_STEP:
|
||||
return t->keys[idx].value;
|
||||
case KEY_LINEAR:
|
||||
return key_linear(t->keys + idx, row);
|
||||
case KEY_SMOOTH:
|
||||
return key_smooth(t->keys + idx, row);
|
||||
case KEY_RAMP:
|
||||
return key_ramp(t->keys + idx, row);
|
||||
default:
|
||||
assert(0);
|
||||
return 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
int sync_find_key(const struct sync_track *t, int row)
|
||||
{
|
||||
int lo = 0, hi = t->num_keys;
|
||||
|
||||
/* binary search, t->keys is sorted by row */
|
||||
while (lo < hi) {
|
||||
int mi = (lo + hi) / 2;
|
||||
assert(mi != hi);
|
||||
|
||||
if (t->keys[mi].row < row)
|
||||
lo = mi + 1;
|
||||
else if (t->keys[mi].row > row)
|
||||
hi = mi;
|
||||
else
|
||||
return mi; /* exact hit */
|
||||
}
|
||||
assert(lo == hi);
|
||||
|
||||
/* return first key after row, negated and biased (to allow -0) */
|
||||
return -lo - 1;
|
||||
}
|
||||
|
||||
#ifndef SYNC_PLAYER
|
||||
int sync_set_key(struct sync_track *t, const struct track_key *k)
|
||||
{
|
||||
int idx = sync_find_key(t, k->row);
|
||||
if (idx < 0) {
|
||||
/* no exact hit, we need to allocate a new key */
|
||||
void *tmp;
|
||||
idx = -idx - 1;
|
||||
tmp = realloc(t->keys, sizeof(struct track_key) *
|
||||
(t->num_keys + 1));
|
||||
if (!tmp)
|
||||
return -1;
|
||||
t->num_keys++;
|
||||
t->keys = (track_key*)tmp;
|
||||
memmove(t->keys + idx + 1, t->keys + idx,
|
||||
sizeof(struct track_key) * (t->num_keys - idx - 1));
|
||||
}
|
||||
t->keys[idx] = *k;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int sync_del_key(struct sync_track *t, int pos)
|
||||
{
|
||||
void *tmp;
|
||||
int idx = sync_find_key(t, pos);
|
||||
assert(idx >= 0);
|
||||
memmove(t->keys + idx, t->keys + idx + 1,
|
||||
sizeof(struct track_key) * (t->num_keys - idx - 1));
|
||||
assert(t->keys);
|
||||
tmp = realloc(t->keys, sizeof(struct track_key) *
|
||||
(t->num_keys - 1));
|
||||
if (t->num_keys != 1 && !tmp)
|
||||
return -1;
|
||||
t->num_keys--;
|
||||
t->keys = (track_key*)tmp;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
51
hgplus/revision15-8k/src/intro/framework/sync/track.h
Normal file
51
hgplus/revision15-8k/src/intro/framework/sync/track.h
Normal file
@@ -0,0 +1,51 @@
|
||||
/* Copyright (C) 2007-2010 Erik Faye-Lund and Egbert Teeselink
|
||||
* For conditions of distribution and use, see copyright notice in COPYING
|
||||
*/
|
||||
|
||||
#ifndef SYNC_TRACK_H
|
||||
#define SYNC_TRACK_H
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include "base.h"
|
||||
|
||||
enum key_type {
|
||||
KEY_STEP, /* stay constant */
|
||||
KEY_LINEAR, /* lerp to the next value */
|
||||
KEY_SMOOTH, /* smooth curve to the next value */
|
||||
KEY_RAMP,
|
||||
KEY_TYPE_COUNT
|
||||
};
|
||||
|
||||
struct track_key {
|
||||
int row;
|
||||
float value;
|
||||
enum key_type type;
|
||||
};
|
||||
|
||||
struct sync_track {
|
||||
char *name;
|
||||
struct track_key *keys;
|
||||
int num_keys;
|
||||
};
|
||||
|
||||
int sync_find_key(const struct sync_track *, int);
|
||||
static inline int key_idx_floor(const struct sync_track *t, int row)
|
||||
{
|
||||
int idx = sync_find_key(t, row);
|
||||
if (idx < 0)
|
||||
idx = -idx - 2;
|
||||
return idx;
|
||||
}
|
||||
|
||||
#ifndef SYNC_PLAYER
|
||||
int sync_set_key(struct sync_track *, const struct track_key *);
|
||||
int sync_del_key(struct sync_track *, int);
|
||||
static inline int is_key_frame(const struct sync_track *t, int row)
|
||||
{
|
||||
return sync_find_key(t, row) >= 0;
|
||||
}
|
||||
|
||||
#endif /* !defined(SYNC_PLAYER) */
|
||||
|
||||
#endif /* SYNC_TRACK_H */
|
||||
168
hgplus/revision15-8k/src/intro/framework/sync/usync.cpp
Normal file
168
hgplus/revision15-8k/src/intro/framework/sync/usync.cpp
Normal file
@@ -0,0 +1,168 @@
|
||||
#include "usync.h"
|
||||
#include <math.h>
|
||||
//#include <Shlwapi.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef SYNC_PLAYER
|
||||
|
||||
static int usync_rows[SYNC_TRACK_COUNT];
|
||||
float usync_values[SYNC_TRACK_COUNT];
|
||||
|
||||
void usync_update(float t, float* targetvalues)
|
||||
{
|
||||
int i; float row = t;
|
||||
for (i = 0; i < SYNC_TRACK_COUNT; ++i) {
|
||||
int pos;
|
||||
float mag, x, a, b, c, d;
|
||||
|
||||
/* empty tracks should not be neccesary! */
|
||||
if (!sync_data_count[i]) {
|
||||
targetvalues[i] = 0.0f;
|
||||
continue;
|
||||
}
|
||||
|
||||
/* step forward until we're at the right key-frame */
|
||||
while (usync_rows[i] < (sync_data_count[i] - 1) &&
|
||||
row >= sync_data_rows[sync_data_offset[i] + usync_rows[i] + 1]) {
|
||||
usync_rows[i]++;
|
||||
}
|
||||
|
||||
pos = usync_rows[i] + sync_data_offset[i];
|
||||
|
||||
/* we need a segment to interpolate over */
|
||||
if (usync_rows[i] == sync_data_count[i] - 1) {
|
||||
targetvalues[i] = sync_data_values[pos];
|
||||
continue;
|
||||
}
|
||||
|
||||
/* prepare coefficients for interpolation */
|
||||
a = sync_data_values[pos];
|
||||
mag = sync_data_values[pos + 1] - sync_data_values[pos];
|
||||
switch (sync_data_type[pos]) {
|
||||
case 0:
|
||||
b = c = d = 0.0f;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
b = mag;
|
||||
c = d = 0.0f;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
b = 0.0f;
|
||||
c = 3 * mag;
|
||||
d = -2 * mag;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
b = d = 0.0f;
|
||||
c = mag;
|
||||
break;
|
||||
}
|
||||
|
||||
/* evaluate function */
|
||||
x = (t - sync_data_rows[pos]) / (sync_data_rows[pos + 1] - sync_data_rows[pos]);
|
||||
targetvalues[i] = a + (b + (c + d * x) * x) * x;
|
||||
}
|
||||
}
|
||||
|
||||
#else /* !defined(SYNC_PLAYER) */
|
||||
|
||||
#include <stdio.h>
|
||||
#include "sync.h"
|
||||
#include "device.h"
|
||||
|
||||
struct sync_device *usync_dev;
|
||||
float usync_time = 0;
|
||||
|
||||
void usync_update(float t, float* targetValues)
|
||||
{
|
||||
usync_time = t;
|
||||
sync_update(usync_dev, (int)floor(t), &usync_cb, usync_data);
|
||||
}
|
||||
|
||||
int usync_init(void)
|
||||
{
|
||||
usync_dev = sync_create_device("sync");
|
||||
return sync_connect(usync_dev, "localhost", SYNC_DEFAULT_PORT);
|
||||
}
|
||||
|
||||
void usync_export(void)
|
||||
{
|
||||
int i, j;
|
||||
int offset = 0;
|
||||
static char exePath[MAX_PATH];
|
||||
static char syncPath[MAX_PATH];
|
||||
GetModuleFileName(NULL, exePath, MAX_PATH);
|
||||
PathRemoveFileSpecA(exePath);
|
||||
PathCombineA(syncPath, exePath, "..\\src\\intro\\framework\\sync-data.h");
|
||||
FILE *fp = fopen(syncPath, "w");
|
||||
|
||||
if (!fp)
|
||||
return;
|
||||
|
||||
/* header-guard */
|
||||
fputs("#ifndef SYNC_DATA_H\n#define SYNC_DATA_H\n\n", fp);
|
||||
|
||||
fputs("enum sync_tracks {\n", fp);
|
||||
for (i = 0; i < usync_dev->data.num_tracks; ++i) {
|
||||
struct sync_track *t = usync_dev->data.tracks[i];
|
||||
fprintf(fp, "\tSYNC_TRACK_%s = %d,\n", t->name, i);
|
||||
}
|
||||
fprintf(fp, "\tSYNC_TRACK_COUNT = %d\n", usync_dev->data.num_tracks);
|
||||
fputs("};\n\n", fp);
|
||||
|
||||
fputs("static const unsigned short sync_data_offset[SYNC_TRACK_COUNT] = {\n", fp);
|
||||
for (i = 0; i < usync_dev->data.num_tracks; ++i) {
|
||||
struct sync_track *t = usync_dev->data.tracks[i];
|
||||
fprintf(fp, "\t%d, /* track: %s */\n", offset, t->name);
|
||||
offset += t->num_keys;
|
||||
}
|
||||
fputs("};\n\n", fp);
|
||||
|
||||
fputs("static const unsigned char sync_data_count[SYNC_TRACK_COUNT] = {\n", fp);
|
||||
for (i = 0; i < usync_dev->data.num_tracks; ++i) {
|
||||
struct sync_track *t = usync_dev->data.tracks[i];
|
||||
fprintf(fp, "\t%d, /* track: %s */\n", t->num_keys, t->name);
|
||||
}
|
||||
fputs("};\n\n", fp);
|
||||
|
||||
fputs("static const unsigned short sync_data_rows[] = {\n", fp);
|
||||
for (i = 0; i < usync_dev->data.num_tracks; ++i) {
|
||||
struct sync_track *t = usync_dev->data.tracks[i];
|
||||
fprintf(fp, "\t/* track: %s */\n", t->name);
|
||||
for (j = 0; j < t->num_keys; ++j)
|
||||
fprintf(fp, "\t%d,\n", t->keys[j].row);
|
||||
}
|
||||
fputs("};\n\n", fp);
|
||||
|
||||
fputs("static const float sync_data_values[] = {\n", fp);
|
||||
for (i = 0; i < usync_dev->data.num_tracks; ++i) {
|
||||
struct sync_track *t = usync_dev->data.tracks[i];
|
||||
fprintf(fp, "\t/* track: %s */\n", t->name);
|
||||
for (j = 0; j < t->num_keys; ++j)
|
||||
fprintf(fp, "\t%.6ff,\n", t->keys[j].value);
|
||||
}
|
||||
fputs("};\n\n", fp);
|
||||
|
||||
fputs("static const unsigned char sync_data_type[] = {\n", fp);
|
||||
for (i = 0; i < usync_dev->data.num_tracks; ++i) {
|
||||
struct sync_track *t = usync_dev->data.tracks[i];
|
||||
fprintf(fp, "\t/* track: %s */\n", t->name);
|
||||
for (j = 0; j < t->num_keys; ++j)
|
||||
fprintf(fp, "\t%d,\n", t->keys[j].type);
|
||||
}
|
||||
fputs("};\n\n", fp);
|
||||
|
||||
fputs("#endif /* !defined(SYNC_DATA_H) */\n", fp);
|
||||
fclose(fp);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
42
hgplus/revision15-8k/src/intro/framework/sync/usync.h
Normal file
42
hgplus/revision15-8k/src/intro/framework/sync/usync.h
Normal file
@@ -0,0 +1,42 @@
|
||||
#ifndef USYNC_H
|
||||
#define USYNC_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#ifdef SYNC_PLAYER
|
||||
|
||||
#include "../sync-data.h"
|
||||
extern float usync_values[SYNC_TRACK_COUNT];
|
||||
|
||||
/* tiny api */
|
||||
#define usync_init() 0
|
||||
void usync_update(float t, float* targetValues);
|
||||
#define usync_get_val(x) usync_values[ SYNC_TRACK_##x ]
|
||||
#define usync_export()
|
||||
|
||||
#else /* !defined(SYNC_PLAYER) */
|
||||
|
||||
#include "sync.h"
|
||||
|
||||
extern struct sync_device *usync_dev;
|
||||
extern float usync_time;
|
||||
|
||||
int usync_init(void);
|
||||
void usync_update(float t, float* targetValues);
|
||||
#define usync_get_val(track) sync_get_val(sync_get_track(usync_dev, #track), usync_time)
|
||||
void usync_export(void);
|
||||
|
||||
/* implement these yourself */
|
||||
extern struct sync_cb usync_cb;
|
||||
extern void *usync_data;
|
||||
|
||||
#endif /* !defined(SYNC_PLAYER) */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* !defined(USYNC_H) */
|
||||
152
hgplus/revision15-8k/src/intro/framework/video.h
Normal file
152
hgplus/revision15-8k/src/intro/framework/video.h
Normal file
@@ -0,0 +1,152 @@
|
||||
#ifdef VIDEO
|
||||
#include <vfw.h>
|
||||
|
||||
#define FPS 60
|
||||
#define MOTION_BLUR 8
|
||||
|
||||
typedef struct
|
||||
{
|
||||
PAVISTREAM m_ps;
|
||||
PAVISTREAM m_psCompressed;
|
||||
PAVISTREAM m_psAudio;
|
||||
AVISTREAMINFO m_strhdr;
|
||||
AVICOMPRESSOPTIONS m_opts;
|
||||
PAVIFILE m_pfile;
|
||||
BITMAPINFOHEADER m_alpbi;
|
||||
} AVIWRITER;
|
||||
|
||||
static D3D11_TEXTURE2D_DESC videoStagingTextureDesc =
|
||||
{
|
||||
SCREENWIDTH,
|
||||
SCREENHEIGHT,
|
||||
1,
|
||||
1,
|
||||
DXGI_FORMAT_R8G8B8A8_UNORM,
|
||||
{ 1, 0 },
|
||||
D3D11_USAGE_STAGING,
|
||||
0,
|
||||
D3D11_CPU_ACCESS_READ,
|
||||
0
|
||||
};
|
||||
|
||||
#pragma bss_seg(".videobss")
|
||||
static AVIWRITER avi;
|
||||
static int frame = 0;
|
||||
static ID3D11Texture2D* videoStagingTexture;
|
||||
static byte buffer[3 * SCREENWIDTH * SCREENHEIGHT];
|
||||
static int tempBuffer[3 * SCREENWIDTH * SCREENHEIGHT];
|
||||
|
||||
#pragma code_seg(".VideoInit")
|
||||
void VideoInit()
|
||||
{
|
||||
AVIFileInit();
|
||||
CHECK(AVIFileOpen(&avi.m_pfile, "intro.avi", OF_WRITE | OF_CREATE, NULL));
|
||||
|
||||
memset(&avi.m_strhdr, 0, sizeof(avi.m_strhdr));
|
||||
avi.m_strhdr.fccType = streamtypeVIDEO;
|
||||
avi.m_strhdr.fccHandler = 0;
|
||||
avi.m_strhdr.dwScale = 1;
|
||||
avi.m_strhdr.dwRate = FPS;
|
||||
avi.m_strhdr.dwSuggestedBufferSize = 0;// 3 * SCREENWIDTH * SCREENHEIGHT;
|
||||
SetRect(&avi.m_strhdr.rcFrame, 0, 0, SCREENWIDTH, SCREENHEIGHT);
|
||||
|
||||
CHECK(AVIFileCreateStream(avi.m_pfile, &avi.m_ps, &avi.m_strhdr));
|
||||
|
||||
memset(&avi.m_strhdr, 0, sizeof(avi.m_strhdr));
|
||||
avi.m_strhdr.fccType = streamtypeAUDIO;
|
||||
avi.m_strhdr.dwScale = WaveFMT.nBlockAlign;
|
||||
avi.m_strhdr.dwRate = WaveFMT.nSamplesPerSec * WaveFMT.nBlockAlign;
|
||||
avi.m_strhdr.dwSampleSize = WaveFMT.nBlockAlign;
|
||||
avi.m_strhdr.dwQuality = (DWORD)-1;
|
||||
SetRect(&avi.m_strhdr.rcFrame, 0, 0, SCREENWIDTH, SCREENHEIGHT);
|
||||
|
||||
CHECK(AVIFileCreateStream(avi.m_pfile, &avi.m_psAudio, &avi.m_strhdr));
|
||||
CHECK(AVIStreamSetFormat(avi.m_psAudio, 0, &WaveFMT, sizeof(WAVEFORMATEX)));
|
||||
|
||||
auto ops = &avi.m_opts;
|
||||
if (AVISaveOptions(windowHandle, 0, 1, &avi.m_ps, &ops) == FALSE)
|
||||
{
|
||||
ExitProcess(0);
|
||||
}
|
||||
|
||||
CHECK(AVIMakeCompressedStream(&avi.m_psCompressed, avi.m_ps, &avi.m_opts, NULL));
|
||||
|
||||
memset(&avi.m_alpbi, 0, sizeof(avi.m_alpbi));
|
||||
avi.m_alpbi.biSize = sizeof(avi.m_alpbi);
|
||||
avi.m_alpbi.biWidth = SCREENWIDTH;
|
||||
avi.m_alpbi.biHeight = SCREENHEIGHT;
|
||||
avi.m_alpbi.biPlanes = 1;
|
||||
avi.m_alpbi.biBitCount = 24;
|
||||
avi.m_alpbi.biCompression = BI_RGB;
|
||||
|
||||
CHECK(AVIStreamSetFormat(avi.m_psCompressed, 0, &avi.m_alpbi, sizeof(avi.m_alpbi)));
|
||||
|
||||
CHECK(device->CreateTexture2D(&videoStagingTextureDesc, NULL, &videoStagingTexture));
|
||||
}
|
||||
|
||||
#pragma code_seg(".VideoGetPosition")
|
||||
float VideoGetPosition()
|
||||
{
|
||||
float seconds = (float)frame / (float)(FPS * MOTION_BLUR);
|
||||
float samples = seconds * SAMPLE_RATE;
|
||||
float ticks = samples / (float)SAMPLES_PER_TICK;
|
||||
return ticks / SOUND_TICKS_PER_SCENE;
|
||||
}
|
||||
|
||||
#pragma code_seg(".VideoUpdate")
|
||||
void VideoUpdate()
|
||||
{
|
||||
static D3D11_MAPPED_SUBRESOURCE videoMappedSubresource;
|
||||
|
||||
context->CopyResource(videoStagingTexture, backBufferTexture);
|
||||
context->Map(videoStagingTexture, 0, D3D11_MAP_READ, 0, &videoMappedSubresource);
|
||||
|
||||
auto introPtr = (byte*)videoMappedSubresource.pData;
|
||||
for (int y = 0; y < SCREENHEIGHT; ++y)
|
||||
{
|
||||
auto vy = SCREENHEIGHT - y - 1;
|
||||
for (int x = 0; x < SCREENWIDTH; ++x)
|
||||
{
|
||||
for (int c = 0; c < 4; ++c)
|
||||
{
|
||||
byte color = *introPtr++;
|
||||
if (c < 3)
|
||||
{
|
||||
auto vc = 2 - c;
|
||||
auto vidx = vc + 3 * (x + SCREENWIDTH * vy);
|
||||
tempBuffer[vidx] += color;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
context->Unmap(videoStagingTexture, 0);
|
||||
|
||||
if ((frame++ % MOTION_BLUR) == 0)
|
||||
{
|
||||
auto videoPtr = (byte*)buffer;
|
||||
auto tempPtr = (int*)tempBuffer;
|
||||
for (int i = 0; i < SCREENWIDTH * SCREENHEIGHT * 3; ++i)
|
||||
{
|
||||
*videoPtr++ = (byte)(*tempPtr / MOTION_BLUR);
|
||||
*tempPtr++ = 0;
|
||||
}
|
||||
|
||||
CHECK(AVIStreamWrite(avi.m_psCompressed, (frame - 1) / MOTION_BLUR, 1, buffer, 3 * SCREENWIDTH * SCREENHEIGHT, AVIIF_KEYFRAME, NULL, NULL));
|
||||
}
|
||||
}
|
||||
|
||||
#pragma code_seg(".VideoDispose")
|
||||
void VideoDispose()
|
||||
{
|
||||
auto const extraSamples = 0;// SOUND_TICKS_PER_SCENE * SAMPLES_PER_TICK / 4;
|
||||
static SAMPLE_TYPE audioBuffer[2 * (MAX_SAMPLES + extraSamples)];
|
||||
memcpy(audioBuffer + extraSamples * 2, WaveHDR.lpData, WaveHDR.dwBufferLength);
|
||||
AVIStreamWrite(avi.m_psAudio, 0, MAX_SAMPLES + extraSamples, audioBuffer, WaveHDR.dwBufferLength + extraSamples * sizeof(SAMPLE_TYPE) * 2, 0, NULL, NULL);
|
||||
|
||||
AVIStreamClose(avi.m_ps);
|
||||
AVIStreamClose(avi.m_psCompressed);
|
||||
AVIStreamClose(avi.m_psAudio);
|
||||
AVIFileClose(avi.m_pfile);
|
||||
AVIFileExit();
|
||||
}
|
||||
#endif
|
||||
91
hgplus/revision15-8k/src/intro/framework/window.h
Normal file
91
hgplus/revision15-8k/src/intro/framework/window.h
Normal file
@@ -0,0 +1,91 @@
|
||||
#pragma once
|
||||
|
||||
#ifndef SCREENWIDTH
|
||||
#define SCREENWIDTH 1280
|
||||
#endif
|
||||
|
||||
#ifndef SCREENHEIGHT
|
||||
#define SCREENHEIGHT 720
|
||||
#endif
|
||||
|
||||
#ifndef WINDOWED
|
||||
#define WINDOWED FALSE
|
||||
#endif
|
||||
|
||||
#pragma bss_seg(".windowbss")
|
||||
static float windowWidth = SCREENWIDTH;
|
||||
static float windowHeight = SCREENHEIGHT;
|
||||
static HWND windowHandle;
|
||||
|
||||
#pragma data_seg(".aspectRatio")
|
||||
static float aspectRatio = (float)SCREENWIDTH / (float)SCREENHEIGHT;
|
||||
|
||||
#ifdef VIDEO
|
||||
#define windowTitle "Intro (rendering to video)"
|
||||
#endif
|
||||
|
||||
#ifdef RELEASE
|
||||
#define windowTitle "Intro (release)"
|
||||
#endif
|
||||
|
||||
#ifdef SHADERDEBUG
|
||||
#define windowTitle "Intro (shader debug)"
|
||||
#endif
|
||||
|
||||
#ifdef AUTHORING
|
||||
#define windowTitle "Intro (authoring)"
|
||||
#endif
|
||||
|
||||
#ifndef windowTitle
|
||||
#define windowTitle "Intro (unknown configuration)"
|
||||
#endif
|
||||
|
||||
#ifndef COMPRESS
|
||||
#undef WINDOWED
|
||||
#define WINDOWED TRUE
|
||||
#endif
|
||||
|
||||
#pragma code_seg(".windowInit")
|
||||
INLINE void WindowInit()
|
||||
{
|
||||
Log("WindowInit");
|
||||
#ifdef RELEASE
|
||||
windowHandle = CreateWindowExA(0, (LPCSTR)0x0000C019, 0, WS_OVERLAPPEDWINDOW | WS_VISIBLE, 0, 0, windowWidth + 16, windowHeight + 39, 0, 0, 0, 0);
|
||||
ShowCursor(false);
|
||||
#else
|
||||
WNDCLASSEX wndclass;
|
||||
wndclass.cbSize = sizeof(wndclass);
|
||||
wndclass.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC;
|
||||
wndclass.lpfnWndProc = (WNDPROC)DefWindowProc;
|
||||
wndclass.cbClsExtra = 0;
|
||||
wndclass.cbWndExtra = 0;
|
||||
wndclass.hInstance = NULL;
|
||||
wndclass.hIcon = LoadIcon(NULL, IDI_APPLICATION);
|
||||
wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);
|
||||
wndclass.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
|
||||
wndclass.lpszMenuName = NULL;
|
||||
wndclass.lpszClassName = "IntroWindowClass";
|
||||
wndclass.hIconSm = LoadIcon(NULL, IDI_APPLICATION);
|
||||
|
||||
RegisterClassEx(&wndclass);
|
||||
#ifndef AUTHORING
|
||||
windowHandle = CreateWindowExA(0,
|
||||
wndclass.lpszClassName,
|
||||
windowTitle,
|
||||
WS_EX_APPWINDOW,
|
||||
GetSystemMetrics(SM_CXSCREEN) - windowWidth - 16,
|
||||
0,
|
||||
windowWidth + 16,
|
||||
windowHeight + 39,
|
||||
NULL,
|
||||
NULL,
|
||||
GetModuleHandle(NULL),
|
||||
NULL
|
||||
);
|
||||
ShowWindow(windowHandle, SW_NORMAL);
|
||||
SetWindowPos(windowHandle, 0, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
|
||||
#else
|
||||
windowHandle = CreateWindowExA(0, wndclass.lpszClassName, windowTitle, 0, 0, 0, SCREENWIDTH + 16, SCREENHEIGHT + 39, 0, 0, GetModuleHandle(NULL), 0);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
632
hgplus/revision15-8k/src/intro/intro.vcxproj
Normal file
632
hgplus/revision15-8k/src/intro/intro.vcxproj
Normal file
@@ -0,0 +1,632 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Authoring|Win32">
|
||||
<Configuration>Authoring</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="ShaderDebug|Win32">
|
||||
<Configuration>ShaderDebug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Compress|Win32">
|
||||
<Configuration>Compress</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Video|Win32">
|
||||
<Configuration>Video</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{EC001821-5569-4BB5-87B3-20CB8FF9137B}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>ConsoleApplication1</RootNamespace>
|
||||
<ProjectName>intro</ProjectName>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ShaderDebug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<CharacterSet>NotSet</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Video|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<CharacterSet>NotSet</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Authoring|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<CharacterSet>NotSet</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Compress|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>NotSet</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>NotSet</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='ShaderDebug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Video|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Authoring|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Compress|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ShaderDebug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)bin\</OutDir>
|
||||
<IntDir>$(SolutionDir)obj\$(Configuration)\</IntDir>
|
||||
<TargetName>$(ProjectName)_$(Configuration)</TargetName>
|
||||
<ExecutablePath>$(SolutionDir)\tools;$(ExecutablePath)</ExecutablePath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Video|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)bin\</OutDir>
|
||||
<IntDir>$(SolutionDir)obj\$(Configuration)\</IntDir>
|
||||
<TargetName>$(ProjectName)_$(Configuration)</TargetName>
|
||||
<ExecutablePath>$(SolutionDir)\tools;$(ExecutablePath)</ExecutablePath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Authoring|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)bin\</OutDir>
|
||||
<IntDir>$(SolutionDir)obj\$(Configuration)\</IntDir>
|
||||
<TargetName>$(ProjectName)_$(Configuration)</TargetName>
|
||||
<ExecutablePath>$(SolutionDir)\tools;$(ExecutablePath)</ExecutablePath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Compress|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)bin\</OutDir>
|
||||
<IntDir>$(SolutionDir)obj\$(Configuration)\</IntDir>
|
||||
<TargetName>$(ProjectName)_$(Configuration)</TargetName>
|
||||
<ExecutablePath>$(SolutionDir)\tools;$(ExecutablePath)</ExecutablePath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)bin\</OutDir>
|
||||
<IntDir>$(SolutionDir)obj\$(Configuration)\</IntDir>
|
||||
<TargetName>$(ProjectName)_$(Configuration)</TargetName>
|
||||
<ExecutablePath>$(SolutionDir)\tools;$(ExecutablePath)</ExecutablePath>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ShaderDebug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>SHADERDEBUG;WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<CallingConvention>StdCall</CallingConvention>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>dxgi.lib;d3d11.lib;D3dcompiler.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>
|
||||
</Command>
|
||||
</PreBuildEvent>
|
||||
<CustomBuildStep>
|
||||
<Command>
|
||||
</Command>
|
||||
</CustomBuildStep>
|
||||
<CustomBuildStep>
|
||||
<Message>
|
||||
</Message>
|
||||
<Outputs>
|
||||
</Outputs>
|
||||
<Inputs>
|
||||
</Inputs>
|
||||
</CustomBuildStep>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Video|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>VIDEO;WIN32;SYNC_PLAYER;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<CallingConvention>StdCall</CallingConvention>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>dxgi.lib;d3d11.lib;D3dcompiler.lib;winmm.lib;vfw32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>
|
||||
</Command>
|
||||
</PreBuildEvent>
|
||||
<CustomBuildStep>
|
||||
<Command>
|
||||
</Command>
|
||||
</CustomBuildStep>
|
||||
<CustomBuildStep>
|
||||
<Message>
|
||||
</Message>
|
||||
<Outputs>
|
||||
</Outputs>
|
||||
<Inputs>
|
||||
</Inputs>
|
||||
</CustomBuildStep>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Authoring|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>AUTHORING;WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<CallingConvention>StdCall</CallingConvention>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>dxgi.lib;d3d11.lib;dxguid.lib;D3dcompiler.lib;winmm.lib;Shlwapi.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<Profile>true</Profile>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>
|
||||
</Command>
|
||||
</PreBuildEvent>
|
||||
<CustomBuildStep>
|
||||
<Command>
|
||||
</Command>
|
||||
</CustomBuildStep>
|
||||
<CustomBuildStep>
|
||||
<Message>
|
||||
</Message>
|
||||
<Outputs>
|
||||
</Outputs>
|
||||
<Inputs>
|
||||
</Inputs>
|
||||
</CustomBuildStep>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Compress|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MinSpace</Optimization>
|
||||
<FunctionLevelLinking>false</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>COMPRESS;RELEASE;WIN32;NDEBUG;SYNC_PLAYER;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<DebugInformationFormat Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">None</DebugInformationFormat>
|
||||
<FavorSizeOrSpeed Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Size</FavorSizeOrSpeed>
|
||||
<OmitFramePointers Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</OmitFramePointers>
|
||||
<WholeProgramOptimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</WholeProgramOptimization>
|
||||
<ExceptionHandling Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</ExceptionHandling>
|
||||
<RuntimeLibrary Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MultiThreadedDLL</RuntimeLibrary>
|
||||
<BufferSecurityCheck Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</BufferSecurityCheck>
|
||||
<FloatingPointModel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Fast</FloatingPointModel>
|
||||
<DebugInformationFormat>None</DebugInformationFormat>
|
||||
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
|
||||
<OmitFramePointers>true</OmitFramePointers>
|
||||
<WholeProgramOptimization>false</WholeProgramOptimization>
|
||||
<ExceptionHandling>false</ExceptionHandling>
|
||||
<BufferSecurityCheck>false</BufferSecurityCheck>
|
||||
<EnableEnhancedInstructionSet>NotSet</EnableEnhancedInstructionSet>
|
||||
<AdditionalOptions>/QIfist %(AdditionalOptions)</AdditionalOptions>
|
||||
<FloatingPointModel>Fast</FloatingPointModel>
|
||||
<CallingConvention>StdCall</CallingConvention>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<AdditionalDependencies>dxgi.lib;d3d11.lib;D3dcompiler.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalOptions>/CRINKLER /TRANSFORM:CALLS /COMPMODE:SLOW /HASHTRIES:100 /HASHSIZE:256 /ORDERTRIES:2000 /UNSAFEIMPORT /REPORT:crinkler.html %(AdditionalOptions)</AdditionalOptions>
|
||||
<EntryPointSymbol>main</EntryPointSymbol>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>
|
||||
</Command>
|
||||
</PreBuildEvent>
|
||||
<CustomBuildStep>
|
||||
<Command>
|
||||
</Command>
|
||||
</CustomBuildStep>
|
||||
<CustomBuildStep>
|
||||
<Message>
|
||||
</Message>
|
||||
<Outputs>
|
||||
</Outputs>
|
||||
<Inputs>
|
||||
</Inputs>
|
||||
</CustomBuildStep>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>RELEASE;WIN32;SYNC_PLAYER;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AssemblerOutput>All</AssemblerOutput>
|
||||
<CallingConvention>StdCall</CallingConvention>
|
||||
<FloatingPointModel>Fast</FloatingPointModel>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<AdditionalDependencies>dxgi.lib;d3d11.lib;dxguid.lib;D3dcompiler.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>
|
||||
</Command>
|
||||
</PreBuildEvent>
|
||||
<CustomBuildStep>
|
||||
<Command>
|
||||
</Command>
|
||||
</CustomBuildStep>
|
||||
<CustomBuildStep>
|
||||
<Message>
|
||||
</Message>
|
||||
<Outputs>
|
||||
</Outputs>
|
||||
<Inputs>
|
||||
</Inputs>
|
||||
</CustomBuildStep>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="framework\sync\data.cpp" />
|
||||
<ClCompile Include="framework\sync\device.cpp" />
|
||||
<ClCompile Include="framework\sync\track.cpp" />
|
||||
<ClCompile Include="framework\sync\usync.cpp" />
|
||||
<ClCompile Include="main.cpp">
|
||||
<AssemblerOutput Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">All</AssemblerOutput>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Compress|Win32'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="main.release.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ShaderDebug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Video|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Authoring|Win32'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="framework\4klang.h" />
|
||||
<ClInclude Include="framework\authoring.h" />
|
||||
<ClInclude Include="framework\directx.h" />
|
||||
<ClInclude Include="framework\framework.h" />
|
||||
<ClInclude Include="framework\intro_hlsl.h" />
|
||||
<ClInclude Include="framework\log.h" />
|
||||
<ClInclude Include="framework\mutexlock.h" />
|
||||
<ClInclude Include="framework\shaders.h" />
|
||||
<ClInclude Include="framework\shaders_shc.h" />
|
||||
<ClInclude Include="framework\sync-data.h" />
|
||||
<ClInclude Include="framework\sync\base.h" />
|
||||
<ClInclude Include="framework\sync\data.h" />
|
||||
<ClInclude Include="framework\sync\device.h" />
|
||||
<ClInclude Include="framework\sync\sync.h" />
|
||||
<ClInclude Include="framework\sync\track.h" />
|
||||
<ClInclude Include="framework\sync\usync.h" />
|
||||
<ClInclude Include="framework\video.h" />
|
||||
<ClInclude Include="framework\window.h" />
|
||||
<ClInclude Include="intro\data.h" />
|
||||
<ClInclude Include="framework\sound.h" />
|
||||
<ClInclude Include="intro\intro.h" />
|
||||
<ClInclude Include="intro\update.h" />
|
||||
<ClInclude Include="intro\functions.h" />
|
||||
<ClInclude Include="intro\init.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<CustomBuild Include="framework\4klang.asm">
|
||||
<FileType>Document</FileType>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Video|Win32'">yasm -f win32 -o "$(IntermediateOutputPath)framework\4klang.obj" "$(ProjectDir)framework\4klang.asm"</Command>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Video|Win32'">Compiling 4klang...</Message>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Video|Win32'">$(IntermediateOutputPath)framework\4klang.obj</Outputs>
|
||||
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Video|Win32'">$(ProjectDir)framework\4klang.inc</AdditionalInputs>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Compress|Win32'">yasm -f win32 -o "$(IntermediateOutputPath)framework\4klang.obj" "$(ProjectDir)framework\4klang.asm"</Command>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">yasm -f win32 -o "$(IntermediateOutputPath)framework\4klang.obj" "$(ProjectDir)framework\4klang.asm"</Command>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Compress|Win32'">Compiling 4klang...</Message>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Compiling 4klang...</Message>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Compress|Win32'">$(IntermediateOutputPath)framework\4klang.obj</Outputs>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntermediateOutputPath)framework\4klang.obj</Outputs>
|
||||
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Compress|Win32'">$(ProjectDir)framework\4klang.inc</AdditionalInputs>
|
||||
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)framework\4klang.inc</AdditionalInputs>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='ShaderDebug|Win32'">yasm -f win32 -o "$(IntermediateOutputPath)framework\4klang.obj" "$(ProjectDir)framework\4klang.asm"</Command>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='ShaderDebug|Win32'">Compiling 4klang...</Message>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='ShaderDebug|Win32'">$(IntermediateOutputPath)framework\4klang.obj</Outputs>
|
||||
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='ShaderDebug|Win32'">$(ProjectDir)framework\4klang.inc</AdditionalInputs>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Authoring|Win32'">yasm -D AUTHORING -f win32 -o "$(IntermediateOutputPath)framework\4klang.obj" "$(ProjectDir)framework\4klang.asm"</Command>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Authoring|Win32'">Compiling 4klang...</Message>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Authoring|Win32'">$(IntermediateOutputPath)framework\4klang.obj</Outputs>
|
||||
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Authoring|Win32'">$(ProjectDir)framework\4klang.inc</AdditionalInputs>
|
||||
</CustomBuild>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="framework\4klang.inc" />
|
||||
<None Include="shaders\lib\fxaa311.hlsl">
|
||||
<FileType>Document</FileType>
|
||||
</None>
|
||||
<None Include="shaders\lib\lighting.hlsl">
|
||||
<FileType>Document</FileType>
|
||||
</None>
|
||||
<None Include="shaders\lib\material.hlsl">
|
||||
<FileType>Document</FileType>
|
||||
</None>
|
||||
<None Include="shaders\lib\ogl2dx.hlsl">
|
||||
<FileType>Document</FileType>
|
||||
</None>
|
||||
<None Include="shaders\lib\postprocessing.hlsl">
|
||||
<FileType>Document</FileType>
|
||||
</None>
|
||||
<None Include="shaders\lib\rt.hlsl">
|
||||
<FileType>Document</FileType>
|
||||
</None>
|
||||
<None Include="shaders\lib\sdf.hlsl">
|
||||
<FileType>Document</FileType>
|
||||
</None>
|
||||
<None Include="shaders\lib\utils.hlsl">
|
||||
<FileType>Document</FileType>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<CustomBuild Include="shaders\intro.hlsl">
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Video|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Video|Win32'">4.0</ShaderModel>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">4.0</ShaderModel>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='ShaderDebug|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='ShaderDebug|Win32'">4.0</ShaderModel>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Compress|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Compress|Win32'">4.0</ShaderModel>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Authoring|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Authoring|Win32'">4.0</ShaderModel>
|
||||
<FileType>Document</FileType>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Video|Win32'">$(TargetDir)shc "%(FullPath)" "$(ProjectDir)framework\intro_hlsl.h" "$(ProjectDir)framework\shaders_shc.h" "$(ProjectDir)framework\merged.hlsl"</Command>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(TargetDir)shc "%(FullPath)" "$(ProjectDir)framework\intro_hlsl.h" "$(ProjectDir)framework\shaders_shc.h" "$(ProjectDir)framework\merged.hlsl"</Command>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='ShaderDebug|Win32'">$(TargetDir)shc "%(FullPath)" "$(ProjectDir)framework\intro_hlsl.h" "$(ProjectDir)framework\shaders_shc.h" "$(ProjectDir)framework\merged.hlsl"</Command>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Compress|Win32'">$(TargetDir)shc "%(FullPath)" "$(ProjectDir)framework\intro_hlsl.h" "$(ProjectDir)framework\shaders_shc.h" "$(ProjectDir)framework\merged.hlsl"</Command>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Authoring|Win32'">$(TargetDir)shc "%(FullPath)" "$(ProjectDir)framework\intro_hlsl.h" "$(ProjectDir)framework\shaders_shc.h" "$(ProjectDir)framework\merged.hlsl"</Command>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Video|Win32'">Compiling intro.hlsl...</Message>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Video|Win32'">$(ProjectDir)framework\shaders_shc.h;$(ProjectDir)framework\intro_hlsl.h;$(ProjectDir)framework\merged.hlsl;%(Outputs)</Outputs>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Compiling intro.hlsl...</Message>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)framework\shaders_shc.h;$(ProjectDir)framework\intro_hlsl.h;$(ProjectDir)framework\merged.hlsl;%(Outputs)</Outputs>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='ShaderDebug|Win32'">Compiling intro.hlsl...</Message>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='ShaderDebug|Win32'">$(ProjectDir)framework\shaders_shc.h;$(ProjectDir)framework\intro_hlsl.h;$(ProjectDir)framework\merged.hlsl;%(Outputs)</Outputs>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Compress|Win32'">Compiling intro.hlsl...</Message>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Compress|Win32'">$(ProjectDir)framework\shaders_shc.h;$(ProjectDir)framework\intro_hlsl.h;$(ProjectDir)framework\merged.hlsl;%(Outputs)</Outputs>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Authoring|Win32'">Compiling intro.hlsl...</Message>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Authoring|Win32'">$(ProjectDir)framework\shaders_shc.h;$(ProjectDir)framework\intro_hlsl.h;$(ProjectDir)framework\merged.hlsl;%(Outputs)</Outputs>
|
||||
</CustomBuild>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<FxCompile Include="framework\merged.hlsl">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Video|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ShaderDebug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Compress|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Authoring|Win32'">true</ExcludedFromBuild>
|
||||
</FxCompile>
|
||||
<FxCompile Include="framework\shaders\histogramGather.hlsl">
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Video|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Video|Win32'">5.0</ShaderModel>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">5.0</ShaderModel>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='ShaderDebug|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='ShaderDebug|Win32'">5.0</ShaderModel>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Compress|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Compress|Win32'">5.0</ShaderModel>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Authoring|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Authoring|Win32'">5.0</ShaderModel>
|
||||
<DisableOptimizations Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</DisableOptimizations>
|
||||
<EnableDebuggingInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</EnableDebuggingInformation>
|
||||
<DisableOptimizations Condition="'$(Configuration)|$(Platform)'=='Compress|Win32'">true</DisableOptimizations>
|
||||
<EnableDebuggingInformation Condition="'$(Configuration)|$(Platform)'=='Compress|Win32'">true</EnableDebuggingInformation>
|
||||
</FxCompile>
|
||||
<FxCompile Include="framework\shaders\histogramSpread.hlsl">
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Video|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Video|Win32'">5.0</ShaderModel>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">5.0</ShaderModel>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='ShaderDebug|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='ShaderDebug|Win32'">5.0</ShaderModel>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Compress|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Compress|Win32'">5.0</ShaderModel>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Authoring|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Authoring|Win32'">5.0</ShaderModel>
|
||||
<DisableOptimizations Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</DisableOptimizations>
|
||||
<EnableDebuggingInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</EnableDebuggingInformation>
|
||||
<DisableOptimizations Condition="'$(Configuration)|$(Platform)'=='Compress|Win32'">true</DisableOptimizations>
|
||||
<EnableDebuggingInformation Condition="'$(Configuration)|$(Platform)'=='Compress|Win32'">true</EnableDebuggingInformation>
|
||||
</FxCompile>
|
||||
<FxCompile Include="framework\shaders\histogramMaximum.hlsl">
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Video|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Video|Win32'">5.0</ShaderModel>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">5.0</ShaderModel>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='ShaderDebug|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='ShaderDebug|Win32'">5.0</ShaderModel>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Compress|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Compress|Win32'">5.0</ShaderModel>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Authoring|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Authoring|Win32'">5.0</ShaderModel>
|
||||
<DisableOptimizations Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</DisableOptimizations>
|
||||
<EnableDebuggingInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</EnableDebuggingInformation>
|
||||
<DisableOptimizations Condition="'$(Configuration)|$(Platform)'=='Compress|Win32'">true</DisableOptimizations>
|
||||
<EnableDebuggingInformation Condition="'$(Configuration)|$(Platform)'=='Compress|Win32'">true</EnableDebuggingInformation>
|
||||
</FxCompile>
|
||||
<FxCompile Include="framework\shaders\paradeVectorscopeGather.hlsl">
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Video|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Video|Win32'">5.0</ShaderModel>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">5.0</ShaderModel>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='ShaderDebug|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='ShaderDebug|Win32'">5.0</ShaderModel>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Compress|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Compress|Win32'">5.0</ShaderModel>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Authoring|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Authoring|Win32'">5.0</ShaderModel>
|
||||
<DisableOptimizations Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</DisableOptimizations>
|
||||
<EnableDebuggingInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</EnableDebuggingInformation>
|
||||
<DisableOptimizations Condition="'$(Configuration)|$(Platform)'=='Compress|Win32'">true</DisableOptimizations>
|
||||
<EnableDebuggingInformation Condition="'$(Configuration)|$(Platform)'=='Compress|Win32'">true</EnableDebuggingInformation>
|
||||
</FxCompile>
|
||||
<FxCompile Include="framework\shaders\paradeVectorscopeMaximum.hlsl">
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Video|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Video|Win32'">5.0</ShaderModel>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">5.0</ShaderModel>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='ShaderDebug|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='ShaderDebug|Win32'">5.0</ShaderModel>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Compress|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Compress|Win32'">5.0</ShaderModel>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Authoring|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Authoring|Win32'">5.0</ShaderModel>
|
||||
<DisableOptimizations Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</DisableOptimizations>
|
||||
<EnableDebuggingInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</EnableDebuggingInformation>
|
||||
<DisableOptimizations Condition="'$(Configuration)|$(Platform)'=='Compress|Win32'">true</DisableOptimizations>
|
||||
<EnableDebuggingInformation Condition="'$(Configuration)|$(Platform)'=='Compress|Win32'">true</EnableDebuggingInformation>
|
||||
</FxCompile>
|
||||
<FxCompile Include="framework\shaders\paradeVectorscopeSpread.hlsl">
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Video|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Video|Win32'">5.0</ShaderModel>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">5.0</ShaderModel>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='ShaderDebug|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='ShaderDebug|Win32'">5.0</ShaderModel>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Compress|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Compress|Win32'">5.0</ShaderModel>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Authoring|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Authoring|Win32'">5.0</ShaderModel>
|
||||
<DisableOptimizations Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</DisableOptimizations>
|
||||
<EnableDebuggingInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</EnableDebuggingInformation>
|
||||
<DisableOptimizations Condition="'$(Configuration)|$(Platform)'=='Compress|Win32'">true</DisableOptimizations>
|
||||
<EnableDebuggingInformation Condition="'$(Configuration)|$(Platform)'=='Compress|Win32'">true</EnableDebuggingInformation>
|
||||
</FxCompile>
|
||||
<None Include="shaders\parts\shared.hlsl">
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Video|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Video|Win32'">4.0</ShaderModel>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">4.0</ShaderModel>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='ShaderDebug|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='ShaderDebug|Win32'">4.0</ShaderModel>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Compress|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Compress|Win32'">4.0</ShaderModel>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Authoring|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Authoring|Win32'">4.0</ShaderModel>
|
||||
<FileType>Document</FileType>
|
||||
</None>
|
||||
<None Include="shaders\parts\part2.hlsl">
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Video|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Video|Win32'">4.0</ShaderModel>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">4.0</ShaderModel>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='ShaderDebug|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='ShaderDebug|Win32'">4.0</ShaderModel>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Compress|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Compress|Win32'">4.0</ShaderModel>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Authoring|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Authoring|Win32'">4.0</ShaderModel>
|
||||
<FileType>Document</FileType>
|
||||
</None>
|
||||
<None Include="shaders\parts\part1.hlsl">
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Video|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Video|Win32'">4.0</ShaderModel>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">4.0</ShaderModel>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='ShaderDebug|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='ShaderDebug|Win32'">4.0</ShaderModel>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Compress|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Compress|Win32'">4.0</ShaderModel>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Authoring|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Authoring|Win32'">4.0</ShaderModel>
|
||||
<FileType>Document</FileType>
|
||||
</None>
|
||||
<None Include="shaders\lib\structs.hlsl">
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Video|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Video|Win32'">4.0</ShaderModel>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">4.0</ShaderModel>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='ShaderDebug|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='ShaderDebug|Win32'">4.0</ShaderModel>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Compress|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Compress|Win32'">4.0</ShaderModel>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Authoring|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Authoring|Win32'">4.0</ShaderModel>
|
||||
<FileType>Document</FileType>
|
||||
</None>
|
||||
<None Include="shaders\lib\constants.hlsl">
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Video|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Video|Win32'">4.0</ShaderModel>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">4.0</ShaderModel>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='ShaderDebug|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='ShaderDebug|Win32'">4.0</ShaderModel>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Compress|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Compress|Win32'">4.0</ShaderModel>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Authoring|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Authoring|Win32'">4.0</ShaderModel>
|
||||
<DeploymentContent>true</DeploymentContent>
|
||||
<FileType>Document</FileType>
|
||||
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='ShaderDebug|Win32'">false</DeploymentContent>
|
||||
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Video|Win32'">false</DeploymentContent>
|
||||
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</DeploymentContent>
|
||||
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Authoring|Win32'">false</DeploymentContent>
|
||||
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Compress|Win32'">false</DeploymentContent>
|
||||
</None>
|
||||
<None Include="shaders\lib\greeble.hlsl">
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Video|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Video|Win32'">4.0</ShaderModel>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">4.0</ShaderModel>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='ShaderDebug|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='ShaderDebug|Win32'">4.0</ShaderModel>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Compress|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Compress|Win32'">4.0</ShaderModel>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Authoring|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Authoring|Win32'">4.0</ShaderModel>
|
||||
<FileType>Document</FileType>
|
||||
</None>
|
||||
<None Include="shaders\lib\functions.hlsl">
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Video|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Video|Win32'">4.0</ShaderModel>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">4.0</ShaderModel>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='ShaderDebug|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='ShaderDebug|Win32'">4.0</ShaderModel>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Compress|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Compress|Win32'">4.0</ShaderModel>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Authoring|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Authoring|Win32'">4.0</ShaderModel>
|
||||
<FileType>Document</FileType>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
6
hgplus/revision15-8k/src/intro/intro.vcxproj.user
Normal file
6
hgplus/revision15-8k/src/intro/intro.vcxproj.user
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ShowAllFiles>true</ShowAllFiles>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
356
hgplus/revision15-8k/src/intro/intro/data.h
Normal file
356
hgplus/revision15-8k/src/intro/intro/data.h
Normal file
@@ -0,0 +1,356 @@
|
||||
#pragma once
|
||||
|
||||
// defines
|
||||
#define CUBE_COUNT_X 128
|
||||
#define CUBE_COUNT_Y 32
|
||||
#define CUBE_COUNT_Z 128
|
||||
|
||||
// types
|
||||
struct TEXTURE_2D_SRV_UAV_RTV
|
||||
{
|
||||
ID3D11Texture2D* TEX;
|
||||
ID3D11ShaderResourceView* SRV;
|
||||
ID3D11UnorderedAccessView* UAV;
|
||||
ID3D11RenderTargetView* RTV;
|
||||
};
|
||||
|
||||
struct OrderIndependendSortType
|
||||
{
|
||||
float colorR;
|
||||
float colorG;
|
||||
float colorB;
|
||||
float colorA;
|
||||
float depth;
|
||||
float index;
|
||||
};
|
||||
|
||||
struct ConstantBuffer1Type
|
||||
{
|
||||
float time;
|
||||
float screenWidth;
|
||||
float aspect;
|
||||
float dummy;
|
||||
};
|
||||
|
||||
struct ConstantBuffer2Type
|
||||
{
|
||||
float directionX;
|
||||
float directionY;
|
||||
float directionZ;
|
||||
float directionW;
|
||||
float cameraX;
|
||||
float cameraY;
|
||||
float cameraZ;
|
||||
float cameraW;
|
||||
float view11;
|
||||
float view12;
|
||||
float view13;
|
||||
float view14;
|
||||
float view21;
|
||||
float view22;
|
||||
float view23;
|
||||
float view24;
|
||||
float view31;
|
||||
float view32;
|
||||
float view33;
|
||||
float view34;
|
||||
float view41;
|
||||
float view42;
|
||||
float view43;
|
||||
float view44;
|
||||
float projection11;
|
||||
float projection12;
|
||||
float projection13;
|
||||
float projection14;
|
||||
float projection21;
|
||||
float projection22;
|
||||
float projection23;
|
||||
float projection24;
|
||||
float projection31;
|
||||
float projection32;
|
||||
float projection33;
|
||||
float projection34;
|
||||
float projection41;
|
||||
float projection42;
|
||||
float projection43;
|
||||
float projection44;
|
||||
};
|
||||
|
||||
struct CubeInstanceType
|
||||
{
|
||||
float px, py, pz;
|
||||
float lx, ly, lz;
|
||||
int type;
|
||||
int age;
|
||||
};
|
||||
|
||||
// bss
|
||||
#pragma bss_seg(".introbss")
|
||||
static ID3D11Buffer* constantBuffers[2];
|
||||
static ID3D11Buffer* cubeInstanceBufferWater;
|
||||
static ID3D11Buffer* cubeInstanceBufferLand;
|
||||
static ID3D11Buffer* cubeCountBuffer;
|
||||
static ID3D11Buffer* flBuffer;
|
||||
static ID3D11Buffer* soBuffer;
|
||||
static ID3D11UnorderedAccessView* oitUAVs[2];
|
||||
static ID3D11ShaderResourceView* oitSRVs[2];
|
||||
|
||||
static TEXTURE_2D_SRV_UAV_RTV msTex;
|
||||
static TEXTURE_2D_SRV_UAV_RTV tex0;
|
||||
static TEXTURE_2D_SRV_UAV_RTV tex1;
|
||||
static TEXTURE_2D_SRV_UAV_RTV tmpTex1;
|
||||
static TEXTURE_2D_SRV_UAV_RTV blurTex1;
|
||||
static TEXTURE_2D_SRV_UAV_RTV tmpTex8;
|
||||
static TEXTURE_2D_SRV_UAV_RTV blurTex8;
|
||||
static TEXTURE_2D_SRV_UAV_RTV tmpTex32;
|
||||
static TEXTURE_2D_SRV_UAV_RTV blurTex32;
|
||||
static TEXTURE_2D_SRV_UAV_RTV cubeTexture1;
|
||||
static TEXTURE_2D_SRV_UAV_RTV cubeTexture2;
|
||||
static TEXTURE_2D_SRV_UAV_RTV cubeTexture3;
|
||||
static TEXTURE_2D_SRV_UAV_RTV cubeTexture4;
|
||||
static ID3D11Texture3D* cubeInstanceBuffer2;
|
||||
static ID3D11UnorderedAccessView* cubeInstanceUAVs[3];
|
||||
static ID3D11ShaderResourceView* cubeInstanceWaterSRV;
|
||||
static ID3D11ShaderResourceView* cubeInstanceLandSRV;
|
||||
|
||||
static D3D11_MAPPED_SUBRESOURCE mappedSubresource;
|
||||
static byte zero[16];
|
||||
|
||||
static ID3D11RasterizerState* solidNoCullingRasterState;
|
||||
|
||||
static ID3D11SamplerState* samplerState;
|
||||
static UINT cubeInstanceCount;
|
||||
|
||||
// data
|
||||
#pragma data_seg(".negOne")
|
||||
static UINT negOne[4] = { -1, -1, -1, -1 };
|
||||
|
||||
#pragma data_seg(".standardTexDesc")
|
||||
static D3D11_TEXTURE2D_DESC standardTexDesc =
|
||||
{
|
||||
0, 0, 0, 1, DXGI_FORMAT_R16G16B16A16_FLOAT,
|
||||
{ 1, 0 }, D3D11_USAGE_DEFAULT,
|
||||
D3D11_BIND_RENDER_TARGET | D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_UNORDERED_ACCESS,
|
||||
0, D3D11_RESOURCE_MISC_GENERATE_MIPS
|
||||
};
|
||||
|
||||
#pragma data_seg(".msTexDesc")
|
||||
static D3D11_TEXTURE2D_DESC msTexDesc =
|
||||
{
|
||||
0, 0, 1, 1, DXGI_FORMAT_R16G16B16A16_FLOAT,
|
||||
{ 2, 0 }, D3D11_USAGE_DEFAULT,
|
||||
D3D11_BIND_RENDER_TARGET | D3D11_BIND_SHADER_RESOURCE,
|
||||
0, D3D11_RESOURCE_MISC_GENERATE_MIPS
|
||||
};
|
||||
|
||||
#pragma data_seg(".flBufferDesc")
|
||||
static D3D11_BUFFER_DESC flBufferDesc =
|
||||
{
|
||||
sizeof(OrderIndependendSortType) * SCREENWIDTH * SCREENHEIGHT * 48,
|
||||
D3D11_USAGE_DEFAULT,
|
||||
D3D11_BIND_UNORDERED_ACCESS | D3D11_BIND_SHADER_RESOURCE,
|
||||
0,
|
||||
D3D11_RESOURCE_MISC_BUFFER_STRUCTURED,
|
||||
sizeof(OrderIndependendSortType)
|
||||
};
|
||||
|
||||
#pragma data_seg(".soBufferDesc")
|
||||
static D3D11_BUFFER_DESC soBufferDesc =
|
||||
{
|
||||
SCREENWIDTH * SCREENHEIGHT * sizeof(UINT),
|
||||
D3D11_USAGE_DEFAULT,
|
||||
D3D11_BIND_UNORDERED_ACCESS | D3D11_BIND_SHADER_RESOURCE,
|
||||
0,
|
||||
D3D11_RESOURCE_MISC_BUFFER_ALLOW_RAW_VIEWS,
|
||||
0
|
||||
};
|
||||
|
||||
#pragma data_seg(".flBufferUAVDesc")
|
||||
static D3D11_UNORDERED_ACCESS_VIEW_DESC flBufferUAVDesc =
|
||||
{
|
||||
DXGI_FORMAT_UNKNOWN,
|
||||
D3D11_UAV_DIMENSION_BUFFER,
|
||||
0,
|
||||
SCREENWIDTH * SCREENHEIGHT * 48,
|
||||
D3D11_BUFFER_UAV_FLAG_COUNTER
|
||||
};
|
||||
|
||||
#pragma data_seg(".soBufferUAVDesc")
|
||||
static D3D11_UNORDERED_ACCESS_VIEW_DESC soBufferUAVDesc =
|
||||
{
|
||||
DXGI_FORMAT_R32_TYPELESS,
|
||||
D3D11_UAV_DIMENSION_BUFFER,
|
||||
0,
|
||||
SCREENWIDTH * SCREENHEIGHT,
|
||||
D3D11_BUFFER_UAV_FLAG_RAW
|
||||
};
|
||||
|
||||
|
||||
#pragma data_seg(".flBufferSRVDesc")
|
||||
static D3D11_SHADER_RESOURCE_VIEW_DESC flBufferSRVDesc =
|
||||
{
|
||||
DXGI_FORMAT_UNKNOWN,
|
||||
D3D11_SRV_DIMENSION_BUFFER,
|
||||
0,
|
||||
SCREENWIDTH * SCREENHEIGHT * 64
|
||||
};
|
||||
|
||||
#pragma data_seg(".soBufferSRVDesc")
|
||||
static D3D11_SHADER_RESOURCE_VIEW_DESC soBufferSRVDesc =
|
||||
{
|
||||
DXGI_FORMAT_R32_UINT,
|
||||
D3D11_SRV_DIMENSION_BUFFER,
|
||||
0,
|
||||
SCREENWIDTH * SCREENHEIGHT
|
||||
};
|
||||
|
||||
#pragma data_seg(".solidNoCullingRasterDesc")
|
||||
static D3D11_RASTERIZER_DESC solidNoCullingRasterDesc =
|
||||
{
|
||||
D3D11_FILL_SOLID,
|
||||
D3D11_CULL_NONE,
|
||||
FALSE,
|
||||
0,
|
||||
0.0f,
|
||||
0.0f,
|
||||
TRUE,
|
||||
FALSE,
|
||||
TRUE,
|
||||
TRUE
|
||||
};
|
||||
|
||||
#pragma data_seg(".cubeInstanceUAV1desc")
|
||||
static D3D11_UNORDERED_ACCESS_VIEW_DESC cubeInstanceUAV1desc =
|
||||
{
|
||||
DXGI_FORMAT_UNKNOWN,
|
||||
D3D11_UAV_DIMENSION_BUFFER,
|
||||
{
|
||||
0,
|
||||
CUBE_COUNT_X * CUBE_COUNT_Y * CUBE_COUNT_Z * 2,
|
||||
D3D11_BUFFER_UAV_FLAG_APPEND
|
||||
}
|
||||
};
|
||||
|
||||
#pragma data_seg(".cubeCountBufferDesc")
|
||||
static D3D11_BUFFER_DESC cubeCountBufferDesc =
|
||||
{
|
||||
4,
|
||||
D3D11_USAGE_STAGING,
|
||||
0,
|
||||
D3D11_CPU_ACCESS_READ,
|
||||
0,
|
||||
0
|
||||
};
|
||||
|
||||
#pragma data_seg(".cubeInstanceBufferDesc1")
|
||||
static D3D11_BUFFER_DESC cubeInstanceBufferDesc1 =
|
||||
{
|
||||
sizeof(CubeInstanceType) * CUBE_COUNT_X * CUBE_COUNT_Y * CUBE_COUNT_Z * 2,
|
||||
D3D11_USAGE_DEFAULT,
|
||||
D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_UNORDERED_ACCESS,
|
||||
0,
|
||||
D3D11_RESOURCE_MISC_BUFFER_STRUCTURED,
|
||||
sizeof(CubeInstanceType)
|
||||
};
|
||||
|
||||
#pragma data_seg(".cubeInstanceBufferDesc2")
|
||||
static D3D11_TEXTURE3D_DESC cubeInstanceBufferDesc2 =
|
||||
{
|
||||
2 * CUBE_COUNT_X,
|
||||
CUBE_COUNT_Y,
|
||||
2 * CUBE_COUNT_Z,
|
||||
1,
|
||||
DXGI_FORMAT_R32_UINT,
|
||||
D3D11_USAGE_DEFAULT,
|
||||
D3D11_BIND_UNORDERED_ACCESS,
|
||||
0,
|
||||
0
|
||||
};
|
||||
|
||||
#pragma data_seg(".clampSamplerDesc")
|
||||
static D3D11_SAMPLER_DESC clampSamplerDesc =
|
||||
{
|
||||
D3D11_FILTER_ANISOTROPIC,
|
||||
D3D11_TEXTURE_ADDRESS_CLAMP,
|
||||
D3D11_TEXTURE_ADDRESS_CLAMP,
|
||||
D3D11_TEXTURE_ADDRESS_CLAMP,
|
||||
0.0f,
|
||||
1,
|
||||
D3D11_COMPARISON_ALWAYS,
|
||||
{
|
||||
0, 0, 0, 0
|
||||
},
|
||||
0,
|
||||
D3D11_FLOAT32_MAX
|
||||
};
|
||||
|
||||
#pragma data_seg(".depthStencilBufferDesc")
|
||||
static D3D11_TEXTURE2D_DESC depthStencilBufferDesc =
|
||||
{
|
||||
SCREENWIDTH,
|
||||
SCREENHEIGHT,
|
||||
1,
|
||||
1,
|
||||
DXGI_FORMAT_R24G8_TYPELESS,
|
||||
{
|
||||
1, 0
|
||||
},
|
||||
D3D11_USAGE_DEFAULT,
|
||||
D3D11_BIND_DEPTH_STENCIL | D3D11_BIND_SHADER_RESOURCE,
|
||||
0,
|
||||
0
|
||||
};
|
||||
|
||||
#pragma data_seg(".depthStencilSRVdesc")
|
||||
static D3D11_SHADER_RESOURCE_VIEW_DESC depthStencilSRVdesc =
|
||||
{
|
||||
DXGI_FORMAT_R24_UNORM_X8_TYPELESS,
|
||||
D3D11_SRV_DIMENSION_TEXTURE2DMS,
|
||||
{
|
||||
0
|
||||
}
|
||||
};
|
||||
|
||||
#pragma data_seg(".depthStencilDesc")
|
||||
static D3D11_DEPTH_STENCIL_DESC depthStencilDesc =
|
||||
{
|
||||
true,
|
||||
D3D11_DEPTH_WRITE_MASK_ALL,
|
||||
D3D11_COMPARISON_LESS,
|
||||
false,
|
||||
0,
|
||||
0
|
||||
};
|
||||
|
||||
#pragma data_seg(".depthStencilViewDesc")
|
||||
static D3D11_DEPTH_STENCIL_VIEW_DESC depthStencilViewDesc =
|
||||
{
|
||||
DXGI_FORMAT_D24_UNORM_S8_UINT,
|
||||
D3D11_DSV_DIMENSION_TEXTURE2DMS,
|
||||
0,
|
||||
{
|
||||
0
|
||||
}
|
||||
};
|
||||
|
||||
#pragma data_seg(".constantBuffer1Desc")
|
||||
static D3D11_BUFFER_DESC constantBuffer1Desc =
|
||||
{
|
||||
sizeof(ConstantBuffer1Type),
|
||||
D3D11_USAGE_DYNAMIC,
|
||||
D3D11_BIND_CONSTANT_BUFFER,
|
||||
D3D11_CPU_ACCESS_WRITE,
|
||||
0,
|
||||
0
|
||||
};
|
||||
|
||||
#pragma data_seg(".constantBuffer2Desc")
|
||||
static D3D11_BUFFER_DESC constantBufferSyncDesc =
|
||||
{
|
||||
sizeof(SYNC_TYPE_NAME),
|
||||
D3D11_USAGE_DYNAMIC,
|
||||
D3D11_BIND_CONSTANT_BUFFER,
|
||||
D3D11_CPU_ACCESS_WRITE,
|
||||
0,
|
||||
0
|
||||
};
|
||||
73
hgplus/revision15-8k/src/intro/intro/init.h
Normal file
73
hgplus/revision15-8k/src/intro/intro/init.h
Normal file
@@ -0,0 +1,73 @@
|
||||
#pragma once
|
||||
|
||||
#pragma code_seg(".createSRVUAVRTV")
|
||||
void __stdcall createSRVUAVRTV(TEXTURE_2D_SRV_UAV_RTV* tex, int width, int height)
|
||||
{
|
||||
standardTexDesc.Width = width;
|
||||
standardTexDesc.Height = height;
|
||||
device->CreateTexture2D(&standardTexDesc, NULL, &tex->TEX);
|
||||
device->CreateShaderResourceView(tex->TEX, NULL, &tex->SRV);
|
||||
device->CreateRenderTargetView(tex->TEX, NULL, &tex->RTV);
|
||||
device->CreateUnorderedAccessView(tex->TEX, NULL, &tex->UAV);
|
||||
}
|
||||
|
||||
#pragma code_seg(".FillCubeTextures")
|
||||
INLINE void FillCubeTextures()
|
||||
{
|
||||
ID3D11UnorderedAccessView* textureUAV[] = { cubeTexture1.UAV, cubeTexture2.UAV, cubeTexture3.UAV, cubeTexture4.UAV };
|
||||
context->CSSetUnorderedAccessViews(0, 4, textureUAV, (const UINT*)zero);
|
||||
context->CSSetShader(cs_texture, NULL, 0);
|
||||
context->Dispatch(80, 45, 1);
|
||||
context->CSSetShader(NULL, NULL, 0);
|
||||
context->CSSetUnorderedAccessViews(0, 4, (ID3D11UnorderedAccessView* const *)zero, (const UINT*)zero);
|
||||
|
||||
context->GenerateMips(cubeTexture1.SRV);
|
||||
context->GenerateMips(cubeTexture2.SRV);
|
||||
context->GenerateMips(cubeTexture3.SRV);
|
||||
context->GenerateMips(cubeTexture4.SRV);
|
||||
}
|
||||
|
||||
#pragma code_seg(".IntroInit")
|
||||
INLINE void IntroInit()
|
||||
{
|
||||
Log("IntroInit");
|
||||
CHECK(device->CreateBuffer(&constantBuffer1Desc, NULL, &constantBuffers[0]));
|
||||
CHECK(device->CreateBuffer(&constantBufferSyncDesc, NULL, &constantBuffers[1]));
|
||||
CHECK(device->CreateBuffer(&cubeCountBufferDesc, NULL, &cubeCountBuffer));
|
||||
CHECK(device->CreateBuffer(&cubeInstanceBufferDesc1, NULL, &cubeInstanceBufferWater));
|
||||
CHECK(device->CreateBuffer(&cubeInstanceBufferDesc1, NULL, &cubeInstanceBufferLand));
|
||||
CHECK(device->CreateBuffer(&flBufferDesc, NULL, &flBuffer));
|
||||
CHECK(device->CreateBuffer(&soBufferDesc, NULL, &soBuffer));
|
||||
|
||||
CHECK(device->CreateTexture3D(&cubeInstanceBufferDesc2, NULL, &cubeInstanceBuffer2));
|
||||
|
||||
CHECK(device->CreateUnorderedAccessView(cubeInstanceBufferLand, &cubeInstanceUAV1desc, &cubeInstanceUAVs[0]));
|
||||
CHECK(device->CreateUnorderedAccessView(cubeInstanceBufferWater, &cubeInstanceUAV1desc, &cubeInstanceUAVs[1]));
|
||||
CHECK(device->CreateUnorderedAccessView(cubeInstanceBuffer2, NULL, &cubeInstanceUAVs[2]));
|
||||
CHECK(device->CreateUnorderedAccessView(flBuffer, &flBufferUAVDesc, &oitUAVs[0]));
|
||||
CHECK(device->CreateUnorderedAccessView(soBuffer, &soBufferUAVDesc, &oitUAVs[1]));
|
||||
|
||||
CHECK(device->CreateShaderResourceView(cubeInstanceBufferWater, NULL, &cubeInstanceWaterSRV));
|
||||
CHECK(device->CreateShaderResourceView(cubeInstanceBufferLand, NULL, &cubeInstanceLandSRV));
|
||||
CHECK(device->CreateShaderResourceView(flBuffer, &flBufferSRVDesc, &oitSRVs[0]));
|
||||
CHECK(device->CreateShaderResourceView(soBuffer, &soBufferSRVDesc, &oitSRVs[1]));
|
||||
|
||||
CHECK(device->CreateSamplerState(&clampSamplerDesc, &samplerState));
|
||||
|
||||
CHECK(device->CreateRasterizerState(&solidNoCullingRasterDesc, &solidNoCullingRasterState));
|
||||
|
||||
createSRVUAVRTV(&tex0, SCREENWIDTH, SCREENHEIGHT);
|
||||
createSRVUAVRTV(&tex1, SCREENWIDTH, SCREENHEIGHT);
|
||||
createSRVUAVRTV(&tmpTex1, SCREENWIDTH, SCREENHEIGHT);
|
||||
createSRVUAVRTV(&blurTex1, SCREENWIDTH, SCREENHEIGHT);
|
||||
createSRVUAVRTV(&tmpTex8, SCREENWIDTH / 8, SCREENHEIGHT / 8);
|
||||
createSRVUAVRTV(&blurTex8, SCREENWIDTH / 8, SCREENHEIGHT / 8);
|
||||
createSRVUAVRTV(&tmpTex32, SCREENWIDTH / 32, SCREENHEIGHT / 32);
|
||||
createSRVUAVRTV(&blurTex32, SCREENWIDTH / 32, SCREENHEIGHT / 32);
|
||||
createSRVUAVRTV(&cubeTexture1, 512, 512);
|
||||
createSRVUAVRTV(&cubeTexture2, 512, 512);
|
||||
createSRVUAVRTV(&cubeTexture3, 512, 512);
|
||||
createSRVUAVRTV(&cubeTexture4, 512, 512);
|
||||
standardTexDesc = msTexDesc;
|
||||
createSRVUAVRTV(&msTex, SCREENWIDTH, SCREENHEIGHT);
|
||||
}
|
||||
7
hgplus/revision15-8k/src/intro/intro/intro.h
Normal file
7
hgplus/revision15-8k/src/intro/intro/intro.h
Normal file
@@ -0,0 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "data.h"
|
||||
#include "init.h"
|
||||
#include "update.h"
|
||||
|
||||
// EOF
|
||||
191
hgplus/revision15-8k/src/intro/intro/update.h
Normal file
191
hgplus/revision15-8k/src/intro/intro/update.h
Normal file
@@ -0,0 +1,191 @@
|
||||
#pragma once
|
||||
|
||||
#pragma code_seg(".Clear")
|
||||
INLINE void Clear()
|
||||
{
|
||||
context->ClearUnorderedAccessViewUint(tex0.UAV, (const UINT*)zero);
|
||||
context->ClearUnorderedAccessViewUint(tex1.UAV, (const UINT*)zero);
|
||||
context->ClearUnorderedAccessViewUint(cubeInstanceUAVs[2], (UINT*)zero);
|
||||
}
|
||||
|
||||
#pragma code_seg(".UpdateConstantBuffers")
|
||||
INLINE void UpdateConstantBuffers(float _introPosition)
|
||||
{
|
||||
// Update constant buffer 1
|
||||
{
|
||||
context->Map(constantBuffers[0], 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedSubresource);
|
||||
auto constantBufferData = (ConstantBuffer1Type*)mappedSubresource.pData;
|
||||
constantBufferData->time = _introPosition;
|
||||
constantBufferData->screenWidth = SCREENWIDTH;
|
||||
constantBufferData->aspect = aspectRatio;
|
||||
constantBufferData->dummy = 0;
|
||||
context->Unmap(constantBuffers[0], 0);
|
||||
}
|
||||
|
||||
// Update sync constant buffer
|
||||
{
|
||||
context->Map(constantBuffers[1], 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedSubresource);
|
||||
auto constantBufferData = (SYNC_TYPE_NAME*)mappedSubresource.pData;
|
||||
memcpy(constantBufferData, &SYNC_VAR_NAME, sizeof(SYNC_TYPE_NAME));
|
||||
context->Unmap(constantBuffers[1], 0);
|
||||
}
|
||||
}
|
||||
|
||||
#pragma code_seg(".RenderCubes")
|
||||
INLINE void RenderCubes()
|
||||
{
|
||||
context->OMSetRenderTargets(1, &msTex.RTV, NULL);
|
||||
context->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP);
|
||||
context->VSSetShader(vs_cube, NULL, 0);
|
||||
context->PSSetShader(ps_cube, NULL, 0);
|
||||
context->PSSetShaderResources(0, 1, &cubeTexture4.SRV);
|
||||
context->Draw(4, 0);
|
||||
context->PSSetShaderResources(0, 1, (ID3D11ShaderResourceView* const*)zero);
|
||||
context->PSSetShader(NULL, NULL, 0);
|
||||
context->VSSetShader(NULL, NULL, 0);
|
||||
context->OMSetRenderTargets(1, (ID3D11RenderTargetView* const *)zero, NULL);
|
||||
}
|
||||
|
||||
#pragma code_seg(".BlurTexture")
|
||||
INLINE void BlurTexture(TEXTURE_2D_SRV_UAV_RTV& tmp, TEXTURE_2D_SRV_UAV_RTV& src, TEXTURE_2D_SRV_UAV_RTV& trg, int _iWidth, int _iHeight)
|
||||
{
|
||||
// BlurV (1/1)
|
||||
context->CSSetUnorderedAccessViews(0, 1, &tmp.UAV, NULL);
|
||||
context->CSSetShaderResources(0, 1, &src.SRV);
|
||||
context->CSSetShader(cs_BlurV, NULL, 0);
|
||||
context->Dispatch(_iWidth, _iHeight, 1);
|
||||
|
||||
// BlurH (1/1) -> blurTex1
|
||||
context->CSSetUnorderedAccessViews(0, 1, &trg.UAV, NULL);
|
||||
context->CSSetShaderResources(0, 1, &tmp.SRV);
|
||||
context->CSSetShader(cs_BlurH, NULL, 0);
|
||||
context->Dispatch(_iWidth, _iHeight, 1);
|
||||
|
||||
context->GenerateMips(trg.SRV);
|
||||
}
|
||||
|
||||
#pragma code_seg(".Blur")
|
||||
INLINE void Blur(TEXTURE_2D_SRV_UAV_RTV& tex)
|
||||
{
|
||||
BlurTexture(tmpTex1, tex, blurTex1, SCREENWIDTH / 16, SCREENHEIGHT / 16);
|
||||
BlurTexture(tmpTex8, blurTex1, blurTex8, SCREENWIDTH / 128 + 1, SCREENHEIGHT / 128 + 1);
|
||||
BlurTexture(tmpTex32, blurTex8, blurTex32, SCREENWIDTH / 512 + 1, SCREENHEIGHT / 512 + 1);
|
||||
}
|
||||
|
||||
|
||||
#pragma code_seg(".DrawOIT")
|
||||
INLINE void DrawOIT(ID3D11ShaderResourceView* srv, ID3D11ShaderResourceView* source, TEXTURE_2D_SRV_UAV_RTV& target)
|
||||
{
|
||||
ID3D11ShaderResourceView* cubeSRV[] = { cubeTexture1.SRV, cubeTexture2.SRV, cubeTexture3.SRV };
|
||||
|
||||
context->ClearUnorderedAccessViewUint(oitUAVs[0], negOne);
|
||||
context->ClearUnorderedAccessViewUint(oitUAVs[1], negOne);
|
||||
|
||||
// 1st pass for ordered-independent-sorting
|
||||
context->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
|
||||
context->VSSetShader(vs_cube2, NULL, 0);
|
||||
context->PSSetShader(ps_cube2, NULL, 0);
|
||||
context->VSSetShaderResources(0, 1, &srv);
|
||||
context->PSSetShaderResources(0, 3, cubeSRV);
|
||||
context->OMSetRenderTargetsAndUnorderedAccessViews(0, (ID3D11RenderTargetView* const*)zero, NULL, 0, 2, oitUAVs, (const UINT*)zero);
|
||||
|
||||
context->DrawInstanced(36, cubeInstanceCount, 0, 0);
|
||||
|
||||
context->VSSetShader(NULL, NULL, 0);
|
||||
context->PSSetShader(NULL, NULL, 0);
|
||||
context->VSSetShaderResources(0, 1, (ID3D11ShaderResourceView* const *)zero);
|
||||
context->PSSetShaderResources(0, 3, (ID3D11ShaderResourceView* const *)zero);
|
||||
context->OMSetRenderTargetsAndUnorderedAccessViews(0, (ID3D11RenderTargetView* const*)zero, NULL, 0, 2, (ID3D11UnorderedAccessView* const*)zero, (const UINT*)zero);
|
||||
|
||||
// 2nd pass for ordered-independent-sorting
|
||||
context->CSSetShader(cs_cube2, NULL, 0);
|
||||
context->CSSetUnorderedAccessViews(0, 1, &target.UAV, (UINT*)zero);
|
||||
context->CSSetShaderResources(0, 2, oitSRVs);
|
||||
context->CSSetShaderResources(2, 1, &source);
|
||||
|
||||
context->Dispatch(SCREENWIDTH / 16, SCREENHEIGHT / 16, 1);
|
||||
|
||||
context->CSSetShader(NULL, NULL, 0);
|
||||
context->CSSetUnorderedAccessViews(0, 1, (ID3D11UnorderedAccessView* const*)zero, (UINT*)zero);
|
||||
context->CSSetShaderResources(0, 3, (ID3D11ShaderResourceView* const *)zero);
|
||||
}
|
||||
|
||||
#pragma code_seg(".DrawInstancedCubes")
|
||||
INLINE void DrawInstancedCubes()
|
||||
{
|
||||
// Create cube instances
|
||||
context->CSSetShader(cs_cubeInstances, NULL, 0);
|
||||
context->CSSetUnorderedAccessViews(0, 3, cubeInstanceUAVs, (UINT*)zero);
|
||||
|
||||
context->Dispatch(CUBE_COUNT_X / 4, 1, 1);
|
||||
|
||||
context->CSSetShader(NULL, NULL, 0);
|
||||
context->CSSetUnorderedAccessViews(0, 3, (ID3D11UnorderedAccessView* const*)zero, (UINT*)zero);
|
||||
|
||||
// Determine amont of cubes to draw
|
||||
context->CopyStructureCount(cubeCountBuffer, 0, cubeInstanceUAVs[0]);
|
||||
context->Map(cubeCountBuffer, 0, D3D11_MAP_READ, 0, &mappedSubresource);
|
||||
cubeInstanceCount = *(UINT*)mappedSubresource.pData;
|
||||
context->Unmap(cubeCountBuffer, 0);
|
||||
|
||||
DrawOIT(cubeInstanceWaterSRV, NULL, tex0);
|
||||
|
||||
// 3rd pass for water
|
||||
context->CSSetShader(cs_water, NULL, 0);
|
||||
context->CSSetUnorderedAccessViews(0, 1, &tex1.UAV, (UINT*)zero);
|
||||
context->CSSetShaderResources(0, 1, &tex0.SRV);
|
||||
|
||||
context->Dispatch(SCREENWIDTH / 16, SCREENHEIGHT / 16, 1);
|
||||
|
||||
context->CSSetShader(NULL, NULL, 0);
|
||||
context->CSSetUnorderedAccessViews(0, 1, (ID3D11UnorderedAccessView* const*)zero, (UINT*)zero);
|
||||
context->CSSetShaderResources(0, 1, (ID3D11ShaderResourceView* const *)zero);
|
||||
|
||||
DrawOIT(cubeInstanceLandSRV, tex1.SRV, tex0);
|
||||
}
|
||||
|
||||
#pragma code_seg(".Merge")
|
||||
INLINE void Merge(TEXTURE_2D_SRV_UAV_RTV& blurTex, ID3D11UnorderedAccessView* target, ID3D11ComputeShader* cs)
|
||||
{
|
||||
Blur(blurTex);
|
||||
ID3D11ShaderResourceView* mergeSRV[] = { blurTex.SRV, blurTex1.SRV, blurTex8.SRV, blurTex32.SRV };
|
||||
context->CSSetUnorderedAccessViews(0, 1, &target, NULL);
|
||||
context->CSSetShaderResources(0, 4, mergeSRV);
|
||||
context->CSSetShader(cs, NULL, 0);
|
||||
context->Dispatch(SCREENWIDTH / 16, SCREENHEIGHT / 16, 1);
|
||||
context->CSSetShaderResources(0, 4, (ID3D11ShaderResourceView* const *)zero);
|
||||
}
|
||||
|
||||
#pragma code_seg(".IntroUpdate")
|
||||
INLINE void IntroUpdate(float _introPosition)
|
||||
{
|
||||
Clear();
|
||||
UpdateConstantBuffers(_introPosition);
|
||||
|
||||
FillCubeTextures();
|
||||
|
||||
context->CSSetConstantBuffers(0, 2, constantBuffers);
|
||||
context->VSSetConstantBuffers(0, 2, constantBuffers);
|
||||
context->PSSetConstantBuffers(0, 2, constantBuffers);
|
||||
|
||||
context->PSSetSamplers(0, 1, &samplerState);
|
||||
context->CSSetSamplers(0, 1, &samplerState);
|
||||
|
||||
context->RSSetViewports(1, &swapChainViewport);
|
||||
context->RSSetState(solidNoCullingRasterState);
|
||||
|
||||
if (_introPosition < 18) // Part 1
|
||||
{
|
||||
RenderCubes();
|
||||
context->ResolveSubresource(tex1.TEX, 0, msTex.TEX, 0, DXGI_FORMAT_R16G16B16A16_FLOAT);
|
||||
}
|
||||
else // Part 2
|
||||
{
|
||||
DrawInstancedCubes();
|
||||
Merge(tex0, tex1.UAV, cs_Merge);
|
||||
}
|
||||
|
||||
Merge(tex1, backBufferUAV, cs_Transition);
|
||||
|
||||
swapChain->Present(0, 0);
|
||||
}
|
||||
17
hgplus/revision15-8k/src/intro/main.cpp
Normal file
17
hgplus/revision15-8k/src/intro/main.cpp
Normal file
@@ -0,0 +1,17 @@
|
||||
#include "framework/framework.h"
|
||||
#include "intro/intro.h"
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
FrameworkInit();
|
||||
|
||||
do
|
||||
{
|
||||
FrameworkUpdate();
|
||||
} while (FrameworkContinueExecuting());
|
||||
|
||||
FrameworkDispose();
|
||||
ExitProcess(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
242
hgplus/revision15-8k/src/intro/main.release.cpp
Normal file
242
hgplus/revision15-8k/src/intro/main.release.cpp
Normal file
@@ -0,0 +1,242 @@
|
||||
#include <Windows.h>
|
||||
|
||||
#define INLINE __forceinline
|
||||
|
||||
#include "framework/log.h"
|
||||
#include "framework/window.h"
|
||||
#include "framework/directx.h"
|
||||
#include "framework/4klang.h"
|
||||
#include "framework/sound.h"
|
||||
|
||||
#define CompileShader(entryPoint, profile) CompileShader_Release(entryPoint, profile)
|
||||
|
||||
#pragma bss_seg(".shadersbss")
|
||||
static void* shaderCode;
|
||||
static size_t shaderSize;
|
||||
|
||||
#include "framework/sync/usync.h"
|
||||
#include "framework/shaders.h"
|
||||
#include "framework/shaders_shc.h"
|
||||
#include "intro/intro.h"
|
||||
|
||||
#pragma code_seg(".compile")
|
||||
void compile(const char* shaderName, const char* feature)
|
||||
{
|
||||
d3dCompile(merged_hlsl, sizeof(merged_hlsl), NULL, NULL, NULL, shaderName, feature, 0, 0, &shaderBlob, 0);
|
||||
}
|
||||
|
||||
#pragma code_seg(".CreateCS")
|
||||
void CreateCS(const char* shaderName, ID3D11ComputeShader** cs)
|
||||
{
|
||||
compile(shaderName, cs_5_0);
|
||||
device->CreateComputeShader(shaderBlob->GetBufferPointer(), shaderBlob->GetBufferSize(), NULL, cs);
|
||||
}
|
||||
|
||||
#pragma code_seg(".CreateVS")
|
||||
void CreateVS(const char* shaderName, ID3D11VertexShader** vs)
|
||||
{
|
||||
compile(shaderName, vs_5_0);
|
||||
device->CreateVertexShader(shaderBlob->GetBufferPointer(), shaderBlob->GetBufferSize(), NULL, vs);
|
||||
}
|
||||
|
||||
#pragma code_seg(".CreatePS")
|
||||
void CreatePS(const char* shaderName, ID3D11PixelShader** ps)
|
||||
{
|
||||
compile(shaderName, ps_5_0);
|
||||
device->CreatePixelShader(shaderBlob->GetBufferPointer(), shaderBlob->GetBufferSize(), NULL, ps);
|
||||
}
|
||||
|
||||
#pragma code_seg(".main")
|
||||
void main()
|
||||
{
|
||||
CreateThread(0, 0, (LPTHREAD_START_ROUTINE)_4klang_render, soundBuffer, 0, 0);
|
||||
windowHandle = CreateWindowExA(0, (LPCSTR)0x0000C019, 0, WS_VISIBLE | WS_MAXIMIZE, 0, 0, 0, 0, 0, 0, 0, 0);
|
||||
ShowCursor(false);
|
||||
swapChainDesc.OutputWindow = windowHandle;
|
||||
D3D11CreateDeviceAndSwapChain(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, D3D_DEVICE_FLAGS, NULL, 0, D3D11_SDK_VERSION, &swapChainDesc, &swapChain, &device, NULL, &context);
|
||||
swapChain->GetBuffer(0, __uuidof(ID3D11Texture2D), (LPVOID*)&backBufferTexture);
|
||||
device->CreateUnorderedAccessView(backBufferTexture, &backBufferUAVdesc, &backBufferUAV);
|
||||
|
||||
HINSTANCE hl = LoadLibrary(d3dcompiler);
|
||||
if (!hl)
|
||||
{
|
||||
d3dcompiler[13] = '3';
|
||||
hl = LoadLibrary(d3dcompiler);
|
||||
}
|
||||
d3dCompile = (pD3DCompile)GetProcAddress(hl, "D3DCompile");
|
||||
|
||||
// FrameworkShadersCompile
|
||||
|
||||
CreateCS("cs_texture", &cs_texture);
|
||||
CreateCS("cs_BlurH", &cs_BlurH);
|
||||
CreateCS("cs_BlurV", &cs_BlurV);
|
||||
CreateCS("cs_Merge", &cs_Merge);
|
||||
CreateCS("cs_Transition", &cs_Transition);
|
||||
CreateCS("cs_cubeInstances", &cs_cubeInstances);
|
||||
CreateCS("cs_cube2", &cs_cube2);
|
||||
CreateCS("cs_water", &cs_water);
|
||||
CreateVS("vs_cube", &vs_cube);
|
||||
CreateVS("vs_cube2", &vs_cube2);
|
||||
CreatePS("ps_cube", &ps_cube);
|
||||
CreatePS("ps_cube2", &ps_cube2);
|
||||
|
||||
// IntroInit
|
||||
device->CreateBuffer(&constantBuffer1Desc, NULL, &constantBuffers[0]);
|
||||
device->CreateBuffer(&constantBufferSyncDesc, NULL, &constantBuffers[1]);
|
||||
device->CreateBuffer(&cubeCountBufferDesc, NULL, &cubeCountBuffer);
|
||||
device->CreateBuffer(&cubeInstanceBufferDesc1, NULL, &cubeInstanceBufferWater);
|
||||
device->CreateBuffer(&cubeInstanceBufferDesc1, NULL, &cubeInstanceBufferLand);
|
||||
device->CreateBuffer(&flBufferDesc, NULL, &flBuffer);
|
||||
device->CreateBuffer(&soBufferDesc, NULL, &soBuffer);
|
||||
|
||||
device->CreateTexture3D(&cubeInstanceBufferDesc2, NULL, &cubeInstanceBuffer2);
|
||||
|
||||
device->CreateUnorderedAccessView(cubeInstanceBufferLand, &cubeInstanceUAV1desc, &cubeInstanceUAVs[0]);
|
||||
device->CreateUnorderedAccessView(cubeInstanceBufferWater, &cubeInstanceUAV1desc, &cubeInstanceUAVs[1]);
|
||||
device->CreateUnorderedAccessView(cubeInstanceBuffer2, NULL, &cubeInstanceUAVs[2]);
|
||||
device->CreateUnorderedAccessView(flBuffer, &flBufferUAVDesc, &oitUAVs[0]);
|
||||
device->CreateUnorderedAccessView(soBuffer, &soBufferUAVDesc, &oitUAVs[1]);
|
||||
|
||||
device->CreateShaderResourceView(cubeInstanceBufferWater, NULL, &cubeInstanceWaterSRV);
|
||||
device->CreateShaderResourceView(cubeInstanceBufferLand, NULL, &cubeInstanceLandSRV);
|
||||
device->CreateShaderResourceView(flBuffer, &flBufferSRVDesc, &oitSRVs[0]);
|
||||
device->CreateShaderResourceView(soBuffer, &soBufferSRVDesc, &oitSRVs[1]);
|
||||
|
||||
device->CreateSamplerState(&clampSamplerDesc, &samplerState);
|
||||
|
||||
device->CreateRasterizerState(&solidNoCullingRasterDesc, &solidNoCullingRasterState);
|
||||
|
||||
_asm
|
||||
{
|
||||
push SCREENHEIGHT
|
||||
push SCREENWIDTH
|
||||
push offset msTex
|
||||
push SCREENHEIGHT
|
||||
push SCREENWIDTH
|
||||
push offset blurTex1
|
||||
push SCREENHEIGHT
|
||||
push SCREENWIDTH
|
||||
push offset tmpTex1
|
||||
push SCREENHEIGHT
|
||||
push SCREENWIDTH
|
||||
push offset tex0
|
||||
push SCREENHEIGHT
|
||||
push SCREENWIDTH
|
||||
push offset tex1
|
||||
push 512
|
||||
push 512
|
||||
push offset cubeTexture4
|
||||
push 512
|
||||
push 512
|
||||
push offset cubeTexture3
|
||||
push 512
|
||||
push 512
|
||||
push offset cubeTexture2
|
||||
push 512
|
||||
push 512
|
||||
push offset cubeTexture1
|
||||
push SCREENHEIGHT / 32
|
||||
push SCREENWIDTH / 32
|
||||
push offset blurTex32
|
||||
push SCREENHEIGHT / 32
|
||||
push SCREENWIDTH / 32
|
||||
push offset tmpTex32
|
||||
push SCREENHEIGHT / 8
|
||||
push SCREENWIDTH / 8
|
||||
push offset blurTex8
|
||||
push SCREENHEIGHT / 8
|
||||
push SCREENWIDTH / 8
|
||||
push offset tmpTex8
|
||||
call dword ptr[createSRVUAVRTV]
|
||||
call dword ptr[createSRVUAVRTV]
|
||||
call dword ptr[createSRVUAVRTV]
|
||||
call dword ptr[createSRVUAVRTV]
|
||||
call dword ptr[createSRVUAVRTV]
|
||||
call dword ptr[createSRVUAVRTV]
|
||||
call dword ptr[createSRVUAVRTV]
|
||||
call dword ptr[createSRVUAVRTV]
|
||||
call dword ptr[createSRVUAVRTV]
|
||||
call dword ptr[createSRVUAVRTV]
|
||||
call dword ptr[createSRVUAVRTV]
|
||||
call dword ptr[createSRVUAVRTV]
|
||||
mov ecx, 0Bh
|
||||
mov esi, offset msTexDesc
|
||||
mov edi, offset standardTexDesc
|
||||
rep movs dword ptr es : [edi], dword ptr[esi]
|
||||
call dword ptr[createSRVUAVRTV]
|
||||
}
|
||||
/*createSRVUAVRTV(&tex0, SCREENWIDTH, SCREENHEIGHT);
|
||||
createSRVUAVRTV(&tex1, SCREENWIDTH, SCREENHEIGHT);
|
||||
createSRVUAVRTV(&tmpTex1, SCREENWIDTH, SCREENHEIGHT);
|
||||
createSRVUAVRTV(&blurTex1, SCREENWIDTH, SCREENHEIGHT);
|
||||
createSRVUAVRTV(&tmpTex8, SCREENWIDTH / 8, SCREENHEIGHT / 8);
|
||||
createSRVUAVRTV(&blurTex8, SCREENWIDTH / 8, SCREENHEIGHT / 8);
|
||||
createSRVUAVRTV(&tmpTex32, SCREENWIDTH / 32, SCREENHEIGHT / 32);
|
||||
createSRVUAVRTV(&blurTex32, SCREENWIDTH / 32, SCREENHEIGHT / 32);
|
||||
createSRVUAVRTV(&cubeTexture1, 512, 512);
|
||||
createSRVUAVRTV(&cubeTexture2, 512, 512);
|
||||
createSRVUAVRTV(&cubeTexture3, 512, 512);
|
||||
createSRVUAVRTV(&cubeTexture4, 512, 512);
|
||||
standardTexDesc = msTexDesc;
|
||||
createSRVUAVRTV(&msTex, SCREENWIDTH, SCREENHEIGHT);*/
|
||||
|
||||
FillCubeTextures();
|
||||
|
||||
context->CSSetConstantBuffers(0, 2, constantBuffers);
|
||||
context->VSSetConstantBuffers(0, 2, constantBuffers);
|
||||
context->PSSetConstantBuffers(0, 2, constantBuffers);
|
||||
|
||||
context->PSSetSamplers(0, 1, &samplerState);
|
||||
context->CSSetSamplers(0, 1, &samplerState);
|
||||
|
||||
context->RSSetViewports(1, &swapChainViewport);
|
||||
context->RSSetState(solidNoCullingRasterState);
|
||||
|
||||
waveOutOpen(&hWaveOut, -1, &WaveFMT, 0, 0, 0);
|
||||
waveOutWrite(hWaveOut, &WaveHDR, 0x20);
|
||||
|
||||
float t;
|
||||
do
|
||||
{
|
||||
context->ClearUnorderedAccessViewUint(tex1.UAV, (const UINT*)zero);
|
||||
context->ClearUnorderedAccessViewUint(cubeInstanceUAVs[2], (UINT*)zero);
|
||||
|
||||
waveOutGetPosition(hWaveOut, &mmtime, sizeof(MMTIME));
|
||||
t = mmtime.u.sample / (float)(SAMPLES_PER_TICK * SOUND_TICKS_PER_SCENE);
|
||||
|
||||
// Update constant buffer 1
|
||||
{
|
||||
context->Map(constantBuffers[0], 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedSubresource);
|
||||
auto constantBufferData = (ConstantBuffer1Type*)mappedSubresource.pData;
|
||||
constantBufferData->time = t;
|
||||
constantBufferData->screenWidth = SCREENWIDTH;
|
||||
constantBufferData->aspect = aspectRatio;
|
||||
context->Unmap(constantBuffers[0], 0);
|
||||
}
|
||||
|
||||
// Update sync constant buffer
|
||||
{
|
||||
context->Map(constantBuffers[1], 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedSubresource);
|
||||
auto constantBufferData = (SYNC_TYPE_NAME*)mappedSubresource.pData;
|
||||
usync_update(t * SYNC_ROWS_PER_SCENE, (float*)constantBufferData);
|
||||
context->Unmap(constantBuffers[1], 0);
|
||||
}
|
||||
|
||||
if (t < 18) // Part 1
|
||||
{
|
||||
RenderCubes();
|
||||
context->ResolveSubresource(tex1.TEX, 0, msTex.TEX, 0, DXGI_FORMAT_R16G16B16A16_FLOAT);
|
||||
}
|
||||
else // Part 2
|
||||
{
|
||||
DrawInstancedCubes();
|
||||
Merge(tex0, tex1.UAV, cs_Merge);
|
||||
}
|
||||
|
||||
Merge(tex1, backBufferUAV, cs_Transition);
|
||||
swapChain->Present(0, 0);
|
||||
} while (mmtime.u.sample < MAX_SAMPLES && !GetAsyncKeyState(VK_ESCAPE));
|
||||
|
||||
ExitProcess(0);
|
||||
}
|
||||
|
||||
26
hgplus/revision15-8k/src/intro/shaders/intro.hlsl
Normal file
26
hgplus/revision15-8k/src/intro/shaders/intro.hlsl
Normal file
@@ -0,0 +1,26 @@
|
||||
#include "lib/structs.hlsl"
|
||||
|
||||
RWTexture2D<float4> o2d0 : register(u0);
|
||||
RWTexture2D<float4> o2d1 : register(u1);
|
||||
RWTexture2D<float4> o2d2 : register(u2);
|
||||
RWTexture2D<float4> o2d3 : register(u3);
|
||||
AppendStructuredBuffer<CIT> ap0 : register(u0);
|
||||
AppendStructuredBuffer<CIT> ap1 : register(u1);
|
||||
RWTexture3D<uint> o3d2 : register(u2);
|
||||
RWStructuredBuffer<OIT> oitu0 : register(u0);
|
||||
RWByteAddressBuffer oitu1 : register(u1);
|
||||
Texture2D t2d0 : register(t0);
|
||||
Texture2D t2d1 : register(t1);
|
||||
Texture2D t2d2 : register(t2);
|
||||
Texture2D t2d3 : register(t3);
|
||||
StructuredBuffer<CIT> cit0 : register(t0);
|
||||
StructuredBuffer<OIT> oitt0 : register(t0);
|
||||
Buffer<uint> oitt1 : register(t1);
|
||||
SamplerState samplerState : register(s0);
|
||||
|
||||
#include "lib/constants.hlsl"
|
||||
#include "lib/functions.hlsl"
|
||||
|
||||
#include "parts/shared.hlsl"
|
||||
#include "parts/part1.hlsl"
|
||||
#include "parts/part2.hlsl"
|
||||
22
hgplus/revision15-8k/src/intro/shaders/lib/constants.hlsl
Normal file
22
hgplus/revision15-8k/src/intro/shaders/lib/constants.hlsl
Normal file
@@ -0,0 +1,22 @@
|
||||
#include "structs.hlsl"
|
||||
|
||||
//[
|
||||
cbuffer _cb0 : register(b0)
|
||||
{
|
||||
//]
|
||||
float time;
|
||||
float screenWidth;
|
||||
float aspectRatio;
|
||||
float dummy;
|
||||
//[
|
||||
}
|
||||
//]
|
||||
|
||||
//[
|
||||
cbuffer _cb1 : register(b1)
|
||||
{
|
||||
//]
|
||||
ST _s;
|
||||
//[
|
||||
}
|
||||
//]
|
||||
146
hgplus/revision15-8k/src/intro/shaders/lib/functions.hlsl
Normal file
146
hgplus/revision15-8k/src/intro/shaders/lib/functions.hlsl
Normal file
@@ -0,0 +1,146 @@
|
||||
#define pi 3.141592
|
||||
|
||||
float hash(float n)
|
||||
{
|
||||
return frac(sin(n)*43758.5453123);
|
||||
}
|
||||
|
||||
//float expf(float x) {
|
||||
// return asfloat(int(12102203 * x + 1064866805));
|
||||
//}
|
||||
|
||||
float noise2(float2 x)
|
||||
{
|
||||
float2 p = floor(x);
|
||||
float2 f = frac(x);
|
||||
f = f*f*(3 - 2*f);
|
||||
|
||||
float n = p.x + p.y*157;
|
||||
return lerp(lerp(hash(n), hash(n + 1), f.x), lerp(hash(n + 157), hash(n + 158), f.x), f.y);
|
||||
}
|
||||
|
||||
float noise3(float3 x)
|
||||
{
|
||||
float3 p = floor(x);
|
||||
float3 f = frac(x);
|
||||
f = f*f*(3 - 2*f);
|
||||
|
||||
float n = p.x + p.y*157 + 113*p.z;
|
||||
return lerp(
|
||||
lerp(lerp(hash(n), hash(n + 1), f.x), lerp(hash(n + 157), hash(n + 158), f.x), f.y),
|
||||
lerp(lerp(hash(n + 113), hash(n + 114), f.x), lerp(hash(n + 270), hash(n + 271), f.x), f.y), f.z);
|
||||
}
|
||||
|
||||
float smoothnoise(float2 uv, float scale)
|
||||
{
|
||||
float2x2 r = { 1.1, 0.9, -0.9, 1.1 };
|
||||
float n = 0;
|
||||
for (int i = 1; i < 8; ++i)
|
||||
{
|
||||
n += noise2(uv * scale) / pow(2, i);
|
||||
uv = mul(uv, r);
|
||||
}
|
||||
return n;
|
||||
}
|
||||
|
||||
float2 r(float2 v, float y)
|
||||
{
|
||||
return cos(y)*v + sin(y)*float2(-v.y, v.x);
|
||||
}
|
||||
|
||||
float4 smin(float4 a, float4 b)
|
||||
{
|
||||
if (a.x < b.x)
|
||||
return a;
|
||||
|
||||
return b;
|
||||
}
|
||||
|
||||
float4 smax(float4 a, float4 b)
|
||||
{
|
||||
if (a.x > b.x)
|
||||
return a;
|
||||
|
||||
return b;
|
||||
}
|
||||
|
||||
float4 sinv(float4 a)
|
||||
{
|
||||
return float4(-a.x, a.y, a.z, a.w);
|
||||
}
|
||||
|
||||
float sdSphere(float3 p, float s)
|
||||
{
|
||||
return length(p) - s;
|
||||
}
|
||||
|
||||
float sdBox(float3 p, float3 b, float r)
|
||||
{
|
||||
float3 d = abs(p) - b;
|
||||
return min(max(d.x, max(d.y, d.z)), 0) +
|
||||
length(max(d, 0)) - r;
|
||||
}
|
||||
|
||||
float sdCylinder(float3 p, float3 c)
|
||||
{
|
||||
return length(p.xz - c.xy) - c.z;
|
||||
}
|
||||
|
||||
float smoothmax(float a, float b, float k)
|
||||
{
|
||||
return log(exp(k*a) + exp(k*b)) / k;
|
||||
}
|
||||
|
||||
float smoothmin(float a, float b, float k)
|
||||
{
|
||||
return -log(exp(-k*a) + exp(-k*b)) / k;
|
||||
}
|
||||
|
||||
//float4 debugGradient(float3 n)
|
||||
//{
|
||||
// float f = length(n);
|
||||
// return float4(lerp(float3(0, 1, 0), float3(1, 0, 0), abs(f - 1)), 1);
|
||||
//}
|
||||
|
||||
float4x4 lookTo(float3 Eye, float3 zaxis, float3 Up)
|
||||
{
|
||||
float3 xaxis = normalize(cross(Up, zaxis));
|
||||
float3 yaxis = cross(zaxis, xaxis);
|
||||
|
||||
float4x4 result = {
|
||||
xaxis, -dot(xaxis, Eye),
|
||||
yaxis, -dot(yaxis, Eye),
|
||||
zaxis, -dot(zaxis, Eye),
|
||||
0, 0, 0, 1
|
||||
};
|
||||
|
||||
return transpose(result);
|
||||
}
|
||||
|
||||
//float3 hsv2rgb(float h, float s, float v)
|
||||
//{
|
||||
// float3 r;
|
||||
// if (s == 0)
|
||||
// return float3(v, v, v);
|
||||
//
|
||||
// float b, e, w, z, y, x;
|
||||
// e = 6*h;
|
||||
// b = floor(e);
|
||||
// e -= b;
|
||||
// w = v*s;
|
||||
// x = y = v;
|
||||
// x -= w;
|
||||
// z = x + w*e;
|
||||
// y += x - z;
|
||||
// float4 f = float4(x, y, z, v);
|
||||
// if (b<1)r = f.wzx;
|
||||
// else if (b<2)r = f.ywx;
|
||||
// else if (b<3)r = f.xwz;
|
||||
// else if (b<4)r = f.xyw;
|
||||
// else if (b<5)r = f.zxw;
|
||||
// else r = f.wxy;
|
||||
// return r;
|
||||
//}
|
||||
float3 hsv2rgb(float h, float s, float v) {
|
||||
return lerp(1,saturate(abs(frac(h+float3(3,2,1)/3)*6-3)-1),s)*v;
|
||||
}
|
||||
143
hgplus/revision15-8k/src/intro/shaders/lib/greeble.hlsl
Normal file
143
hgplus/revision15-8k/src/intro/shaders/lib/greeble.hlsl
Normal file
@@ -0,0 +1,143 @@
|
||||
#include "functions.hlsl"
|
||||
#include "constants.hlsl"
|
||||
|
||||
#define sgn(X) ((X)<0?-1:1)
|
||||
|
||||
float cylsphere(float3 p)
|
||||
{
|
||||
float d = max(sdCylinder(p, float3(0, 0, 0.04)), sdBox(p, 0.25, 0));
|
||||
d = smoothmin(d, sdSphere(p + float3(0, 0.3, 0), 0.08), 48);
|
||||
d = smoothmin(d, sdSphere(p - float3(0, 0.3, 0), 0.08), 48);
|
||||
return d;
|
||||
}
|
||||
|
||||
float4 wasserhahn(float3 p, float phase)
|
||||
{
|
||||
float t = (phase + time * 2) % 1;
|
||||
float rotation = sgn(phase - 0.5) * min(1, max(0, -0.2 + 5 * t)) * pi / 2;
|
||||
float translation = min(1, max(0, 2 * sin(min(t - 0.02, 0.5) * 10)));
|
||||
|
||||
float d = sdBox(p, 0.4, 0.075);
|
||||
float e = sdSphere(p - float3(0, 0.6, 0), 0.2);
|
||||
d = smoothmax(d, -e, 32);
|
||||
p.y -= translation * 0.2 - 0.2;
|
||||
float2 uv = p.xz+0.5;
|
||||
p.xz = r(p.xz, rotation);
|
||||
e = max(sdCylinder(p, float3(0, 0, 0.05)), sdBox(p, 0.8, 0));
|
||||
float3 q = p;
|
||||
q *= 1.25;
|
||||
q.y -= 1;
|
||||
q.yz = r(q.yz, pi / 2);
|
||||
e = smoothmin(e, cylsphere(q), 16);
|
||||
q.xy = r(q.xy, pi / 2);
|
||||
e = smoothmin(e, cylsphere(q), 16);
|
||||
return smin(float4(d, 0, uv), float4(e, 1, uv));
|
||||
}
|
||||
|
||||
float4 kupplung(float3 p, float phase)
|
||||
{
|
||||
float d = sdBox(p, 0.425, 0.05);
|
||||
d = smoothmax(d, -sdBox(p + float3(0, 0, 0.3), float3(0.3, 1, 0.01), 0), 32);
|
||||
d = smoothmax(d, -sdBox(p - float3(0, 0, 0.3), float3(0.3, 1, 0.01), 0), 32);
|
||||
d = smoothmax(d, -sdBox(p + float3(0.3, 0, 0), float3(0.01, 1, 0.3), 0), 32);
|
||||
d = smoothmax(d, -sdBox(p - float3(0.3, 0, 0), float3(0.01, 1, 0.3), 0), 32);
|
||||
|
||||
float t = (phase + sgn(phase - 0.5) * time * 2) % 1;
|
||||
float x = max(-1, min(1, 4*cos(t*2*pi)));
|
||||
float y = max(-1, min(1, 4*sin(t*2*pi)));
|
||||
x *= 0.3;
|
||||
y *= 0.3;
|
||||
float3 q = p + float3(x, 0, y);
|
||||
float e = sdBox(q, float3(0.03, 0.75, 0.03), 0);
|
||||
q.y -= 0.75;
|
||||
e = smoothmin(e, sdSphere(q, 0.1), 32);
|
||||
return smin(float4(d, 2, p.xz+0.5), float4(e, 3.0, p.xz+0.5));
|
||||
}
|
||||
|
||||
float4 hebel(float3 p, float phase)
|
||||
{
|
||||
float d = sdBox(p + float3(0, 0.1, 0), 0.425, 0.05);
|
||||
d = smoothmax(d, -sdBox(p + float3(0.2, 0, 0), float3(0.01, 0.5, 0.3), 0), 32);
|
||||
d = smoothmax(d, -sdBox(p - float3(0.2, 0, 0), float3(0.01, 0.5, 0.3), 0), 32);
|
||||
|
||||
float x = pow((phase + sgn(phase - 0.5) * time * 2) % 1.0, 2) * 2 * pi;
|
||||
float t = max(-0.5, min(0.5, sin(x)));
|
||||
float2 uv = p.xz+0.5;
|
||||
p.yz = r(p.yz, t);
|
||||
float3 q = p + float3(0, 0.3, 0);
|
||||
float e = sdBox(q - float3(0.2, 0, 0), float3(0.02, 1, 0.02), 0);
|
||||
e = min(e, sdBox(q + float3(0.2, 0, 0), float3(0.02, 1, 0.02), 0));
|
||||
e = min(e, sdBox(q - float3(0, 1, 0), float3(0.175, 0.02, 0.02), 0));
|
||||
e = smoothmin(e, sdSphere(q - float3(0.2, 1.01, 0), 0.03), 32);
|
||||
e = smoothmin(e, sdSphere(q - float3(-0.2, 1.01, 0), 0.03), 32);
|
||||
q.y -= 1;
|
||||
q.xy = r(q.xy, pi / 2);
|
||||
e = smoothmin(e*0.75, max(sdCylinder(q, float3(0, 0, 0.03)), sdBox(q, 0.1, 0)), 32);
|
||||
return smin(float4(d, 4, uv), float4(e, 5, uv));
|
||||
}
|
||||
|
||||
float4 igel(float3 p, float phase)
|
||||
{
|
||||
float d = sdBox(p, 0.4, 0.08);
|
||||
int2 i = int2(p.xz / 0.15 + floor(phase * 815));
|
||||
float phase2 = noise2(float2(i));
|
||||
float3 q = p;
|
||||
q.xz = (q.xz % 0.15) * sgn(q.xz);
|
||||
q.xz -= 0.075;
|
||||
q.y -= 0.5;
|
||||
float hole = max(sdBox(q, float3(0.05, 1, 0.05), 0), sdBox(p, float3(0.3, 2, 0.3), 0));
|
||||
d = smoothmax(d, -hole, 96);
|
||||
|
||||
float t = phase2 * 2 * pi + time * 32;
|
||||
q.y -= 0.1 * max(-0.5, min(0.5, sin(t)));
|
||||
q.y += 0.5;
|
||||
float e = sdBox(q, float3(0.025, 0.6, 0.025), 0);
|
||||
e = max(e, sdBox(p, float3(0.3, 2, 0.3), 0));
|
||||
return smin(float4(d, 6, p.xz+0.5), float4(e, 7, p.xz+0.5));
|
||||
}
|
||||
|
||||
float4 kran(float3 p, float phase)
|
||||
{
|
||||
float angle = floor(phase * 4) * 0.5 * pi;
|
||||
float2 uv = p.xz+0.5;
|
||||
p.xz = r(p.xz, angle);
|
||||
float d = sdBox(p, 0.4, 0.08);
|
||||
d = smoothmax(d, -sdBox(p - float3(0.2, 0, 0.1), float3(0.1, 1, 0.2), 0), 32);
|
||||
d = smoothmax(d, -sdBox(p + float3(0.2, 0, -0.1), float3(0.1, 1, 0.2), 0), 32);
|
||||
float3 q = p - float3(0, 0.8, -0.3);
|
||||
float e = sdBox(q + float3(0, 0.2, 0), float3(0, 0.15, 0), 0.1) / 0.6;
|
||||
q /= 0.6;
|
||||
q.yz = r(q.yz, pi / 2);
|
||||
|
||||
float t = phase + 0.75 * time;
|
||||
angle = 0.45 * max(-1, min(1, 4*cos(t*2*pi)));
|
||||
float y = 0.5 + 0.5 * max(-1, min(1, 4*sin(t*2*pi)));
|
||||
y = pow(y, 1.25 + 0.75 * cos(t*2*pi));
|
||||
q.xy = r(q.xy, angle);
|
||||
q.y += 0.4;
|
||||
|
||||
e = smoothmin(e, cylsphere(q), 16);
|
||||
q += float3(0, 0.35, 0.05);
|
||||
e = min(e, sdBox(q, float3(0, 0, -0.1), 0.2));
|
||||
float f = sdBox(q + float3(0, 0, 1.2 - y), 0.1, 0);
|
||||
return smin(smin(float4(d, 8, uv), float4(e, 9, uv)), float4(f, 10, uv));
|
||||
}
|
||||
|
||||
float4 greeble(float3 p, float findex, float phase)
|
||||
{
|
||||
const int indexCount = 6;
|
||||
int index = int(findex * float(indexCount));
|
||||
p.y -= phase * 0.2 - 0.2;
|
||||
if (index == 1)
|
||||
return igel(p, phase);
|
||||
else if (index == 2)
|
||||
return kupplung(p, phase);
|
||||
else if (index == 3)
|
||||
return hebel(p, phase);
|
||||
else if (index == 4)
|
||||
return wasserhahn(p, phase);
|
||||
else if (index == 5)
|
||||
return kran(p, phase);
|
||||
|
||||
return float4(sdBox(p, 0.4, 0.025), 10, p.xz+0.5);
|
||||
}
|
||||
34
hgplus/revision15-8k/src/intro/shaders/lib/structs.hlsl
Normal file
34
hgplus/revision15-8k/src/intro/shaders/lib/structs.hlsl
Normal file
@@ -0,0 +1,34 @@
|
||||
struct CIT
|
||||
{
|
||||
float3 world;
|
||||
float3 local;
|
||||
int type;
|
||||
uint age;
|
||||
};
|
||||
|
||||
struct CPT
|
||||
{
|
||||
float3 world : S1;
|
||||
float4 local : S2;
|
||||
int type : S3;
|
||||
uint age : S4;
|
||||
float4 pos : SV_POSITION;
|
||||
};
|
||||
|
||||
struct OIT
|
||||
{
|
||||
half4 color;
|
||||
float depth;
|
||||
uint next;
|
||||
};
|
||||
|
||||
[syncstruct]
|
||||
struct ST
|
||||
{
|
||||
float4 cameraPosition;
|
||||
float4 cameraCenter;
|
||||
float4 cameraUp;
|
||||
float fade;
|
||||
float cubeLifetime;
|
||||
float transition;
|
||||
};
|
||||
179
hgplus/revision15-8k/src/intro/shaders/parts/part1.hlsl
Normal file
179
hgplus/revision15-8k/src/intro/shaders/parts/part1.hlsl
Normal file
@@ -0,0 +1,179 @@
|
||||
#include "../lib/greeble.hlsl"
|
||||
|
||||
float4 f(float3 p)
|
||||
{
|
||||
int3 h = int3(p + 1550);
|
||||
float hash = noise2(h.xz * 15.50) * (floor(p.z)-15) / 150;
|
||||
|
||||
h = int3(p + 42);
|
||||
float phase = noise2(h.xz);
|
||||
float3 q = p;
|
||||
q.xz = (q.xz % 1.0) * sgn(q.xz);
|
||||
q -= 0.5;
|
||||
//return smin(
|
||||
// float4(sdBox(q + float3(0,1.5,0), float3(0.5, 0.5, 0.5), 0), hash, 0, 0),
|
||||
// greeble(q, hash, phase));
|
||||
return smin(
|
||||
float4(sdBox(q + float3(0,1.5,0), 0.5, 0), hash, 0, 0),
|
||||
greeble(q, hash, phase));
|
||||
|
||||
}
|
||||
|
||||
float3 colorize(int index)
|
||||
{
|
||||
//if (index <= 9)
|
||||
// return hsv2rgb(1-smoothstep(0,1,hash(index+4)), 0.2, 1.0);
|
||||
//
|
||||
//return 1;
|
||||
return index > 9 ? 1 : hsv2rgb(1-smoothstep(0,1,hash(index+4)), 0.2, 1);
|
||||
}
|
||||
|
||||
float ao(float3 v, float3 n)
|
||||
{
|
||||
int ao_iterations = 10;
|
||||
float ao_step = 0.2;
|
||||
float ao_scale = 0.75;
|
||||
|
||||
float sum = 0;
|
||||
float att = 1;
|
||||
float len = ao_step;
|
||||
|
||||
for (int i = 0; i < ao_iterations; i++)
|
||||
{
|
||||
sum += (len - f(v + n * len).x) * att;
|
||||
len += ao_step;
|
||||
//att *= 0.5;
|
||||
att /= 2;
|
||||
}
|
||||
|
||||
//return 1.0 - max(sum * ao_scale, 0.0);
|
||||
return saturate(1 - sum*ao_scale);
|
||||
}
|
||||
|
||||
[entrypoint(vs)]
|
||||
void vs_cube(uint id : SV_VertexID, out float2 t : X, out float4 p : SV_POSITION)
|
||||
{
|
||||
t = float2((id * 2) & 2, id & 2);
|
||||
p = float4(t * float2(2, -2) + float2(-1, 1), 0, 1);
|
||||
}
|
||||
|
||||
[entrypoint(ps)]
|
||||
float4 ps_cube(sample float2 tex : X) : SV_Target0
|
||||
{
|
||||
float3 p, q;
|
||||
camera(tex, p, q);
|
||||
|
||||
float t_min = ((2-p.y)/q.y);
|
||||
float3 fog = float3(0.7, 0.8, 0.9);
|
||||
|
||||
if (t_min <= 0)
|
||||
return float4(fog, 1);
|
||||
|
||||
//float tanPhi = 0.002 ;
|
||||
//float t_max = t_min + 50.0;
|
||||
//float t = t_min, stepLength = 0;
|
||||
//float functionSign = 1;//f(o) < 0 ? -1 : +1;
|
||||
//float2 intersection = {0, 1000};
|
||||
//float4 d = 0;
|
||||
//float precision = lerp(0.2, 1.0, t_min / 40.0);
|
||||
//for (int i = 0; i < 48; ++i) {
|
||||
// d = f(q*t + p);
|
||||
// float signedRadius = functionSign * d.x * precision;
|
||||
// //float signedRadius = max(functionSign * f(d*t + o), 0);
|
||||
// float radius = abs(signedRadius);
|
||||
// float screenSpaceError = radius / t;
|
||||
//
|
||||
// if (screenSpaceError < intersection.y)
|
||||
// intersection = float2(t, screenSpaceError);
|
||||
// if (screenSpaceError < tanPhi || t > t_max)
|
||||
// break;
|
||||
//
|
||||
// t += signedRadius;
|
||||
//}
|
||||
|
||||
//return float2((t > tmax || intersection.y > tanPhi) && !forceHit ? INFINITY : intersection.x,
|
||||
// functionSign * max(intersection.x * intersection.y, POSITION_EPSILON_MINIMUM));
|
||||
//
|
||||
int maxSteps = 56;
|
||||
float t_max = t_min + 50;
|
||||
float pixelRadius = 0.0001;
|
||||
float omega = 1.2;
|
||||
float t = t_min;
|
||||
float candidate_error = 99999;
|
||||
float candidate_t = t_min;
|
||||
float previousRadius = 0;
|
||||
float stepLength = 0;
|
||||
float4 d = 0;
|
||||
|
||||
for (float i = 0; i < maxSteps; ++i)
|
||||
{
|
||||
float3 tmp = q*t+p;
|
||||
tmp.xz = (tmp.xz % 1.0) * sgn(tmp.xz);
|
||||
tmp -= 0.5;
|
||||
|
||||
d = f(q*t + p);
|
||||
float signedRadius = d.x * lerp(0.6, 1.0, saturate(t_min / 50));
|
||||
float radius = abs(signedRadius);
|
||||
bool sorFail = omega > 1.0 && (radius + previousRadius) < stepLength;
|
||||
if (sorFail)
|
||||
{
|
||||
stepLength -= omega * stepLength;
|
||||
omega = 0.7;
|
||||
}
|
||||
else
|
||||
{
|
||||
stepLength = signedRadius * omega;
|
||||
}
|
||||
previousRadius = radius;
|
||||
float error = radius / (t + t_min);
|
||||
if (!sorFail && error < candidate_error)
|
||||
{
|
||||
candidate_t = t;
|
||||
candidate_error = error;
|
||||
}
|
||||
if (!sorFail && error < pixelRadius || t > t_max)
|
||||
break;
|
||||
t += stepLength;
|
||||
}
|
||||
|
||||
|
||||
//if (t > t_max)
|
||||
// return float4(fog, 1);
|
||||
|
||||
t = candidate_t;
|
||||
|
||||
float3 hit = q*t + p;
|
||||
float2 e = float2(0.001, 0);
|
||||
//float3 normal = normalize(float3(
|
||||
//f(hit + e.xyy).x - f(hit - e.xyy).x,
|
||||
//f(hit + e.yxy).x - f(hit - e.yxy).x,
|
||||
//f(hit + e.yyx).x - f(hit - e.yyx).x) / (2 * e.x));
|
||||
float3 normal = normalize(float3(
|
||||
f(hit + e.xyy).x - f(hit - e.xyy).x,
|
||||
f(hit + e.yxy).x - f(hit - e.yxy).x,
|
||||
f(hit + e.yyx).x - f(hit - e.yyx).x));
|
||||
|
||||
|
||||
//#ifdef DEBUG_GRADIENT
|
||||
// return debugGradient(normal);
|
||||
//#endif
|
||||
//
|
||||
//#ifdef DEBUG_MARCHINGSTEPS
|
||||
// return float4(float3(i / maxSteps, i / maxSteps, i / maxSteps), 1);
|
||||
//#endif
|
||||
|
||||
float fao = ao(hit, normal);
|
||||
|
||||
float3 map = t2d0.Sample(samplerState, d.zw).xyz;
|
||||
float3 ldir = normalize(float3(1, 1, -1));
|
||||
float diffuse = max(0, dot(normal, ldir));
|
||||
float rim = 0.5 * (fao * pow(1 - abs(dot(normal, q)), 4));
|
||||
float specular = map.y * fao * 0.5 * pow(max(0, dot(reflect(q, normal), ldir)), 32);
|
||||
float ambient = 0.5;
|
||||
float3 color = map.x * (ambient + diffuse * ((1 - ambient) + specular)) * colorize(int(d.y)) + rim;
|
||||
color *= fao * clamp(hit.y, 0, 1);
|
||||
|
||||
color = lerp(clamp(color, 0, 1), fog, smoothstep(0, 50, t)); // fog
|
||||
|
||||
return float4(color, 1);
|
||||
}
|
||||
201
hgplus/revision15-8k/src/intro/shaders/parts/part2.hlsl
Normal file
201
hgplus/revision15-8k/src/intro/shaders/parts/part2.hlsl
Normal file
@@ -0,0 +1,201 @@
|
||||
[entrypoint(cs)]
|
||||
[numthreads(16, 1, 1)] void cs_cubeInstances(int3 id:SV_DispatchThreadID)
|
||||
{
|
||||
float seed = 0;
|
||||
float x = floor(noise2(float2(id.x, seed++)) * 128 - 64);
|
||||
float z = floor(noise2(float2(id.x, seed++)) * 128);
|
||||
|
||||
CIT output;
|
||||
uint lifetime = uint(1 + uint(_s.cubeLifetime) * noise2(float2(id.x, seed++)));
|
||||
float3 position = float3(x, 0.5, z);
|
||||
|
||||
output.type = uint(noise3(position * 0.564) * 3);
|
||||
output.local.x = noise3(128.564 * position);
|
||||
output.local.yz = float2(output.local.x, 0);
|
||||
output.world = 2 * position;
|
||||
output.age = 0;
|
||||
|
||||
uint count = 0;
|
||||
int pathLength = 10;
|
||||
int rnd = 4;
|
||||
for (uint i = 0; i < min(50, lifetime); ++i)
|
||||
{
|
||||
//uint3 ipos = uint3(position.x + 128, position.y - 0.5, position.z + 64);
|
||||
//InterlockedAdd(o3d2[ipos], 1, count);
|
||||
InterlockedAdd(o3d2[uint3(position + float3(128,-0.5,64))], 1, count);
|
||||
|
||||
if (--pathLength == 0)
|
||||
{
|
||||
rnd = int(noise2(float2(id.x, seed++)) * 6);
|
||||
pathLength = 2 + int(noise2(float2(id.x, seed++)) * 5);
|
||||
}
|
||||
|
||||
if (rnd == 0) position.x += 1;
|
||||
if (rnd == 1) position.x -= 1;
|
||||
if (rnd == 2) position.z += 1;
|
||||
if (rnd == 3) position.z -= 1;
|
||||
if (rnd > 3) position.y += 1;
|
||||
|
||||
if (count == 0)
|
||||
{
|
||||
ap0.Append(output);
|
||||
output.world.y *= -1;
|
||||
ap1.Append(output);
|
||||
}
|
||||
|
||||
output.age = i + 1;
|
||||
output.local.x = noise3(128.564 * position);
|
||||
output.type = int(noise3(position * 0.564) * 3);
|
||||
output.world = 2 * position;
|
||||
}
|
||||
}
|
||||
|
||||
[entrypoint(vs)]
|
||||
void vs_cube2(uint id : SV_VertexID, uint instanceID : SV_InstanceID, out CPT o)
|
||||
{
|
||||
float indices[36] =
|
||||
{
|
||||
0, 1, 2, 0, 2, 3,
|
||||
4, 5, 6, 4, 6, 7,
|
||||
1, 6, 5, 1, 5, 2,
|
||||
3, 4, 7, 3, 7, 0,
|
||||
3, 2, 5, 3, 5, 4,
|
||||
7, 6, 1, 7, 1, 0
|
||||
};
|
||||
|
||||
float3 vertices[8] =
|
||||
{
|
||||
float3(1, -1, 1),
|
||||
float3(1, 1, 1),
|
||||
float3(-1, 1, 1),
|
||||
float3(-1, -1, 1),
|
||||
|
||||
float3(-1, -1, -1),
|
||||
float3(-1, 1, -1),
|
||||
float3(1, 1, -1),
|
||||
float3(1, -1, -1)
|
||||
};
|
||||
|
||||
CIT input = cit0[instanceID];
|
||||
uint index = id % 36;
|
||||
float3 vertex = vertices[indices[index]];
|
||||
o.local = float4((
|
||||
index < 12 ? vertex.xy :
|
||||
index < 24 ? vertex.xz :
|
||||
vertex.yz
|
||||
) * 0.5 + 0.5, input.local.xy);
|
||||
o.world = input.world + 0.995 * vertex;
|
||||
o.type = input.type;
|
||||
o.age = input.age;
|
||||
|
||||
o.pos = mul(mul(
|
||||
float4(o.world, 1),
|
||||
lookTo(_s.cameraPosition.xyz, normalize((_s.cameraCenter - _s.cameraPosition).xyz), normalize(_s.cameraUp.xyz))),
|
||||
float4x4(
|
||||
1, 0, 0, 0,
|
||||
0, 1.5, 0, 0,
|
||||
0, 0, 1, 1,
|
||||
0, 0, -0.5, 0
|
||||
));
|
||||
}
|
||||
|
||||
[entrypoint(ps)]
|
||||
void ps_cube2(CPT input, float4 screen : SV_Position)
|
||||
{
|
||||
float4 texData = input.type == 0 ? t2d0.Sample(samplerState, input.local.xy) : (input.type == 1 ? t2d1.Sample(samplerState, input.local.xy) : t2d2.Sample(samplerState, input.local.xy));
|
||||
float intensityBoost = 0.8;
|
||||
uint idx = uint((floor(time * 16) + floor(input.local.w*8)) % 8);
|
||||
if ((input.age % 8) == idx)
|
||||
{
|
||||
intensityBoost *= 5 * (1 - pow((time * 16) % 1, 2));
|
||||
}
|
||||
|
||||
float hue = floor(smoothstep(0, 1, input.local.z)*6)/6 + 0.04;
|
||||
float4 color = lerp(float4(texData.www, 1), float4(hsv2rgb(hue, 0.9, intensityBoost), 1) * texData.y, texData.x);
|
||||
color = lerp(color, float4(hsv2rgb(hue, 0.4, intensityBoost * 0.5), 1.5) * texData.y, texData.z);
|
||||
|
||||
uint uPixelCount = oitu0.IncrementCounter();
|
||||
uint2 vPos = uint2(screen.xy);
|
||||
uint uStartOffsetAddress = (screenWidth*vPos.y) + vPos.x;
|
||||
uint uOldStartOffset;
|
||||
oitu1.InterlockedExchange(4 * uStartOffsetAddress, uPixelCount, uOldStartOffset);
|
||||
|
||||
OIT e;
|
||||
e.color = color;
|
||||
e.depth = screen.z;
|
||||
e.next = uOldStartOffset;
|
||||
oitu0[uPixelCount] = e;
|
||||
}
|
||||
|
||||
[entrypoint(cs)]
|
||||
[numthreads(16, 16, 1)] void cs_cube2(uint3 vPos: SV_DispatchThreadID)
|
||||
{
|
||||
float4 tex = t2d2[vPos.xy];
|
||||
|
||||
uint uStartOffsetAddress = (screenWidth*vPos.y) + vPos.x;
|
||||
uint uOffset = oitt1.Load(uStartOffsetAddress);
|
||||
if (uOffset == -1)
|
||||
{
|
||||
o2d0[vPos.xy] = tex;
|
||||
return;
|
||||
}
|
||||
|
||||
static uint addr[56];
|
||||
uint nNumPixels = 0;
|
||||
while (uOffset != -1)
|
||||
{
|
||||
addr[nNumPixels++] = uOffset;
|
||||
uOffset = (nNumPixels >= 56) ? -1 : oitt0[uOffset].next;
|
||||
}
|
||||
|
||||
// sort pixels
|
||||
uint n = nNumPixels;
|
||||
while (n > 0)
|
||||
{
|
||||
uint newn = 0;
|
||||
for (uint i = 1; i < n; ++i)
|
||||
{
|
||||
uint a = addr[i - 1];
|
||||
uint b = addr[i];
|
||||
if (oitt0[a].depth < oitt0[b].depth)
|
||||
{
|
||||
addr[i - 1] = b;
|
||||
addr[i] = a;
|
||||
newn = i;
|
||||
}
|
||||
}
|
||||
n = newn;
|
||||
}
|
||||
|
||||
float3 vCurrentColor = tex.xyz;
|
||||
for (uint k = 0; k < nNumPixels; ++k)
|
||||
{
|
||||
float4 color = oitt0[addr[k]].color;
|
||||
vCurrentColor = lerp(vCurrentColor.xyz, color.xyz, color.w);
|
||||
}
|
||||
|
||||
o2d0[vPos.xy] = float4(vCurrentColor, 1);
|
||||
}
|
||||
|
||||
[entrypoint(cs)]
|
||||
[numthreads(16, 16, 1)] void cs_water(int3 id:SV_DispatchThreadID)
|
||||
{
|
||||
float2 resolution;
|
||||
o2d0.GetDimensions(resolution.x, resolution.y);
|
||||
|
||||
float3 p, q;
|
||||
camera((id.xy + 0.5) / resolution, p, q);
|
||||
|
||||
float t_min = -p.y / q.y;
|
||||
p += q * t_min;
|
||||
t_min = 1 + t_min / 50;
|
||||
float2 n = p.xz;
|
||||
n = float2(smoothnoise(n + time*4, t_min), smoothnoise(n.yx, t_min)) - 0.5;
|
||||
n = float2(smoothnoise(n - time*4, t_min), smoothnoise(n.yx, t_min)) - 0.5;
|
||||
n = float2(smoothnoise(n, t_min), smoothnoise(n.yx + time*4, t_min)) - 0.5;
|
||||
|
||||
float4 t = t2d0[id.xy + (n + 0.1) * 32];
|
||||
float3 sky = lerp(float3(0, 0.05, 0.1), 0, smoothstep(0.1, 0.3, abs(q.y)));
|
||||
sky *= 1 - 0.5 * smoothstep(0, 0.05, -q.y);
|
||||
o2d0[id.xy] = float4(lerp(sky, t.xyz * 0.25, t.w), 1);
|
||||
}
|
||||
130
hgplus/revision15-8k/src/intro/shaders/parts/shared.hlsl
Normal file
130
hgplus/revision15-8k/src/intro/shaders/parts/shared.hlsl
Normal file
@@ -0,0 +1,130 @@
|
||||
[entrypoint(cs)]
|
||||
[numthreads(16, 16, 1)] void cs_texture(int3 id:SV_DispatchThreadID)
|
||||
{
|
||||
float2 s;
|
||||
o2d0.GetDimensions(s.x, s.y);
|
||||
float2 uv = float2(id.xy) / s;
|
||||
float2 r2 = smoothstep(0, 0.1, uv) * smoothstep(-1, -0.9, -uv);
|
||||
float rand = smoothstep(1.4, 1.6, r2.x + r2.y);
|
||||
|
||||
float2 c = floor((uv / 0.95 - 0.025) * 5) % 2;
|
||||
float rand2 = rand * step(2, c.x + c.y) * 0.5;
|
||||
|
||||
float i1 = (1 - 0.1 * smoothstep(0.3, 0.9, smoothnoise(uv, 20))) * (1 - distance(uv, 0.5)) * 0.75;
|
||||
float i2 = (1 - 0.2 * smoothstep(0.4, 1.0, smoothnoise(uv, 40))) * (1 - distance(uv, 0.5)) * 0.25;
|
||||
float i3 = (1 - 0.2 * smoothstep(0.2, 0.8, smoothnoise(uv, 10))) * (1 - distance(uv, 0.5)) * 1.25;
|
||||
|
||||
o2d0[id.xy] = float4(rand, i1, 0, 0.05);
|
||||
o2d1[id.xy] = float4(rand, i2, 0, 0.4);
|
||||
o2d2[id.xy] = float4(rand, i3, rand2, 0.1);
|
||||
|
||||
float2x2 r = { 0.7, -0.7, 0.7, 0.7 };
|
||||
uv = mul(uv, r);
|
||||
uv.x += sin(uv.y*222)*0.002;
|
||||
float salt = pow(smoothnoise(uv, 20)+0.1,8);
|
||||
float pepper = max(0,0.8-pow(1.1-smoothnoise(uv, 25),8));
|
||||
float diffuse = 0.5;
|
||||
diffuse = max(diffuse, smoothnoise(uv, 10)+0.1);
|
||||
diffuse = min(diffuse, smoothnoise(uv, 15)+0.2);
|
||||
diffuse = max(diffuse, salt);
|
||||
diffuse = min(diffuse, pepper);
|
||||
float spec = pow(diffuse * (1-salt) * pepper, 4);
|
||||
o2d3[id.xy] = float4(diffuse*0.5+0.5, spec, 0, 1);
|
||||
}
|
||||
|
||||
//---
|
||||
// Blur
|
||||
//---
|
||||
void bBlur(int3 id, float2 direction)
|
||||
{
|
||||
float2 resolution;
|
||||
o2d0.GetDimensions(resolution.x, resolution.y);
|
||||
|
||||
float2 sourceResolution;
|
||||
t2d0.GetDimensions(sourceResolution.x, sourceResolution.y);
|
||||
|
||||
float mipLevel = log2(sourceResolution.x / resolution.x);
|
||||
|
||||
float2 tc = (id.xy + 0.5) / resolution;
|
||||
float2 d = direction / resolution;
|
||||
|
||||
float4 a = 0;
|
||||
for (float i = -150; i <= 150; ++i)
|
||||
{
|
||||
float weight = exp(-i*i / 5000);
|
||||
float4 b = t2d0.SampleLevel(samplerState, i * d + tc, mipLevel);
|
||||
a += b * weight;
|
||||
}
|
||||
|
||||
o2d0[id.xy] = a / sqrt(5000 * pi);
|
||||
}
|
||||
|
||||
[entrypoint(cs)]
|
||||
[numthreads(16, 16, 1)] void cs_BlurH(int3 id:SV_DispatchThreadID)
|
||||
{
|
||||
bBlur(id, float2(1,0));
|
||||
}
|
||||
|
||||
[entrypoint(cs)]
|
||||
[numthreads(16, 16, 1)] void cs_BlurV(int3 id:SV_DispatchThreadID)
|
||||
{
|
||||
bBlur(id, float2(0, 1));
|
||||
}
|
||||
|
||||
[entrypoint(cs)]
|
||||
[numthreads(16, 16, 1)] void cs_Merge(int3 id:SV_DispatchThreadID)
|
||||
{
|
||||
float2 resolution;
|
||||
o2d0.GetDimensions(resolution.x, resolution.y);
|
||||
|
||||
float2 tc = (id.xy + 0.5) / resolution;
|
||||
|
||||
o2d0[id.xy] = float4(
|
||||
t2d0.SampleLevel(samplerState, tc, 0).xyz +
|
||||
t2d1.SampleLevel(samplerState, tc, 0).xyz +
|
||||
t2d2.SampleLevel(samplerState, tc, 0).xyz * 0.75 +
|
||||
t2d3.SampleLevel(samplerState, tc, 0).xyz * 0.55, 1);
|
||||
}
|
||||
|
||||
[entrypoint(cs)]
|
||||
[numthreads(16, 16, 1)] void cs_Transition(int3 id:SV_DispatchThreadID)
|
||||
{
|
||||
float2 resolution;
|
||||
o2d0.GetDimensions(resolution.x, resolution.y);
|
||||
|
||||
float2 tc = (id.xy + 0.5) / resolution;
|
||||
float vignette = 1.1 - pow(length(tc - 0.5),2);
|
||||
float2 n = tc;
|
||||
float s = 8;
|
||||
n = float2(smoothnoise(n + time, 4), smoothnoise(n.yx, 4))-0.5;
|
||||
n = float2(smoothnoise(n - time, 6), smoothnoise(n.yx, 6))-0.5;
|
||||
n = float2(smoothnoise(n, 8), smoothnoise(n.yx + time, 8))-0.5;
|
||||
tc += n * _s.transition * smoothnoise(n + time * 2, 8);
|
||||
|
||||
float x = clamp(_s.transition, 0, 1);
|
||||
float y = 1 - x;
|
||||
float3 tex0 =
|
||||
lerp(
|
||||
t2d0.SampleLevel(samplerState, tc, 0).xyz,
|
||||
t2d1.SampleLevel(samplerState, tc, 0).xyz, saturate(0.5 * length(tc - 0.5)));
|
||||
|
||||
float3 color = float3(
|
||||
tex0 * y*y*y +
|
||||
t2d1.SampleLevel(samplerState, tc, 0).xyz * 3*x*y*y +
|
||||
t2d2.SampleLevel(samplerState, tc, 0).xyz * 3*x*x*y +
|
||||
t2d3.SampleLevel(samplerState, tc, 0).xyz * x*x*x);
|
||||
|
||||
color = lerp(lerp(0, color, min(1, _s.fade * 2)), 1, max(0, (_s.fade - 0.5) * 2));
|
||||
o2d0[id.xy] = float4(color * vignette, 1);
|
||||
}
|
||||
|
||||
void camera(float2 tc, out float3 p, out float3 q)
|
||||
{
|
||||
float2 sc = (tc * 2 - 1) * float2(aspectRatio, -1);
|
||||
float3 viewDirection = normalize((_s.cameraCenter - _s.cameraPosition).xyz);
|
||||
float3 viewUp = normalize(_s.cameraUp).xyz;
|
||||
p = _s.cameraPosition.xyz;
|
||||
q = mul(
|
||||
transpose(float3x3(cross(viewUp, viewDirection), viewUp, -viewDirection)),
|
||||
normalize(float3(sc, -1 / tan(pi / 6))));
|
||||
}
|
||||
BIN
hgplus/revision15-8k/src/intro/sync_cameraCenter_w.track
Normal file
BIN
hgplus/revision15-8k/src/intro/sync_cameraCenter_w.track
Normal file
Binary file not shown.
BIN
hgplus/revision15-8k/src/intro/sync_cameraCenter_x.track
Normal file
BIN
hgplus/revision15-8k/src/intro/sync_cameraCenter_x.track
Normal file
Binary file not shown.
BIN
hgplus/revision15-8k/src/intro/sync_cameraCenter_y.track
Normal file
BIN
hgplus/revision15-8k/src/intro/sync_cameraCenter_y.track
Normal file
Binary file not shown.
BIN
hgplus/revision15-8k/src/intro/sync_cameraCenter_z.track
Normal file
BIN
hgplus/revision15-8k/src/intro/sync_cameraCenter_z.track
Normal file
Binary file not shown.
BIN
hgplus/revision15-8k/src/intro/sync_cameraPosition_w.track
Normal file
BIN
hgplus/revision15-8k/src/intro/sync_cameraPosition_w.track
Normal file
Binary file not shown.
BIN
hgplus/revision15-8k/src/intro/sync_cameraPosition_x.track
Normal file
BIN
hgplus/revision15-8k/src/intro/sync_cameraPosition_x.track
Normal file
Binary file not shown.
BIN
hgplus/revision15-8k/src/intro/sync_cameraPosition_y.track
Normal file
BIN
hgplus/revision15-8k/src/intro/sync_cameraPosition_y.track
Normal file
Binary file not shown.
BIN
hgplus/revision15-8k/src/intro/sync_cameraPosition_z.track
Normal file
BIN
hgplus/revision15-8k/src/intro/sync_cameraPosition_z.track
Normal file
Binary file not shown.
BIN
hgplus/revision15-8k/src/intro/sync_cameraUp_w.track
Normal file
BIN
hgplus/revision15-8k/src/intro/sync_cameraUp_w.track
Normal file
Binary file not shown.
BIN
hgplus/revision15-8k/src/intro/sync_cameraUp_x.track
Normal file
BIN
hgplus/revision15-8k/src/intro/sync_cameraUp_x.track
Normal file
Binary file not shown.
BIN
hgplus/revision15-8k/src/intro/sync_cameraUp_y.track
Normal file
BIN
hgplus/revision15-8k/src/intro/sync_cameraUp_y.track
Normal file
Binary file not shown.
BIN
hgplus/revision15-8k/src/intro/sync_cameraUp_z.track
Normal file
BIN
hgplus/revision15-8k/src/intro/sync_cameraUp_z.track
Normal file
Binary file not shown.
BIN
hgplus/revision15-8k/src/intro/sync_cubeLifetime.track
Normal file
BIN
hgplus/revision15-8k/src/intro/sync_cubeLifetime.track
Normal file
Binary file not shown.
BIN
hgplus/revision15-8k/src/intro/sync_fade.track
Normal file
BIN
hgplus/revision15-8k/src/intro/sync_fade.track
Normal file
Binary file not shown.
BIN
hgplus/revision15-8k/src/intro/sync_scene.track
Normal file
BIN
hgplus/revision15-8k/src/intro/sync_scene.track
Normal file
Binary file not shown.
BIN
hgplus/revision15-8k/src/intro/sync_transition.track
Normal file
BIN
hgplus/revision15-8k/src/intro/sync_transition.track
Normal file
Binary file not shown.
6
hgplus/revision15-8k/src/shc/App.config
Normal file
6
hgplus/revision15-8k/src/shc/App.config
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
|
||||
</startup>
|
||||
</configuration>
|
||||
593
hgplus/revision15-8k/src/shc/Program.cs
Normal file
593
hgplus/revision15-8k/src/shc/Program.cs
Normal file
@@ -0,0 +1,593 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace shc
|
||||
{
|
||||
class Program
|
||||
{
|
||||
struct EntryPoint
|
||||
{
|
||||
public string TypeName { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Prefix { get; set; }
|
||||
public string[] Parameters { get; set; }
|
||||
}
|
||||
|
||||
struct ShaderInfo
|
||||
{
|
||||
public ShaderInfo(string pointerType, string prefix, string createFunction)
|
||||
: this()
|
||||
{
|
||||
PointerType = pointerType;
|
||||
Prefix = prefix;
|
||||
CreateFunction = createFunction;
|
||||
}
|
||||
|
||||
public string PointerType { get; set; }
|
||||
public string Prefix { get; set; }
|
||||
public string CreateFunction { get; set; }
|
||||
}
|
||||
|
||||
static int Main(string[] args)
|
||||
{
|
||||
Console.WriteLine("shc " + string.Join(" ", args.Select(arg => "\"" + arg + "\"")));
|
||||
|
||||
if (args.Length != 4)
|
||||
{
|
||||
Console.WriteLine("Usage: shc $(HlslInputPath) $(MinifiedHeaderPath) $(ShaderHeaderPath) $(MergedHlslOutputPath) ");
|
||||
return -1;
|
||||
}
|
||||
|
||||
var path = Path.GetFullPath(args[0]);
|
||||
if (!File.Exists(args[0]))
|
||||
{
|
||||
Console.WriteLine("ERROR: " + args[0] + " does not exist!");
|
||||
return -2;
|
||||
}
|
||||
|
||||
var resultLines = new List<string>();
|
||||
var entryPoints = new List<EntryPoint>();
|
||||
string mergedPath = args[3];
|
||||
try
|
||||
{
|
||||
var lines = GetCombinedLinesFromIncludes(path, resultLines, entryPoints);
|
||||
lines.Add(string.Empty);
|
||||
File.WriteAllText(mergedPath, string.Join("\n", lines));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine("ERROR: While loading " + path + ": " + e.Message);
|
||||
return -3;
|
||||
}
|
||||
|
||||
var outputPath = Path.GetFullPath(args[1]);
|
||||
if (File.Exists(outputPath))
|
||||
{
|
||||
File.Delete(outputPath);
|
||||
}
|
||||
|
||||
var toolsLocation = Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location), "..\\tools");
|
||||
try
|
||||
{
|
||||
string arguments = "--hlsl -v -o " + outputPath + " ";
|
||||
if (entryPoints.Count > 0)
|
||||
{
|
||||
arguments += "--no-renaming-list " + string.Join(",", entryPoints.Select(kvp => kvp.Name)) + " ";
|
||||
}
|
||||
arguments += mergedPath;
|
||||
|
||||
Process myProcess = new Process();
|
||||
ProcessStartInfo myProcessStartInfo = new ProcessStartInfo(Path.Combine(toolsLocation, "shader_minifier.exe"), arguments);
|
||||
myProcessStartInfo.UseShellExecute = false;
|
||||
myProcessStartInfo.RedirectStandardOutput = true;
|
||||
myProcess.StartInfo = myProcessStartInfo;
|
||||
myProcess.Start();
|
||||
StreamReader myStreamReader = myProcess.StandardOutput;
|
||||
var output = myStreamReader.ReadToEnd();
|
||||
Console.WriteLine(output);
|
||||
myProcess.WaitForExit();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine("ERROR: While running shader minifier: " + e.Message);
|
||||
return -4;
|
||||
}
|
||||
|
||||
if (!File.Exists(outputPath))
|
||||
{
|
||||
return -5;
|
||||
}
|
||||
|
||||
var outputLines = File.ReadAllLines(outputPath).ToArray();
|
||||
for (int i = 0; i < outputLines.Length; ++i)
|
||||
{
|
||||
if (outputLines[i].Trim() == "char merged_hlsl[] =")
|
||||
{
|
||||
outputLines[i] = "char merged_hlsl[] = \"#define _ [numthreads(16,16,1)]\\n\"";
|
||||
}
|
||||
else if (outputLines[i].Trim() == "\"[numthreads(16,16,1)]\"")
|
||||
{
|
||||
outputLines[i] = " \"_ \"";
|
||||
}
|
||||
}
|
||||
File.WriteAllLines(outputPath, outputLines);
|
||||
|
||||
try
|
||||
{
|
||||
var headerPath = Path.GetFullPath(args[2]);
|
||||
using (var stream = new FileStream(headerPath, FileMode.Create, FileAccess.Write))
|
||||
{
|
||||
using (var writer = new StreamWriter(stream))
|
||||
{
|
||||
if (entryPoints.Count > 0)
|
||||
{
|
||||
writer.WriteLine("#pragma once");
|
||||
writer.WriteLine("// WARNING: This file is autogenerated by shc. Do not edit");
|
||||
writer.WriteLine();
|
||||
writer.WriteLine("#pragma data_seg(\".cs_5_0\")");
|
||||
writer.WriteLine("static char cs_5_0[] = \"cs_5_0\";");
|
||||
writer.WriteLine();
|
||||
writer.WriteLine("#pragma data_seg(\".vs_5_0\")");
|
||||
writer.WriteLine("static char vs_5_0[] = \"vs_5_0\";");
|
||||
writer.WriteLine();
|
||||
writer.WriteLine("#pragma data_seg(\".gs_5_0\")");
|
||||
writer.WriteLine("static char gs_5_0[] = \"gs_5_0\";");
|
||||
writer.WriteLine();
|
||||
writer.WriteLine("#pragma data_seg(\".ds_5_0\")");
|
||||
writer.WriteLine("static char ds_5_0[] = \"ds_5_0\";");
|
||||
writer.WriteLine();
|
||||
writer.WriteLine("#pragma data_seg(\".hs_5_0\")");
|
||||
writer.WriteLine("static char hs_5_0[] = \"hs_5_0\";");
|
||||
writer.WriteLine();
|
||||
writer.WriteLine("#pragma data_seg(\".ps_5_0\")");
|
||||
writer.WriteLine("static char ps_5_0[] = \"ps_5_0\";");
|
||||
writer.WriteLine();
|
||||
writer.WriteLine("#pragma bss_seg(\".shaderbss\")");
|
||||
foreach (var entryPoint in entryPoints)
|
||||
{
|
||||
if (entryPoint.TypeName == "hc")
|
||||
continue;
|
||||
|
||||
foreach (var shaderInfo in GetShaderInfo(entryPoint.TypeName))
|
||||
{
|
||||
writer.WriteLine("static " + shaderInfo.PointerType + "* " + shaderInfo.Prefix + entryPoint.Name + ";");
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var entryPoint in entryPoints)
|
||||
{
|
||||
if (entryPoint.TypeName == "hc")
|
||||
continue;
|
||||
|
||||
if (entryPoint.TypeName == "gs_so" || entryPoint.TypeName == "vs_gs_so")
|
||||
{
|
||||
writer.WriteLine();
|
||||
writer.WriteLine("#pragma data_seg(\"." + entryPoint.Name + "SODeclarations\")");
|
||||
writer.WriteLine("extern D3D11_SO_DECLARATION_ENTRY " + entryPoint.Name + "SODeclarations[" + entryPoint.Parameters[0] + "];");
|
||||
writer.WriteLine();
|
||||
writer.WriteLine("#pragma data_seg(\"." + entryPoint.Name + "Strides\")");
|
||||
writer.WriteLine("extern UINT " + entryPoint.Name + "Strides[" + entryPoint.Parameters[1] + "];");
|
||||
}
|
||||
|
||||
if (entryPoint.TypeName == "vs_il")
|
||||
{
|
||||
writer.WriteLine();
|
||||
writer.WriteLine("#pragma data_seg(\"." + entryPoint.Name + "InputLayoutDesc\")");
|
||||
writer.WriteLine("extern D3D11_INPUT_ELEMENT_DESC " + entryPoint.Name + "InputLayoutDesc[" + entryPoint.Parameters[0] + "];");
|
||||
}
|
||||
}
|
||||
|
||||
writer.WriteLine();
|
||||
writer.WriteLine("#pragma code_seg(\".FrameworkShadersCompile\")");
|
||||
writer.WriteLine("INLINE void FrameworkShadersCompile()");
|
||||
writer.WriteLine("{");
|
||||
foreach (var entryPoint in entryPoints)
|
||||
{
|
||||
if (entryPoint.TypeName == "hc")
|
||||
continue;
|
||||
|
||||
writer.WriteLine("\tCompileShader(\"" + entryPoint.Name + "\", " + entryPoint.Prefix + "_5_0);");
|
||||
foreach (var shaderInfo in GetShaderInfo(entryPoint.TypeName))
|
||||
{
|
||||
if (shaderInfo.CreateFunction == "CreateGeometryShaderWithStreamOutput")
|
||||
{
|
||||
var parameters = string.Join(", ", entryPoint.Parameters);
|
||||
writer.WriteLine("\tdevice->CreateGeometryShaderWithStreamOutput(shaderCode, shaderSize, " + entryPoint.Name + "SODeclarations, " + entryPoint.Parameters[0] + ", " + entryPoint.Name + "Strides, " + entryPoint.Parameters[1] + ", D3D11_SO_NO_RASTERIZED_STREAM, NULL, &" + shaderInfo.Prefix + entryPoint.Name + ");");
|
||||
}
|
||||
else if (shaderInfo.CreateFunction == "CreateInputLayout")
|
||||
{
|
||||
var parameters = string.Join(", ", entryPoint.Parameters);
|
||||
writer.WriteLine("\tdevice->CreateInputLayout(" + entryPoint.Name + "InputLayoutDesc, " + entryPoint.Parameters[0] + ", shaderCode, shaderSize, &" + shaderInfo.Prefix + entryPoint.Name + ");");
|
||||
}
|
||||
else
|
||||
{
|
||||
writer.WriteLine("\tdevice->" + shaderInfo.CreateFunction + "(shaderCode, shaderSize, NULL, &" + shaderInfo.Prefix + entryPoint.Name + ");");
|
||||
}
|
||||
}
|
||||
}
|
||||
writer.WriteLine("}");
|
||||
writer.WriteLine();
|
||||
}
|
||||
|
||||
int iSize = 0;
|
||||
foreach (var line in s_SyncStructLines)
|
||||
{
|
||||
var tokens = line.Split(' ', '\t', ';').Select(t => t.Trim()).Where(t => !string.IsNullOrEmpty(t)).ToList();
|
||||
if (tokens[0] == "struct")
|
||||
{
|
||||
s_SyncStructName = tokens[1];
|
||||
writer.WriteLine(line);
|
||||
continue;
|
||||
}
|
||||
|
||||
int typeIndex = Math.Max(Math.Max(Math.Max(tokens.IndexOf("float"), tokens.IndexOf("float2")), tokens.IndexOf("float3")), tokens.IndexOf("float4"));
|
||||
if (typeIndex != -1)
|
||||
{
|
||||
switch (tokens[typeIndex])
|
||||
{
|
||||
case "float":
|
||||
{
|
||||
RecordSyncVariable(1, tokens[typeIndex + 1]);
|
||||
iSize += 4;
|
||||
break;
|
||||
}
|
||||
case "float2":
|
||||
{
|
||||
RecordSyncVariable(2, tokens[typeIndex + 1]);
|
||||
iSize += 8;
|
||||
break;
|
||||
}
|
||||
case "float3":
|
||||
{
|
||||
RecordSyncVariable(3, tokens[typeIndex + 1]);
|
||||
iSize += 12;
|
||||
break;
|
||||
}
|
||||
case "float4":
|
||||
{
|
||||
RecordSyncVariable(4, tokens[typeIndex + 1]);
|
||||
iSize += 16;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (line.Trim()[0] == '}')
|
||||
{
|
||||
if (iSize % 16 != 0)
|
||||
iSize += 16 - (iSize % 16);
|
||||
|
||||
foreach (var syncVar in s_SyncVariables)
|
||||
{
|
||||
switch (syncVar.Item1)
|
||||
{
|
||||
case 1:
|
||||
writer.WriteLine("\tfloat " + syncVar.Item2 + ";");
|
||||
iSize -= 4;
|
||||
break;
|
||||
case 2:
|
||||
writer.WriteLine("\tfloat " + syncVar.Item2 + "_x;");
|
||||
writer.WriteLine("\tfloat " + syncVar.Item2 + "_y;");
|
||||
iSize -= 8;
|
||||
break;
|
||||
case 3:
|
||||
writer.WriteLine("\tfloat " + syncVar.Item2 + "_x;");
|
||||
writer.WriteLine("\tfloat " + syncVar.Item2 + "_y;");
|
||||
writer.WriteLine("\tfloat " + syncVar.Item2 + "_z;");
|
||||
iSize -= 12;
|
||||
break;
|
||||
case 4:
|
||||
writer.WriteLine("\tfloat " + syncVar.Item2 + "_x;");
|
||||
writer.WriteLine("\tfloat " + syncVar.Item2 + "_y;");
|
||||
writer.WriteLine("\tfloat " + syncVar.Item2 + "_z;");
|
||||
writer.WriteLine("\tfloat " + syncVar.Item2 + "_w;");
|
||||
iSize -= 16;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
int iDummyIndex = 1;
|
||||
|
||||
while (iSize > 0)
|
||||
{
|
||||
writer.WriteLine("\tfloat dummy_" + iDummyIndex++ + ";");
|
||||
iSize -= 4;
|
||||
}
|
||||
writer.WriteLine(line);
|
||||
}
|
||||
else
|
||||
{
|
||||
writer.WriteLine(line);
|
||||
}
|
||||
}
|
||||
|
||||
if (s_SyncStructLines.Count > 0)
|
||||
{
|
||||
writer.WriteLine();
|
||||
writer.WriteLine("#define SYNC_TYPE_NAME " + s_SyncStructName);
|
||||
writer.WriteLine("#define SYNC_VAR_NAME s_" + s_SyncStructName);
|
||||
writer.WriteLine();
|
||||
writer.WriteLine("#pragma bss_seg(\".syncbss\")");
|
||||
writer.WriteLine("static SYNC_TYPE_NAME SYNC_VAR_NAME;");
|
||||
writer.WriteLine();
|
||||
writer.WriteLine("#pragma code_seg(\".SyncInit\")");
|
||||
writer.WriteLine("INLINE void SyncInit()");
|
||||
writer.WriteLine("{");
|
||||
writer.WriteLine("\tif (usync_init() < 0)");
|
||||
writer.WriteLine("\t\treturn;");
|
||||
writer.WriteLine();
|
||||
writer.WriteLine("#ifndef SYNC_PLAYER");
|
||||
foreach (var syncVar in s_SyncVariables)
|
||||
{
|
||||
if (syncVar.Item2.StartsWith("dummy"))
|
||||
continue;
|
||||
|
||||
switch (syncVar.Item1)
|
||||
{
|
||||
case 1:
|
||||
writer.WriteLine("\tusync_get_val(" + syncVar.Item2 + ");");
|
||||
break;
|
||||
case 2:
|
||||
writer.WriteLine("\tusync_get_val(" + syncVar.Item2 + "_x);");
|
||||
writer.WriteLine("\tusync_get_val(" + syncVar.Item2 + "_y);");
|
||||
break;
|
||||
case 3:
|
||||
writer.WriteLine("\tusync_get_val(" + syncVar.Item2 + "_x);");
|
||||
writer.WriteLine("\tusync_get_val(" + syncVar.Item2 + "_y);");
|
||||
writer.WriteLine("\tusync_get_val(" + syncVar.Item2 + "_z);");
|
||||
break;
|
||||
case 4:
|
||||
writer.WriteLine("\tusync_get_val(" + syncVar.Item2 + "_x);");
|
||||
writer.WriteLine("\tusync_get_val(" + syncVar.Item2 + "_y);");
|
||||
writer.WriteLine("\tusync_get_val(" + syncVar.Item2 + "_z);");
|
||||
writer.WriteLine("\tusync_get_val(" + syncVar.Item2 + "_w);");
|
||||
break;
|
||||
}
|
||||
}
|
||||
writer.WriteLine("\tusync_update(0.0f, NULL);");
|
||||
writer.WriteLine("#endif");
|
||||
writer.WriteLine("}");
|
||||
writer.WriteLine();
|
||||
writer.WriteLine("INLINE void SyncUpdate(float t)");
|
||||
writer.WriteLine("{");
|
||||
writer.WriteLine("#ifndef SYNC_PLAYER");
|
||||
writer.WriteLine("\tusync_update(t * SYNC_ROWS_PER_SCENE, NULL);");
|
||||
foreach (var syncVar in s_SyncVariables)
|
||||
{
|
||||
if (syncVar.Item2.StartsWith("dummy"))
|
||||
continue;
|
||||
|
||||
switch (syncVar.Item1)
|
||||
{
|
||||
case 1:
|
||||
writer.WriteLine("\tSYNC_VAR_NAME." + syncVar.Item2 + " = usync_get_val(" + syncVar.Item2 + ");");
|
||||
break;
|
||||
case 2:
|
||||
writer.WriteLine("\tSYNC_VAR_NAME." + syncVar.Item2 + "_x = usync_get_val(" + syncVar.Item2 + "_x);");
|
||||
writer.WriteLine("\tSYNC_VAR_NAME." + syncVar.Item2 + "_y = usync_get_val(" + syncVar.Item2 + "_y);");
|
||||
break;
|
||||
case 3:
|
||||
writer.WriteLine("\tSYNC_VAR_NAME." + syncVar.Item2 + "_x = usync_get_val(" + syncVar.Item2 + "_x);");
|
||||
writer.WriteLine("\tSYNC_VAR_NAME." + syncVar.Item2 + "_y = usync_get_val(" + syncVar.Item2 + "_y);");
|
||||
writer.WriteLine("\tSYNC_VAR_NAME." + syncVar.Item2 + "_z = usync_get_val(" + syncVar.Item2 + "_z);");
|
||||
break;
|
||||
case 4:
|
||||
writer.WriteLine("\tSYNC_VAR_NAME." + syncVar.Item2 + "_x = usync_get_val(" + syncVar.Item2 + "_x);");
|
||||
writer.WriteLine("\tSYNC_VAR_NAME." + syncVar.Item2 + "_y = usync_get_val(" + syncVar.Item2 + "_y);");
|
||||
writer.WriteLine("\tSYNC_VAR_NAME." + syncVar.Item2 + "_z = usync_get_val(" + syncVar.Item2 + "_z);");
|
||||
writer.WriteLine("\tSYNC_VAR_NAME." + syncVar.Item2 + "_w = usync_get_val(" + syncVar.Item2 + "_w);");
|
||||
break;
|
||||
}
|
||||
}
|
||||
writer.WriteLine("#else");
|
||||
writer.WriteLine("\tusync_update(t * SYNC_ROWS_PER_SCENE, (float*)&SYNC_VAR_NAME);");
|
||||
writer.WriteLine("#endif");
|
||||
writer.WriteLine("}");
|
||||
writer.WriteLine();
|
||||
}
|
||||
else
|
||||
{
|
||||
writer.WriteLine();
|
||||
writer.WriteLine("#define SyncInit()");
|
||||
writer.WriteLine("#define SyncUpdate(t)");
|
||||
}
|
||||
writer.Flush();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine("ERROR: While generating shc output: " + e.Message);
|
||||
return -6;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
private static void RecordSyncVariable(int _iSize, string _sSyncVarName)
|
||||
{
|
||||
s_SyncVariables.Add(new Tuple<int, string>(_iSize, _sSyncVarName));
|
||||
}
|
||||
|
||||
private static IEnumerable<ShaderInfo> GetShaderInfo(string p)
|
||||
{
|
||||
if (p == "cs")
|
||||
yield return new ShaderInfo("ID3D11ComputeShader", "", "CreateComputeShader");
|
||||
else if (p == "vs")
|
||||
yield return new ShaderInfo("ID3D11VertexShader", "", "CreateVertexShader");
|
||||
else if (p == "vs_il")
|
||||
{
|
||||
yield return new ShaderInfo("ID3D11VertexShader", "vs_", "CreateVertexShader");
|
||||
yield return new ShaderInfo("ID3D11InputLayout", "il_", "CreateInputLayout");
|
||||
}
|
||||
else if (p == "ds")
|
||||
yield return new ShaderInfo("ID3D11DomainShader", "", "CreateDomainShader");
|
||||
else if (p == "hs")
|
||||
yield return new ShaderInfo("ID3D11HullShader", "", "CreateHullShader");
|
||||
else if (p == "gs")
|
||||
yield return new ShaderInfo("ID3D11GeometryShader", "", "CreateGeometryShader");
|
||||
else if (p == "ps")
|
||||
yield return new ShaderInfo("ID3D11PixelShader", "", "CreatePixelShader");
|
||||
else if (p == "gs_so")
|
||||
yield return new ShaderInfo("ID3D11GeometryShader", "", "CreateGeometryShaderWithStreamOutput");
|
||||
else if (p == "vs_gs_so")
|
||||
{
|
||||
yield return new ShaderInfo("ID3D11VertexShader", "vs_", "CreateVertexShader");
|
||||
yield return new ShaderInfo("ID3D11GeometryShader", "gs_", "CreateGeometryShaderWithStreamOutput");
|
||||
}
|
||||
}
|
||||
|
||||
private static List<string> GetCombinedLinesFromIncludes(string path, List<string> resultLines, List<EntryPoint> entryPoints)
|
||||
{
|
||||
var loadedPaths = new List<string>();
|
||||
AggregateLines(path, resultLines, entryPoints, loadedPaths);
|
||||
return resultLines;
|
||||
}
|
||||
|
||||
private static void AggregateLines(string path, List<string> resultLines, List<EntryPoint> entryPoints, List<string> loadedPaths)
|
||||
{
|
||||
if (loadedPaths.Contains(path))
|
||||
return;
|
||||
|
||||
loadedPaths.Add(path);
|
||||
var basePath = Path.GetDirectoryName(path);
|
||||
var lines = File.ReadAllLines(path);
|
||||
string sEntryPointType = null;
|
||||
string[] entryPointParameters = null;
|
||||
int lineNumber = 1;
|
||||
var enumerator = lines.GetEnumerator();
|
||||
while (enumerator.MoveNext())
|
||||
{
|
||||
var line = (string)enumerator.Current;
|
||||
if (line.StartsWith("#include"))
|
||||
{
|
||||
var includeFile = line.Substring(8).Trim().Split('"')[1];
|
||||
var includePath = Path.GetFullPath(Path.Combine(basePath, includeFile));
|
||||
AggregateLines(includePath, resultLines, entryPoints, loadedPaths);
|
||||
}
|
||||
else if (line.Trim().StartsWith("[entrypoint"))
|
||||
{
|
||||
sEntryPointType = line.Trim().Substring(11).Trim();
|
||||
if (sEntryPointType.StartsWith("("))
|
||||
{
|
||||
entryPointParameters = sEntryPointType.Substring(1, sEntryPointType.Length - 2).Trim().Split(',', ')').Skip(1).ToArray();
|
||||
entryPointParameters = entryPointParameters.Take(entryPointParameters.Length - 1).Select(p => p.Trim()).ToArray();
|
||||
sEntryPointType = sEntryPointType.Substring(1).Split(',', ')')[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
sEntryPointType = "unknown";
|
||||
}
|
||||
|
||||
if (sEntryPointType == "vs_gs_so" || sEntryPointType == "gs_so")
|
||||
{
|
||||
if (entryPointParameters.Length != 2)
|
||||
{
|
||||
throw new Exception("An entry point of type " + sEntryPointType + " needs 2 parameters: (StreamOutputDeclaration count, Stride count)");
|
||||
}
|
||||
}
|
||||
else if (sEntryPointType == "vs_il")
|
||||
{
|
||||
if (entryPointParameters.Length != 1)
|
||||
{
|
||||
throw new Exception("An entry point of type " + sEntryPointType + " needs 1 parameter: (InputElementDesc count)");
|
||||
}
|
||||
}
|
||||
else if (entryPointParameters != null && entryPointParameters.Length != 0)
|
||||
{
|
||||
throw new Exception("An entry point of type " + sEntryPointType + " needs no parameters");
|
||||
}
|
||||
|
||||
resultLines.Add(GetComment(path, lineNumber));
|
||||
}
|
||||
else if (line.Trim().StartsWith("[patchconstantfunc"))
|
||||
{
|
||||
var sEntryPointName = line.Trim().Substring(18).Trim();
|
||||
if (sEntryPointName.StartsWith("("))
|
||||
{
|
||||
sEntryPointName = sEntryPointName.Substring(2).Split('\"', ')')[0];
|
||||
}
|
||||
entryPoints.Add(new EntryPoint() { TypeName = "hc", Name = sEntryPointName });
|
||||
resultLines.Add(line + GetComment(path, lineNumber));
|
||||
}
|
||||
else if (line.Trim() == "[syncstruct]")
|
||||
{
|
||||
int iBracketCount = 0;
|
||||
bool bStructStarted = false;
|
||||
bool bStructFound = false;
|
||||
while (enumerator.MoveNext())
|
||||
{
|
||||
line = (string)enumerator.Current;
|
||||
if (line.Contains('{'))
|
||||
{
|
||||
++iBracketCount;
|
||||
bStructStarted = true;
|
||||
}
|
||||
if (line.Contains('}'))
|
||||
{
|
||||
--iBracketCount;
|
||||
}
|
||||
|
||||
resultLines.Add(line + GetComment(path, lineNumber));
|
||||
s_SyncStructLines.Add(line);
|
||||
++lineNumber;
|
||||
|
||||
if (bStructStarted && iBracketCount == 0)
|
||||
{
|
||||
bStructFound = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!bStructFound)
|
||||
{
|
||||
throw new Exception("[syncstruct] may only be used before a struct");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (sEntryPointType != null)
|
||||
{
|
||||
var tempLine = line.Trim();
|
||||
while (tempLine.StartsWith("["))
|
||||
{
|
||||
var idx = tempLine.IndexOf("]");
|
||||
tempLine = tempLine.Substring(idx + 1).Trim();
|
||||
}
|
||||
var functionName = tempLine.Split(' ')[1].Split('(')[0];
|
||||
entryPoints.Add(new EntryPoint() { TypeName = sEntryPointType.ToLower(), Name = functionName, Prefix = sEntryPointType.ToLower().Substring(0, 2), Parameters = entryPointParameters });
|
||||
sEntryPointType = null;
|
||||
}
|
||||
|
||||
var resultLine = line;
|
||||
var commentIndex = line.IndexOf("//");
|
||||
if (commentIndex != -1)
|
||||
resultLine = resultLine.Substring(0, commentIndex);
|
||||
|
||||
if (line.StartsWith("#"))
|
||||
{
|
||||
resultLines.Add(resultLine);
|
||||
}
|
||||
else
|
||||
{
|
||||
resultLines.Add(resultLine + GetComment(path, lineNumber));
|
||||
}
|
||||
}
|
||||
|
||||
++lineNumber;
|
||||
}
|
||||
}
|
||||
|
||||
private static string GetComment(string path, int lineNumber)
|
||||
{
|
||||
return " /*(" + path + "|" + lineNumber + ")*/";
|
||||
}
|
||||
|
||||
private static List<string> s_SyncStructLines = new List<string>();
|
||||
private static List<Tuple<int, string>> s_SyncVariables = new List<Tuple<int, string>>();
|
||||
private static string s_SyncStructName;
|
||||
}
|
||||
}
|
||||
36
hgplus/revision15-8k/src/shc/Properties/AssemblyInfo.cs
Normal file
36
hgplus/revision15-8k/src/shc/Properties/AssemblyInfo.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("shc")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("shc")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2014")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("8e619b64-e97a-4b10-8e79-96582ebfe084")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
Binary file not shown.
@@ -0,0 +1,6 @@
|
||||
E:\alcatraz\revision15-8k\bin\shc.exe.config
|
||||
E:\alcatraz\revision15-8k\bin\shc.exe
|
||||
E:\alcatraz\revision15-8k\bin\shc.pdb
|
||||
E:\alcatraz\revision15-8k\src\shc\obj\Debug\shc.exe
|
||||
E:\alcatraz\revision15-8k\src\shc\obj\Debug\shc.pdb
|
||||
E:\alcatraz\revision15-8k\src\shc\obj\Debug\shc.csprojResolveAssemblyReference.cache
|
||||
Binary file not shown.
BIN
hgplus/revision15-8k/src/shc/obj/Debug/shc.exe
Normal file
BIN
hgplus/revision15-8k/src/shc/obj/Debug/shc.exe
Normal file
Binary file not shown.
BIN
hgplus/revision15-8k/src/shc/obj/Debug/shc.pdb
Normal file
BIN
hgplus/revision15-8k/src/shc/obj/Debug/shc.pdb
Normal file
Binary file not shown.
50
hgplus/revision15-8k/src/shc/shc.csproj
Normal file
50
hgplus/revision15-8k/src/shc/shc.csproj
Normal file
@@ -0,0 +1,50 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{930621BA-75BE-49FE-80DE-E75E7DC06931}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>shc</RootNamespace>
|
||||
<AssemblyName>shc</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\..\bin\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
7
hgplus/revision15-8k/src/shc/shc.csproj.user
Normal file
7
hgplus/revision15-8k/src/shc/shc.csproj.user
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
|
||||
<StartArguments>shaders\intro.hlsl framework\intro_hlsl.h framework\shaders_shc.h framework\merged.hlsl</StartArguments>
|
||||
<StartWorkingDirectory>E:\alcatraz\revision15-8k\src\intro</StartWorkingDirectory>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
18
hgplus/revision15-8k/src/tool/App.config
Normal file
18
hgplus/revision15-8k/src/tool/App.config
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<configSections>
|
||||
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
|
||||
<section name="tool.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
</sectionGroup>
|
||||
</configSections>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
|
||||
</startup>
|
||||
<userSettings>
|
||||
<tool.Properties.Settings>
|
||||
<setting name="LastLayout" serializeAs="String">
|
||||
<value />
|
||||
</setting>
|
||||
</tool.Properties.Settings>
|
||||
</userSettings>
|
||||
</configuration>
|
||||
13
hgplus/revision15-8k/src/tool/App.xaml
Normal file
13
hgplus/revision15-8k/src/tool/App.xaml
Normal file
@@ -0,0 +1,13 @@
|
||||
<Application x:Class="tool.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
StartupUri="MainWindow.xaml">
|
||||
<Application.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="/Themes/Shared/Controls.xaml" />
|
||||
<ResourceDictionary Source="/Themes/Dark/Theme.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</Application.Resources>
|
||||
</Application>
|
||||
23
hgplus/revision15-8k/src/tool/App.xaml.cs
Normal file
23
hgplus/revision15-8k/src/tool/App.xaml.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
|
||||
namespace tool
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for App.xaml
|
||||
/// </summary>
|
||||
public partial class App : Application
|
||||
{
|
||||
public App()
|
||||
{
|
||||
#if VOID
|
||||
Shutdown();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
27
hgplus/revision15-8k/src/tool/Dialogs/MessageBox.xaml
Normal file
27
hgplus/revision15-8k/src/tool/Dialogs/MessageBox.xaml
Normal file
@@ -0,0 +1,27 @@
|
||||
<Window x:Class="tool.Dialogs.MessageBox"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
mc:Ignorable="d" Title="LavaMold" SizeToContent="WidthAndHeight"
|
||||
d:DesignWidth="500" d:DesignHeight="200" MinWidth="400" WindowStartupLocation="CenterOwner">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Image x:Name="ErrorIcon" Source="/tool;component/Images/bigerror.png" Grid.Row="1" Stretch="Uniform" Width="32" Height="32" Margin="5" VerticalAlignment="Top" />
|
||||
<Image x:Name="InfoIcon" Source="/tool;component/Images/biginfo.png" Grid.Row="1" Stretch="Uniform" Width="32" Height="32" Margin="5" VerticalAlignment="Top" />
|
||||
<TextBlock Grid.Column="1" x:Name="Message" Margin="5,10" FontWeight="Bold" />
|
||||
<TextBox Grid.Row="1" Grid.Column="1" x:Name="Details" TextWrapping="Wrap" IsReadOnly="True" Height="Auto" Margin="5" MaxWidth="800" MaxHeight="700" VerticalAlignment="Top" VerticalScrollBarVisibility="Auto" />
|
||||
<StackPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="2" HorizontalAlignment="Right">
|
||||
<Button Content="Close" Margin="5,10" HorizontalAlignment="Right" Padding="5,3" Click="Button_Click" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Window>
|
||||
|
||||
32
hgplus/revision15-8k/src/tool/Dialogs/MessageBox.xaml.cs
Normal file
32
hgplus/revision15-8k/src/tool/Dialogs/MessageBox.xaml.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace tool.Dialogs
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for MessageBox.xaml
|
||||
/// </summary>
|
||||
public partial class MessageBox : Window
|
||||
{
|
||||
public MessageBox()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void Button_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
28
hgplus/revision15-8k/src/tool/Dialogs/QueryChooseBox.xaml
Normal file
28
hgplus/revision15-8k/src/tool/Dialogs/QueryChooseBox.xaml
Normal file
@@ -0,0 +1,28 @@
|
||||
<Window x:Class="tool.Dialogs.QueryChooseBox"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:tool.Dialogs"
|
||||
mc:Ignorable="d" SizeToContent="WidthAndHeight" Title="8kode"
|
||||
d:DesignHeight="300" d:DesignWidth="300" WindowStartupLocation="CenterOwner">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock x:Name="Message" Margin="5,10" FontWeight="Bold" TextWrapping="Wrap" Height="Auto" VerticalAlignment="Top" />
|
||||
<ItemsControl ItemsSource="{Binding Options, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:QueryChooseBox}}}" Grid.Row="1" HorizontalAlignment="Right">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel Orientation="Horizontal" />
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Button Content="{Binding}" Margin="5,10" HorizontalAlignment="Right" Padding="5,3" Click="Button_Click" />
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</Grid>
|
||||
</Window>
|
||||
39
hgplus/revision15-8k/src/tool/Dialogs/QueryChooseBox.xaml.cs
Normal file
39
hgplus/revision15-8k/src/tool/Dialogs/QueryChooseBox.xaml.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace tool.Dialogs
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for QueryChooseBox.xaml
|
||||
/// </summary>
|
||||
public partial class QueryChooseBox : Window
|
||||
{
|
||||
public QueryChooseBox()
|
||||
{
|
||||
Result = null;
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public string Result { get; private set; }
|
||||
|
||||
private void Button_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Result = (sender as Button).DataContext as string;
|
||||
this.Close();
|
||||
}
|
||||
|
||||
public List<string> Options { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user