mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 11:40:52 +01:00
Compare commits
223 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0abdcbd1f8 | ||
|
|
c20848902e | ||
|
|
f1d3d2c5ce | ||
|
|
c6d941f0cf | ||
|
|
11230fe98f | ||
|
|
170e1ad5af | ||
|
|
100d21196b | ||
|
|
46ca2d2cc5 | ||
|
|
0563a5beb3 | ||
|
|
6d35e339cb | ||
|
|
8a8ed75084 | ||
|
|
fbeb10e8c2 | ||
|
|
be174cc027 | ||
|
|
d1cf753f22 | ||
|
|
6ede21aa14 | ||
|
|
59a1cc899b | ||
|
|
ee7c5d9da1 | ||
|
|
88520e8db5 | ||
|
|
e73bcd57c0 | ||
|
|
cd376711bf | ||
|
|
ca0037a402 | ||
|
|
7aee21b689 | ||
|
|
348ca5b107 | ||
|
|
136d306d1d | ||
|
|
3c14e1d1db | ||
|
|
c058c2e3d4 | ||
|
|
1812e8743d | ||
|
|
036daa2ac8 | ||
|
|
480a0b4a0a | ||
|
|
693769cbd4 | ||
|
|
00fe03b61b | ||
|
|
b761d9a1eb | ||
|
|
3728c7eeee | ||
|
|
dc80060757 | ||
|
|
909bb5936f | ||
|
|
0da7507c64 | ||
|
|
0a195fe3c7 | ||
|
|
64e22fc031 | ||
|
|
1375da7f70 | ||
|
|
6b37906c85 | ||
|
|
6c7dff77c5 | ||
|
|
86a432bdeb | ||
|
|
cb469c4f86 | ||
|
|
dd0be25ab6 | ||
|
|
4471e0ccca | ||
|
|
adece0e39b | ||
|
|
9aed85b4c7 | ||
|
|
3a78a26652 | ||
|
|
498349bbcf | ||
|
|
8b83362c61 | ||
|
|
32caf088ef | ||
|
|
a34006f8ff | ||
|
|
20b9fd3228 | ||
|
|
320aa3f9c0 | ||
|
|
f445addcd5 | ||
|
|
44b00a1fa7 | ||
|
|
909ba41890 | ||
|
|
b5ca9095b0 | ||
|
|
c22a199a5b | ||
|
|
2395b456e2 | ||
|
|
d7414930ff | ||
|
|
796555fad5 | ||
|
|
1e749952db | ||
|
|
e191be3a75 | ||
|
|
ba3bad68c8 | ||
|
|
2bc7e09f65 | ||
|
|
896ac87f04 | ||
|
|
b5c0202647 | ||
|
|
5f5c5f13c9 | ||
|
|
b13af4cd8d | ||
|
|
f64309ba6f | ||
|
|
67ecfe7ddb | ||
|
|
77f7efdf6e | ||
|
|
7d681567d1 | ||
|
|
553a0aca53 | ||
|
|
556fcbf7bd | ||
|
|
3a5ea35c0b | ||
|
|
2fb6f27cd1 | ||
|
|
f57196a481 | ||
|
|
c03569a4e8 | ||
|
|
c8aaab48ad | ||
|
|
a850c722cc | ||
|
|
b9cadc4599 | ||
|
|
eb74c4227f | ||
|
|
ba981a13e0 | ||
|
|
eee7b3c598 | ||
|
|
441bdf628a | ||
|
|
309ef2cea2 | ||
|
|
8b31da2e0a | ||
|
|
59f158b13a | ||
|
|
2301c8d6ee | ||
|
|
0427fa1537 | ||
|
|
f5e5cca2aa | ||
|
|
5c0537f008 | ||
|
|
a2f37d2613 | ||
|
|
f532d90b78 | ||
|
|
785d164d29 | ||
|
|
15823b1cb4 | ||
|
|
d0c317c8b4 | ||
|
|
21ebda05c2 | ||
|
|
8d208dca16 | ||
|
|
03a06cead9 | ||
|
|
a2278f8ef2 | ||
|
|
494c5c3eb3 | ||
|
|
594f53d275 | ||
|
|
9fbb0e6705 | ||
|
|
d1e4a526c0 | ||
|
|
ac38588a56 | ||
|
|
8690c7a3f5 | ||
|
|
cfddef484c | ||
|
|
e804fd3d2a | ||
|
|
976f8d7f76 | ||
|
|
2eb3f234ea | ||
|
|
785025f23c | ||
|
|
29d2320ca3 | ||
|
|
c992ee4d75 | ||
|
|
6247ff4eff | ||
|
|
1570ed1242 | ||
|
|
cc970df3ad | ||
|
|
b1e3885bbb | ||
|
|
0f2ab942e1 | ||
|
|
e32e23de5a | ||
|
|
f1eaf8a268 | ||
|
|
13d9eacbb7 | ||
|
|
da3a865a0a | ||
|
|
5e17f2b08f | ||
|
|
c05a0d4d29 | ||
|
|
54aa6f94dd | ||
|
|
8ce4376a60 | ||
|
|
b342d128d2 | ||
|
|
7d94019722 | ||
|
|
a9e65b46b8 | ||
|
|
96e3a66e5c | ||
|
|
bf75212034 | ||
|
|
f49a106f04 | ||
|
|
37bb98b1f8 | ||
|
|
3461766659 | ||
|
|
2e28361a06 | ||
|
|
824d757771 | ||
|
|
8dc25ed24d | ||
|
|
d4dfb1abe5 | ||
|
|
bae3141481 | ||
|
|
8a7ea5b6f0 | ||
|
|
65d74f53e5 | ||
|
|
3c1bc4ce88 | ||
|
|
a9d06e7612 | ||
|
|
78d5965ba5 | ||
|
|
d113938736 | ||
|
|
92e9d6636d | ||
|
|
7fb7838738 | ||
|
|
a3a2210de3 | ||
|
|
e200cab1fb | ||
|
|
92d8ed539a | ||
|
|
cb9ca3cc3c | ||
|
|
1065df5efd | ||
|
|
20012304bd | ||
|
|
349b366143 | ||
|
|
64ea01a960 | ||
|
|
1ebf093713 | ||
|
|
34fd263625 | ||
|
|
a7a8d25a17 | ||
|
|
7bf3f70e92 | ||
|
|
d37cdaf78c | ||
|
|
a88a1ef72d | ||
|
|
7484fe8fba | ||
|
|
d5fdd9be1f | ||
|
|
1bb0227ff0 | ||
|
|
4c2632710c | ||
|
|
518a366c7e | ||
|
|
07878ad7a7 | ||
|
|
a483c8c88a | ||
|
|
cd74d12812 | ||
|
|
eda5ad606b | ||
|
|
ddefef65ae | ||
|
|
062db741bd | ||
|
|
d46c2da175 | ||
|
|
1c6200666f | ||
|
|
c9666413b2 | ||
|
|
2575786a6e | ||
|
|
149a6280b0 | ||
|
|
340d75c350 | ||
|
|
8d9a0e5142 | ||
|
|
22f0cbd8f7 | ||
|
|
5d443b6452 | ||
|
|
83f8f37dc1 | ||
|
|
cc886ab614 | ||
|
|
4273266950 | ||
|
|
658a0aee7f | ||
|
|
9898c2cf49 | ||
|
|
ddb5d9f3a8 | ||
|
|
f227b3abc0 | ||
|
|
3920da2d9f | ||
|
|
bfbb31aa58 | ||
|
|
799be40018 | ||
|
|
152eb8dd19 | ||
|
|
c168c0fde1 | ||
|
|
af3c90e2a8 | ||
|
|
12e6ef88c3 | ||
|
|
28d74cec56 | ||
|
|
02efd0b41a | ||
|
|
5bf337479f | ||
|
|
3816cdb3e4 | ||
|
|
e54339bb5c | ||
|
|
98d867393c | ||
|
|
8dd9a3c097 | ||
|
|
61d30be6b3 | ||
|
|
7aa85c0b0c | ||
|
|
3574395843 | ||
|
|
13b333dcf6 | ||
|
|
bead08fc7c | ||
|
|
073fb20b66 | ||
|
|
7adca8280c | ||
|
|
61183eaba3 | ||
|
|
477b0460e8 | ||
|
|
dd18105c92 | ||
|
|
585f2467c2 | ||
|
|
0c3e4ea495 | ||
|
|
afe0c95cea | ||
|
|
e84f072278 | ||
|
|
ca0bbab8c0 | ||
|
|
6530b8806c | ||
|
|
294057e3a1 | ||
|
|
a57abb2ca7 |
@@ -10,19 +10,56 @@ pull_requests:
|
||||
do_not_increment_build_number: true
|
||||
|
||||
image: Visual Studio 2017
|
||||
clone_depth: 10
|
||||
install:
|
||||
- ps: if (-Not $env:APPVEYOR_PULL_REQUEST_NUMBER) { cinst msbuild-sonarqube-runner }
|
||||
- ps: >
|
||||
if (-Not $env:APPVEYOR_PULL_REQUEST_NUMBER -And $env:APPVEYOR_REPO_BRANCH -Eq "master")
|
||||
{
|
||||
cinst msbuild-sonarqube-runner;
|
||||
cinst opencover.portable;
|
||||
}
|
||||
|
||||
before_build:
|
||||
- cmd: py -3.5 Resources\buildResourcePack.py --resources-dir .\Resources --out .\Resources\ResourcePack.zip --atlas-tool .\Tools\AtlasTool.exe --no-animations --to-stderr
|
||||
- cmd: py -3.5 -m pip install --user requests
|
||||
- cmd: py -3.5 Tools\download_godotsharp.py
|
||||
- cmd: py -3.5 RUN_THIS.py --no-prompt
|
||||
- cmd: nuget restore SpaceStation14.sln
|
||||
- ps: if (-Not $env:APPVEYOR_PULL_REQUEST_NUMBER) { MSBuild.SonarQube.Runner.exe begin /k:"ss14" /d:"sonar.host.url=https://sonarqube.com" /d:"sonar.login=$env:sonarqubekey" /d:"sonar.organization=space-wizards" }
|
||||
- ps: >
|
||||
if (-Not $env:APPVEYOR_PULL_REQUEST_NUMBER -And $env:APPVEYOR_REPO_BRANCH -Eq "master")
|
||||
{
|
||||
SonarScanner.MSBuild.exe begin /k:"ss14" /d:"sonar.host.url=https://sonarqube.com" /d:"sonar.login=$env:sonarqubekey" /d:"sonar.organization=space-wizards" /d:"sonar.exclusions=SFML/**" /d:sonar.cs.nunit.reportsPaths="$(Get-Location)\nunitTestResult.xml" /d:sonar.cs.opencover.reportsPaths="$(Get-Location)\coverage_report.xml";
|
||||
}
|
||||
|
||||
platform: x64
|
||||
configuration: Debug
|
||||
|
||||
cache:
|
||||
- packages -> **\packages.config
|
||||
- Dependencies
|
||||
- SS14.Client.Godot\.mono\assemblies\GodotSharp.dll
|
||||
- SS14.Client.Godot\.mono\assemblies\LAST_MODIFIED
|
||||
|
||||
build:
|
||||
project: SpaceStation14.sln
|
||||
parallel: true
|
||||
parallel: false
|
||||
verbosity: minimal
|
||||
|
||||
after_build:
|
||||
- ps: if (-Not $env:APPVEYOR_PULL_REQUEST_NUMBER) { MSBuild.SonarQube.Runner.exe end /d:"sonar.login=$env:sonarqubekey" }
|
||||
build_script:
|
||||
- ps: msbuild SpaceStation14.sln /verbosity:minimal /nologo /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" /p:Platform=x64 /p:Configuration=Debug /p:AppVeyor=yes
|
||||
|
||||
test_script:
|
||||
- ps: >
|
||||
if (-Not $env:APPVEYOR_PULL_REQUEST_NUMBER -And $env:APPVEYOR_REPO_BRANCH -Eq "master")
|
||||
{
|
||||
OpenCover.Console.exe -register:user -target:"nunit3-console.exe" -targetargs:".\bin\UnitTesting\SS14.UnitTesting.dll --result:nunitTestResult.xml" -output:".\coverage_report.xml";
|
||||
}
|
||||
else
|
||||
{
|
||||
nunit3-console.exe .\bin\UnitTesting\SS14.UnitTesting.dll;
|
||||
}
|
||||
|
||||
after_test:
|
||||
- ps: >
|
||||
if (-Not $env:APPVEYOR_PULL_REQUEST_NUMBER -And $env:APPVEYOR_REPO_BRANCH -Eq "master")
|
||||
{
|
||||
SonarScanner.MSBuild.exe end /d:"sonar.login=$env:sonarqubekey";
|
||||
}
|
||||
|
||||
@@ -9,3 +9,6 @@ charset = utf-8-bom
|
||||
|
||||
[*.{csproj,xml,yml,dll.config,targets}]
|
||||
indent_size = 2
|
||||
|
||||
[*.gdsl]
|
||||
indent_style = tab
|
||||
|
||||
2
.github/CODEOWNERS
vendored
2
.github/CODEOWNERS
vendored
@@ -3,7 +3,7 @@
|
||||
|
||||
# These owners will be the default owners for everything in the repo.
|
||||
# * @defunkt
|
||||
* @PJB3005 @Silvertorch5
|
||||
* @Acruid @PJB3005 @Silvertorch5
|
||||
|
||||
# Order is important. The last matching pattern has the most precedence.
|
||||
# So if a pull request only touches javascript files, only these owners
|
||||
|
||||
10
.gitignore
vendored
10
.gitignore
vendored
@@ -79,3 +79,13 @@ NetSerializerDebug.dll
|
||||
|
||||
# We're not gonna ship Mac extlibs with the repo due to size. (11 MB)
|
||||
Third-Party/extlibs/Mac/
|
||||
# Or the automatically-fetched Windows natives, for that matter.
|
||||
Third-Party/extlibs/Windows/
|
||||
|
||||
# Actually I'll make this folder because SS14.Shared.Bsdiff isn't third-party is it?
|
||||
Dependencies/
|
||||
|
||||
# Python stuff
|
||||
__pycache__
|
||||
.mypy_cache
|
||||
|
||||
|
||||
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
[submodule "SS14.Shared.Bsdiff"]
|
||||
path = SS14.Shared.Bsdiff
|
||||
url = https://github.com/space-wizards/ss14.shared.bsdiff.git
|
||||
29
.travis.yml
29
.travis.yml
@@ -5,17 +5,34 @@ sudo: false
|
||||
|
||||
os:
|
||||
- linux
|
||||
- osx
|
||||
#- osx
|
||||
|
||||
before_install:
|
||||
- if [ $TRAVIS_OS_NAME = osx ]; then brew update && brew install python3; fi
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- deadsnakes
|
||||
|
||||
packages:
|
||||
- python3.6
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- packages/
|
||||
- Dependencies/
|
||||
- SS14.Client.Godot/.mono/assemblies/
|
||||
|
||||
#before_install:
|
||||
# - if [ $TRAVIS_OS_NAME = osx ]; then brew update && brew upgrade python; fi
|
||||
|
||||
before_script:
|
||||
- "if [ $TRAVIS_OS_NAME = linux ]; then pyenv shell 3.6; fi"
|
||||
- "pip3 install --user requests"
|
||||
- "nuget restore SpaceStation14.sln"
|
||||
- "python3.6 RUN_THIS.py --no-prompt"
|
||||
- "Tools/download_godotsharp.py"
|
||||
|
||||
script:
|
||||
- "python3 ./Resources/buildResourcePack.py --resources-dir ./Resources --out ./Resources/ResourcePack.zip --no-atlas --no-animations --to-stderr"
|
||||
- "msbuild /p:Configuration=Release /p:HEADLESS=1 /nologo /m /p:AllowMissingMacNatives=yes SpaceStation14.sln"
|
||||
- "cd packages/NUnit.ConsoleRunner.3.6.1/tools"
|
||||
- "msbuild /p:Configuration=Debug /p:Platform=x64 /p:HEADLESS=1 /nologo /m /p:AllowMissingMacNatives=yes SpaceStation14.sln /p:Python=python3.6"
|
||||
- "cd packages/NUnit.ConsoleRunner.3.7.0/tools"
|
||||
- "mono --debug nunit3-console.exe ../../../bin/UnitTesting/SS14.UnitTesting.dll"
|
||||
|
||||
|
||||
1
BuildChecker/.gitignore
vendored
Normal file
1
BuildChecker/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
INSTALLED_HOOKS_VERSION
|
||||
45
BuildChecker/BuildChecker.csproj
Normal file
45
BuildChecker/BuildChecker.csproj
Normal file
@@ -0,0 +1,45 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
This is a dummy .csproj file to check things like submodules.
|
||||
Better this than other errors.
|
||||
|
||||
If you want to create this kind of file yourself, you have to create an empty .NET application,
|
||||
Then strip it of everything until you have the <Project> tags.
|
||||
VS refuses to load the project if you make a bare project file and use Add -> Existing Project... for some reason.
|
||||
|
||||
You want to handle the Build, Clean and Rebuild tasks to prevent missing task errors on build.
|
||||
|
||||
If you want to learn more about these kinds of things, check out Microsoft's official documentation about MSBuild:
|
||||
https://docs.microsoft.com/en-us/visualstudio/msbuild/msbuild
|
||||
-->
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Choose>
|
||||
<When Condition="'$(Python)' == ''">
|
||||
<PropertyGroup>
|
||||
<Python>python3</Python>
|
||||
<Python Condition="'$(OS)'=='Windows_NT' Or '$(OS)'=='Windows'">py -3</Python>
|
||||
</PropertyGroup>
|
||||
</When>
|
||||
</Choose>
|
||||
<PropertyGroup>
|
||||
<ProjectGuid>{D0DA124B-5580-4345-A02B-9F051F78915F}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<TargetFrameworkMoniker>.NETFramework, Version=v4.6.1</TargetFrameworkMoniker>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' " />
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' " />
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' " />
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' " />
|
||||
<PropertyGroup>
|
||||
<StartupObject />
|
||||
</PropertyGroup>
|
||||
<Target Name="Build">
|
||||
<Exec Command="$(Python) git_helper.py" CustomErrorRegularExpression="^Error" />
|
||||
</Target>
|
||||
<Target Name="Rebuild" DependsOnTargets="Build" />
|
||||
<Target Name="Clean">
|
||||
<Message Importance="low" Text="Ignoring 'Clean' target." />
|
||||
</Target>
|
||||
<Target Name="Compile" />
|
||||
<Target Name="CoreCompile" />
|
||||
</Project>
|
||||
105
BuildChecker/git_helper.py
Executable file
105
BuildChecker/git_helper.py
Executable file
@@ -0,0 +1,105 @@
|
||||
#!/usr/bin/env python3
|
||||
# Installs git hooks, updates them, updates submodules, that kind of thing.
|
||||
|
||||
import subprocess
|
||||
import sys
|
||||
import os
|
||||
import shutil
|
||||
from pathlib import Path
|
||||
from typing import List
|
||||
|
||||
BUILD_CHECKER_PATH = Path(Path(__file__).resolve().parent)
|
||||
SS14_ROOT_PATH = Path(BUILD_CHECKER_PATH.parent)
|
||||
SOLUTION_PATH = Path(SS14_ROOT_PATH/"SpaceStation14.sln")
|
||||
CURRENT_HOOKS_VERSION = "2" # If this doesn't match the saved version we overwrite them all.
|
||||
QUIET = "--quiet" in sys.argv
|
||||
NO_HOOKS = "--nohooks" in sys.argv
|
||||
|
||||
def run_command(command: List[str], capture: bool = False) -> subprocess.CompletedProcess:
|
||||
"""
|
||||
Runs a command with pretty output.
|
||||
"""
|
||||
text = ' '.join(command)
|
||||
if not QUIET:
|
||||
print("$ {}".format(text))
|
||||
|
||||
sys.stdout.flush()
|
||||
|
||||
completed = None
|
||||
|
||||
if capture:
|
||||
completed = subprocess.run(command, cwd=str(SS14_ROOT_PATH), stdout=subprocess.PIPE)
|
||||
else:
|
||||
completed = subprocess.run(command, cwd=str(SS14_ROOT_PATH))
|
||||
|
||||
if completed.returncode != 0:
|
||||
raise RuntimeError("Error: command exited with code {}!".format(completed.returncode))
|
||||
|
||||
return completed
|
||||
|
||||
|
||||
def update_submodules():
|
||||
"""
|
||||
Updates all submodules.
|
||||
"""
|
||||
|
||||
status = run_command(["git", "submodule", "update", "--init", "--recursive"], capture=True)
|
||||
|
||||
if status.stdout.decode().strip():
|
||||
print("Git submodules changed. Reloading solution.")
|
||||
reset_solution()
|
||||
|
||||
def install_hooks():
|
||||
"""
|
||||
Installs the necessary git hooks into .git/hooks.
|
||||
"""
|
||||
|
||||
# Read version file.
|
||||
hooks_version_file = BUILD_CHECKER_PATH/"INSTALLED_HOOKS_VERSION"
|
||||
|
||||
if os.path.isfile(str(hooks_version_file)):
|
||||
with open(str(hooks_version_file), "r") as f:
|
||||
if f.read() == CURRENT_HOOKS_VERSION:
|
||||
if not QUIET:
|
||||
print("No hooks change detected.")
|
||||
return
|
||||
|
||||
with open(str(hooks_version_file), "w") as f:
|
||||
f.write(CURRENT_HOOKS_VERSION)
|
||||
|
||||
print("Hooks need updating.")
|
||||
|
||||
hooks_target_dir = SS14_ROOT_PATH/".git"/"hooks"
|
||||
hooks_source_dir = BUILD_CHECKER_PATH/"hooks"
|
||||
|
||||
if not os.path.exists(str(hooks_target_dir)):
|
||||
os.makedirs(str(hooks_target_dir))
|
||||
|
||||
# Clear entire tree since we need to kill deleted files too.
|
||||
for filename in os.listdir(str(hooks_target_dir)):
|
||||
os.remove(str(hooks_target_dir/filename))
|
||||
|
||||
for filename in os.listdir(str(hooks_source_dir)):
|
||||
print("Copying hook {}".format(filename))
|
||||
shutil.copyfile(str(hooks_source_dir/filename), str(hooks_target_dir/filename))
|
||||
|
||||
|
||||
def reset_solution():
|
||||
"""
|
||||
Force VS to think the solution has been changed to prompt the user to reload it,
|
||||
thus fixing any load errors.
|
||||
"""
|
||||
|
||||
with SOLUTION_PATH.open("r") as f:
|
||||
content = f.read()
|
||||
|
||||
with SOLUTION_PATH.open("w") as f:
|
||||
f.write(content)
|
||||
|
||||
def main():
|
||||
if not NO_HOOKS:
|
||||
install_hooks()
|
||||
update_submodules()
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
19
BuildChecker/hooks/post-checkout
Normal file
19
BuildChecker/hooks/post-checkout
Normal file
@@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
|
||||
gitroot=`git rev-parse --show-toplevel`
|
||||
|
||||
cd "$gitroot/BuildChecker"
|
||||
|
||||
if [ -f "git_helper.py" ]
|
||||
then
|
||||
if [[ `uname` == MINGW* || `uname` == CYGWIN* ]]; then
|
||||
# Windows
|
||||
# Can't update hooks from here because we are a hook,
|
||||
# and the file is read only while it's used.
|
||||
# Thanks Windows.
|
||||
py -3 git_helper.py --quiet --nohooks
|
||||
else
|
||||
# Not Windows, so probably some other Unix thing.
|
||||
python3 git_helper.py --quiet
|
||||
fi
|
||||
fi
|
||||
5
BuildChecker/hooks/post-merge
Normal file
5
BuildChecker/hooks/post-merge
Normal file
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Just call post-checkout since it does the same thing.
|
||||
gitroot=`git rev-parse --show-toplevel`
|
||||
bash "$gitroot/.git/hooks/post-checkout"
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="12.0">
|
||||
<PropertyGroup>
|
||||
<ProjectType>Local</ProjectType>
|
||||
@@ -6,72 +6,65 @@
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{59250BAF-0000-0000-0000-000000000000}</ProjectGuid>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<ApplicationIcon>
|
||||
</ApplicationIcon>
|
||||
<AssemblyKeyContainerName>
|
||||
</AssemblyKeyContainerName>
|
||||
<Platform Condition=" '$(Platform)' == '' ">x64</Platform>
|
||||
<ApplicationIcon />
|
||||
<AssemblyKeyContainerName />
|
||||
<AssemblyName>Lidgren.Network</AssemblyName>
|
||||
<DefaultClientScript>JScript</DefaultClientScript>
|
||||
<DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
|
||||
<DefaultTargetSchema>IE50</DefaultTargetSchema>
|
||||
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>
|
||||
</AppDesignerFolder>
|
||||
<AppDesignerFolder />
|
||||
<RootNamespace>Lidgren.Network</RootNamespace>
|
||||
<StartupObject>
|
||||
</StartupObject>
|
||||
<StartArguments>
|
||||
</StartArguments>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
<StartupObject />
|
||||
<StartArguments />
|
||||
<FileUpgradeFlags />
|
||||
<ConfigurationOverrideFile />
|
||||
<TargetFrameworkProfile />
|
||||
<DocumentationFile />
|
||||
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
|
||||
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
|
||||
<FileAlignment>4096</FileAlignment>
|
||||
<OutputPath>..\bin\Lidgren\</OutputPath>
|
||||
<RegisterForComInterop>False</RegisterForComInterop>
|
||||
<RemoveIntegerChecks>False</RemoveIntegerChecks>
|
||||
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
|
||||
<NoStdLib>False</NoStdLib>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
||||
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
|
||||
<BaseAddress>285212672</BaseAddress>
|
||||
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
|
||||
<ConfigurationOverrideFile>
|
||||
</ConfigurationOverrideFile>
|
||||
<DefineConstants>TRACE;DEBUG</DefineConstants>
|
||||
<DocumentationFile>
|
||||
</DocumentationFile>
|
||||
<DebugSymbols>True</DebugSymbols>
|
||||
<FileAlignment>4096</FileAlignment>
|
||||
<Optimize>False</Optimize>
|
||||
<OutputPath>$(SolutionDir)bin\Lidgren\</OutputPath>
|
||||
<RegisterForComInterop>False</RegisterForComInterop>
|
||||
<RemoveIntegerChecks>False</RemoveIntegerChecks>
|
||||
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<NoStdLib>False</NoStdLib>
|
||||
<NoWarn>
|
||||
</NoWarn>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
|
||||
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
|
||||
<BaseAddress>285212672</BaseAddress>
|
||||
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
|
||||
<ConfigurationOverrideFile>
|
||||
</ConfigurationOverrideFile>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<DocumentationFile>
|
||||
</DocumentationFile>
|
||||
<DebugSymbols>False</DebugSymbols>
|
||||
<FileAlignment>4096</FileAlignment>
|
||||
<Optimize>True</Optimize>
|
||||
<OutputPath>$(SolutionDir)bin\Lidgren\</OutputPath>
|
||||
<RegisterForComInterop>False</RegisterForComInterop>
|
||||
<RemoveIntegerChecks>False</RemoveIntegerChecks>
|
||||
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<NoStdLib>False</NoStdLib>
|
||||
<NoWarn>
|
||||
</NoWarn>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
|
||||
<DefineConstants>TRACE;DEBUG</DefineConstants>
|
||||
<DebugSymbols>True</DebugSymbols>
|
||||
<Optimize>False</Optimize>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<DebugSymbols>False</DebugSymbols>
|
||||
<Optimize>True</Optimize>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DefineConstants>TRACE;DEBUG</DefineConstants>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<DebugSymbols>False</DebugSymbols>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.CSharp">
|
||||
|
||||
@@ -252,9 +252,20 @@ namespace Lidgren.Network
|
||||
}
|
||||
if (m_messageReceivedEvent != null)
|
||||
{
|
||||
m_messageReceivedEvent.Set();
|
||||
m_messageReceivedEvent.Close();
|
||||
m_messageReceivedEvent = null;
|
||||
try
|
||||
{
|
||||
m_messageReceivedEvent.Set();
|
||||
m_messageReceivedEvent.Close();
|
||||
}
|
||||
catch (ObjectDisposedException)
|
||||
{
|
||||
// For some reason, inside Godot this seems to throw ObjectDisposedExceptions on client shutdown.
|
||||
// If it's already disposed then I guess this is fine?
|
||||
}
|
||||
finally
|
||||
{
|
||||
m_messageReceivedEvent = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
finally
|
||||
|
||||
@@ -263,7 +263,7 @@ namespace Lidgren.Network
|
||||
}
|
||||
return new string(c);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets the local broadcast address
|
||||
/// </summary>
|
||||
@@ -275,7 +275,7 @@ namespace Lidgren.Network
|
||||
if (wifi.IsWifiEnabled)
|
||||
{
|
||||
var dhcp = wifi.DhcpInfo;
|
||||
|
||||
|
||||
int broadcast = (dhcp.IpAddress & dhcp.Netmask) | ~dhcp.Netmask;
|
||||
byte[] quads = new byte[4];
|
||||
for (int k = 0; k < 4; k++)
|
||||
@@ -289,7 +289,7 @@ namespace Lidgren.Network
|
||||
{
|
||||
return IPAddress.Broadcast;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#if IS_FULL_NET_AVAILABLE
|
||||
try
|
||||
{
|
||||
@@ -298,7 +298,7 @@ namespace Lidgren.Network
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
IPInterfaceProperties properties = ni.GetIPProperties();
|
||||
foreach (UnicastIPAddressInformation unicastAddress in properties.UnicastAddresses)
|
||||
{
|
||||
@@ -307,24 +307,24 @@ namespace Lidgren.Network
|
||||
var mask = unicastAddress.IPv4Mask;
|
||||
byte[] ipAdressBytes = unicastAddress.Address.GetAddressBytes();
|
||||
byte[] subnetMaskBytes = mask.GetAddressBytes();
|
||||
|
||||
|
||||
if (ipAdressBytes.Length != subnetMaskBytes.Length)
|
||||
throw new ArgumentException("Lengths of IP address and subnet mask do not match.");
|
||||
|
||||
|
||||
byte[] broadcastAddress = new byte[ipAdressBytes.Length];
|
||||
for (int i = 0; i < broadcastAddress.Length; i++)
|
||||
{
|
||||
broadcastAddress[i] = (byte)(ipAdressBytes[i] | (subnetMaskBytes[i] ^ 255));
|
||||
}
|
||||
return new IPAddress(broadcastAddress);
|
||||
return new IPAddress(broadcastAddress);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch // Catch any errors
|
||||
catch // Catch any errors
|
||||
{
|
||||
return IPAddress.Broadcast;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
return IPAddress.Broadcast;
|
||||
}
|
||||
|
||||
@@ -340,21 +340,21 @@ namespace Lidgren.Network
|
||||
Android.Net.Wifi.WifiManager wifi = (Android.Net.Wifi.WifiManager)Android.App.Application.Context.GetSystemService(Android.App.Activity.WifiService);
|
||||
if (!wifi.IsWifiEnabled) return null;
|
||||
var dhcp = wifi.DhcpInfo;
|
||||
|
||||
|
||||
int addr = dhcp.IpAddress;
|
||||
byte[] quads = new byte[4];
|
||||
for (int k = 0; k < 4; k++)
|
||||
{
|
||||
quads[k] = (byte) ((addr >> k * 8) & 0xFF);
|
||||
}
|
||||
}
|
||||
return new IPAddress(quads);
|
||||
}
|
||||
catch // Catch Access Denied errors
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#if IS_FULL_NET_AVAILABLE
|
||||
NetworkInterface ni = GetNetworkInterface();
|
||||
if (ni == null)
|
||||
@@ -577,4 +577,4 @@ namespace Lidgren.Network
|
||||
return bdr.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
20
MSBuild/SS14.DefineConstants.targets
Normal file
20
MSBuild/SS14.DefineConstants.targets
Normal file
@@ -0,0 +1,20 @@
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="12.0">
|
||||
<!-- Adds to the DefineConstants to provide things such as platform-specific defines. -->
|
||||
<Choose>
|
||||
<When Condition="'$(TargetOS)' == 'Windows'">
|
||||
<PropertyGroup>
|
||||
<DefineConstants>$(DefineConstants);WINDOWS</DefineConstants>
|
||||
</PropertyGroup>
|
||||
</When>
|
||||
<When Condition="'$(TargetOS)' == 'MacOS'" >
|
||||
<PropertyGroup>
|
||||
<DefineConstants>$(DefineConstants);MACOS</DefineConstants>
|
||||
</PropertyGroup>
|
||||
</When>
|
||||
<Otherwise>
|
||||
<PropertyGroup>
|
||||
<DefineConstants>$(DefineConstants);LINUX</DefineConstants>
|
||||
</PropertyGroup>
|
||||
</Otherwise>
|
||||
</Choose>
|
||||
</Project>
|
||||
@@ -23,5 +23,7 @@
|
||||
</Choose>
|
||||
<PropertyGroup>
|
||||
<TargetOS Condition="'$(TargetOS)' == ''">$(ActualOS)</TargetOS>
|
||||
<Python>python3</Python>
|
||||
<Python Condition="'$(ActualOS)' == 'Windows'">py -3</Python>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
|
||||
11
MSBuild/SS14.Sandbox.targets
Normal file
11
MSBuild/SS14.Sandbox.targets
Normal file
@@ -0,0 +1,11 @@
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<!-- Common target to copy content assemblies to the parent projects. -->
|
||||
<Target Name="CopyContentAssemblies">
|
||||
<Copy SourceFiles="@(ContentAssemblies)" DestinationFolder="$(ContentAssemblyTarget)" />
|
||||
</Target>
|
||||
<ItemDefinitionGroup>
|
||||
<ContentAssemblies>
|
||||
<Visible>False</Visible>
|
||||
</ContentAssemblies>
|
||||
</ItemDefinitionGroup>
|
||||
</Project>
|
||||
41
RUN_THIS.py
Executable file
41
RUN_THIS.py
Executable file
@@ -0,0 +1,41 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
# Import future so people on py2 still get the clear error that they need to upgrade.
|
||||
from __future__ import print_function
|
||||
import os
|
||||
import sys
|
||||
import traceback
|
||||
|
||||
VERSION = sys.version_info
|
||||
NO_PROMPT = "--no-prompt" in sys.argv
|
||||
|
||||
sane_input = raw_input if VERSION.major < 3 else input
|
||||
|
||||
def main():
|
||||
if VERSION.major < 3 or (VERSION.major == 3 and VERSION.minor < 5):
|
||||
print("ERROR: You need at least Python 3.5 to build SS14.")
|
||||
# Need "press enter to exit" stuff because Windows just immediately closes conhost.
|
||||
if not NO_PROMPT:
|
||||
sane_input("Press enter to exit...")
|
||||
exit(1)
|
||||
|
||||
# Import git_helper by modifying the path.
|
||||
ss14_dir = os.path.dirname(os.path.abspath(__file__))
|
||||
sys.path.append(os.path.join(ss14_dir, "BuildChecker"))
|
||||
|
||||
try:
|
||||
import git_helper
|
||||
git_helper.main()
|
||||
|
||||
except Exception as e:
|
||||
print("ERROR:")
|
||||
traceback.print_exc()
|
||||
print("This was NOT intentional. If the error is not immediately obvious, ask on Discord or IRC for help.")
|
||||
if not NO_PROMPT:
|
||||
sane_input("Press enter to exit...")
|
||||
exit(1)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
if not NO_PROMPT:
|
||||
sane_input("Success! Press enter to exit...")
|
||||
3666
Resources/Maps/Demo/DemoGrid.yaml
Normal file
3666
Resources/Maps/Demo/DemoGrid.yaml
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,63 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ParticleSettings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
||||
<Sprite>star1</Sprite>
|
||||
<EmitterPosition>
|
||||
<X>358</X>
|
||||
<Y>385</Y>
|
||||
</EmitterPosition>
|
||||
<EmissionOffset>
|
||||
<X>0</X>
|
||||
<Y>0</Y>
|
||||
</EmissionOffset>
|
||||
<EmitRate>30</EmitRate>
|
||||
<MaximumParticleCount>200</MaximumParticleCount>
|
||||
<EmissionRadiusRange>
|
||||
<X>5</X>
|
||||
<Y>20</Y>
|
||||
</EmissionRadiusRange>
|
||||
<Velocity>
|
||||
<X>0</X>
|
||||
<Y>0</Y>
|
||||
</Velocity>
|
||||
<VelocityVariance>0</VelocityVariance>
|
||||
<Acceleration>
|
||||
<X>0</X>
|
||||
<Y>1.5</Y>
|
||||
</Acceleration>
|
||||
<AccelerationVariance>0</AccelerationVariance>
|
||||
<RadialVelocity>10</RadialVelocity>
|
||||
<RadialVelocityVariance>0</RadialVelocityVariance>
|
||||
<RadialAcceleration>-1.25</RadialAcceleration>
|
||||
<RadialAccelerationVariance>0</RadialAccelerationVariance>
|
||||
<TangentialVelocity>0</TangentialVelocity>
|
||||
<TangentialVelocityVariance>0</TangentialVelocityVariance>
|
||||
<TangentialAcceleration>0</TangentialAcceleration>
|
||||
<TangentialAccelerationVariance>0</TangentialAccelerationVariance>
|
||||
<Lifetime>10</Lifetime>
|
||||
<LifetimeVariance>2</LifetimeVariance>
|
||||
<SpinVelocity>
|
||||
<X>0</X>
|
||||
<Y>0</Y>
|
||||
</SpinVelocity>
|
||||
<SpinVelocityVariance>0</SpinVelocityVariance>
|
||||
<SizeRange>
|
||||
<X>0.1</X>
|
||||
<Y>0.05</Y>
|
||||
</SizeRange>
|
||||
<SizeVariance>0.05</SizeVariance>
|
||||
<ColorRange>
|
||||
<Start>
|
||||
<A>255</A>
|
||||
<R>113</R>
|
||||
<G>199</G>
|
||||
<B>255</B>
|
||||
</Start>
|
||||
<End>
|
||||
<A>80</A>
|
||||
<R>103</R>
|
||||
<G>180</G>
|
||||
<B>255</B>
|
||||
</End>
|
||||
</ColorRange>
|
||||
<ColorVariance>0</ColorVariance>
|
||||
</ParticleSettings>
|
||||
@@ -1,63 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ParticleSettings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
||||
<Sprite>star1</Sprite>
|
||||
<EmitterPosition>
|
||||
<X>358</X>
|
||||
<Y>385</Y>
|
||||
</EmitterPosition>
|
||||
<EmissionOffset>
|
||||
<X>0</X>
|
||||
<Y>0</Y>
|
||||
</EmissionOffset>
|
||||
<EmitRate>30</EmitRate>
|
||||
<MaximumParticleCount>200</MaximumParticleCount>
|
||||
<EmissionRadiusRange>
|
||||
<X>5</X>
|
||||
<Y>20</Y>
|
||||
</EmissionRadiusRange>
|
||||
<Velocity>
|
||||
<X>0</X>
|
||||
<Y>0</Y>
|
||||
</Velocity>
|
||||
<VelocityVariance>0</VelocityVariance>
|
||||
<Acceleration>
|
||||
<X>0</X>
|
||||
<Y>1.5</Y>
|
||||
</Acceleration>
|
||||
<AccelerationVariance>0</AccelerationVariance>
|
||||
<RadialVelocity>10</RadialVelocity>
|
||||
<RadialVelocityVariance>0</RadialVelocityVariance>
|
||||
<RadialAcceleration>-1.25</RadialAcceleration>
|
||||
<RadialAccelerationVariance>0</RadialAccelerationVariance>
|
||||
<TangentialVelocity>0</TangentialVelocity>
|
||||
<TangentialVelocityVariance>0</TangentialVelocityVariance>
|
||||
<TangentialAcceleration>0</TangentialAcceleration>
|
||||
<TangentialAccelerationVariance>0</TangentialAccelerationVariance>
|
||||
<Lifetime>10</Lifetime>
|
||||
<LifetimeVariance>2</LifetimeVariance>
|
||||
<SpinVelocity>
|
||||
<X>0</X>
|
||||
<Y>0</Y>
|
||||
</SpinVelocity>
|
||||
<SpinVelocityVariance>0</SpinVelocityVariance>
|
||||
<SizeRange>
|
||||
<X>0.1</X>
|
||||
<Y>0.05</Y>
|
||||
</SizeRange>
|
||||
<SizeVariance>0.05</SizeVariance>
|
||||
<ColorRange>
|
||||
<Start>
|
||||
<A>255</A>
|
||||
<R>228</R>
|
||||
<G>26</G>
|
||||
<B>199</B>
|
||||
</Start>
|
||||
<End>
|
||||
<A>30</A>
|
||||
<R>223</R>
|
||||
<G>31</G>
|
||||
<B>212</B>
|
||||
</End>
|
||||
</ColorRange>
|
||||
<ColorVariance>0</ColorVariance>
|
||||
</ParticleSettings>
|
||||
@@ -1,63 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ParticleSettings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
||||
<Sprite>smoke</Sprite>
|
||||
<EmitterPosition>
|
||||
<X>358</X>
|
||||
<Y>385</Y>
|
||||
</EmitterPosition>
|
||||
<EmissionOffset>
|
||||
<X>0</X>
|
||||
<Y>0</Y>
|
||||
</EmissionOffset>
|
||||
<EmitRate>11</EmitRate>
|
||||
<MaximumParticleCount>200</MaximumParticleCount>
|
||||
<EmissionRadiusRange>
|
||||
<X>0</X>
|
||||
<Y>0</Y>
|
||||
</EmissionRadiusRange>
|
||||
<Velocity>
|
||||
<X>0</X>
|
||||
<Y>-0</Y>
|
||||
</Velocity>
|
||||
<VelocityVariance>0</VelocityVariance>
|
||||
<Acceleration>
|
||||
<X>0</X>
|
||||
<Y>-13</Y>
|
||||
</Acceleration>
|
||||
<AccelerationVariance>3</AccelerationVariance>
|
||||
<RadialVelocity>0</RadialVelocity>
|
||||
<RadialVelocityVariance>0</RadialVelocityVariance>
|
||||
<RadialAcceleration>0</RadialAcceleration>
|
||||
<RadialAccelerationVariance>0</RadialAccelerationVariance>
|
||||
<TangentialVelocity>0</TangentialVelocity>
|
||||
<TangentialVelocityVariance>0</TangentialVelocityVariance>
|
||||
<TangentialAcceleration>0</TangentialAcceleration>
|
||||
<TangentialAccelerationVariance>0</TangentialAccelerationVariance>
|
||||
<Lifetime>3</Lifetime>
|
||||
<LifetimeVariance>0</LifetimeVariance>
|
||||
<SpinVelocity>
|
||||
<X>0</X>
|
||||
<Y>0</Y>
|
||||
</SpinVelocity>
|
||||
<SpinVelocityVariance>0.3</SpinVelocityVariance>
|
||||
<SizeRange>
|
||||
<X>0</X>
|
||||
<Y>1</Y>
|
||||
</SizeRange>
|
||||
<SizeVariance>0</SizeVariance>
|
||||
<ColorRange>
|
||||
<Start>
|
||||
<A>208</A>
|
||||
<R>128</R>
|
||||
<G>128</G>
|
||||
<B>128</B>
|
||||
</Start>
|
||||
<End>
|
||||
<A>0</A>
|
||||
<R>48</R>
|
||||
<G>48</G>
|
||||
<B>48</B>
|
||||
</End>
|
||||
</ColorRange>
|
||||
<ColorVariance>0</ColorVariance>
|
||||
</ParticleSettings>
|
||||
@@ -1,63 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ParticleSettings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
||||
<Sprite>star1</Sprite>
|
||||
<EmitterPosition>
|
||||
<X>358</X>
|
||||
<Y>385</Y>
|
||||
</EmitterPosition>
|
||||
<EmissionOffset>
|
||||
<X>0</X>
|
||||
<Y>0</Y>
|
||||
</EmissionOffset>
|
||||
<EmitRate>40</EmitRate>
|
||||
<MaximumParticleCount>200</MaximumParticleCount>
|
||||
<EmissionRadiusRange>
|
||||
<X>10</X>
|
||||
<Y>170</Y>
|
||||
</EmissionRadiusRange>
|
||||
<Velocity>
|
||||
<X>0</X>
|
||||
<Y>-20</Y>
|
||||
</Velocity>
|
||||
<VelocityVariance>0</VelocityVariance>
|
||||
<Acceleration>
|
||||
<X>0</X>
|
||||
<Y>-30</Y>
|
||||
</Acceleration>
|
||||
<AccelerationVariance>0</AccelerationVariance>
|
||||
<RadialVelocity>0</RadialVelocity>
|
||||
<RadialVelocityVariance>1</RadialVelocityVariance>
|
||||
<RadialAcceleration>10</RadialAcceleration>
|
||||
<RadialAccelerationVariance>0</RadialAccelerationVariance>
|
||||
<TangentialVelocity>0</TangentialVelocity>
|
||||
<TangentialVelocityVariance>1</TangentialVelocityVariance>
|
||||
<TangentialAcceleration>0</TangentialAcceleration>
|
||||
<TangentialAccelerationVariance>0.2</TangentialAccelerationVariance>
|
||||
<Lifetime>3</Lifetime>
|
||||
<LifetimeVariance>0</LifetimeVariance>
|
||||
<SpinVelocity>
|
||||
<X>0</X>
|
||||
<Y>0</Y>
|
||||
</SpinVelocity>
|
||||
<SpinVelocityVariance>2</SpinVelocityVariance>
|
||||
<SizeRange>
|
||||
<X>1</X>
|
||||
<Y>1</Y>
|
||||
</SizeRange>
|
||||
<SizeVariance>0</SizeVariance>
|
||||
<ColorRange>
|
||||
<Start>
|
||||
<A>255</A>
|
||||
<R>0</R>
|
||||
<G>0</G>
|
||||
<B>255</B>
|
||||
</Start>
|
||||
<End>
|
||||
<A>255</A>
|
||||
<R>0</R>
|
||||
<G>0</G>
|
||||
<B>0</B>
|
||||
</End>
|
||||
</ColorRange>
|
||||
<ColorVariance>0</ColorVariance>
|
||||
</ParticleSettings>
|
||||
31
Resources/Prototypes/Engine/Entities/Clothing.yml
Normal file
31
Resources/Prototypes/Engine/Entities/Clothing.yml
Normal file
@@ -0,0 +1,31 @@
|
||||
- type: entity
|
||||
id: __engine_janitor_suit
|
||||
name: "[engine] Janitor Jumpsuit"
|
||||
components:
|
||||
- type: Transform
|
||||
- type: Clickable
|
||||
- type: Sprite
|
||||
texture: Items/janitorsuit.png
|
||||
|
||||
- type: Icon
|
||||
texture: Items/janitorsuit.png
|
||||
|
||||
- type: BoundingBox
|
||||
- type: Physics
|
||||
mass: 5
|
||||
|
||||
- type: entity
|
||||
id: __engine_shoes
|
||||
name: "[engine] shoes"
|
||||
components:
|
||||
- type: Transform
|
||||
- type: Clickable
|
||||
- type: Sprite
|
||||
texture: Items/janitorsuit.png
|
||||
|
||||
- type: Icon
|
||||
texture: Items/shoes.png
|
||||
|
||||
- type: BoundingBox
|
||||
- type: Physics
|
||||
mass: 5
|
||||
15
Resources/Prototypes/Engine/Entities/Containers.yml
Normal file
15
Resources/Prototypes/Engine/Entities/Containers.yml
Normal file
@@ -0,0 +1,15 @@
|
||||
- type: entity
|
||||
id: __engine_toolbox
|
||||
name: "[engine] toolbox"
|
||||
components:
|
||||
- type: Transform
|
||||
- type: Clickable
|
||||
- type: Sprite
|
||||
texture: Items/toolbox_r.png
|
||||
|
||||
- type: Icon
|
||||
texture: Items/toolbox_r.png
|
||||
|
||||
- type: BoundingBox
|
||||
- type: Physics
|
||||
mass: 5
|
||||
19
Resources/Prototypes/Engine/Entities/Doors.yml
Normal file
19
Resources/Prototypes/Engine/Entities/Doors.yml
Normal file
@@ -0,0 +1,19 @@
|
||||
- type: entity
|
||||
id: __engine_door
|
||||
name: "[engine] Real Fake Door"
|
||||
components:
|
||||
- type: Transform
|
||||
- type: Clickable
|
||||
- type: Sprite
|
||||
drawdepth: Objects
|
||||
texture: Objects/door_ew.png
|
||||
|
||||
- type: Icon
|
||||
texture: Objects/door_ew.png
|
||||
|
||||
- type: BoundingBox
|
||||
- type: Collidable
|
||||
|
||||
placement:
|
||||
snap:
|
||||
- Wall
|
||||
@@ -1,15 +1,14 @@
|
||||
- type: entity
|
||||
id: Mop
|
||||
name: Mop
|
||||
id: __engine_mop
|
||||
name: "[engine] mop"
|
||||
components:
|
||||
- type: Transform
|
||||
- type: Clickable
|
||||
- type: WearableAnimatedSprite
|
||||
sprite: player_toolbox
|
||||
notWornSprite: mop
|
||||
- type: Sprite
|
||||
texture: Items/mop.png
|
||||
|
||||
- type: Icon
|
||||
icon: mop
|
||||
texture: Items/mop.png
|
||||
|
||||
- type: BoundingBox
|
||||
- type: Physics
|
||||
23
Resources/Prototypes/Engine/Entities/Lights.yml
Normal file
23
Resources/Prototypes/Engine/Entities/Lights.yml
Normal file
@@ -0,0 +1,23 @@
|
||||
- type: entity
|
||||
id: __engine_wall_light
|
||||
name: "[engine] Wall Light"
|
||||
components:
|
||||
- type: Transform
|
||||
- type: Clickable
|
||||
- type: Sprite
|
||||
texture: Objects/wall_light.png
|
||||
|
||||
- type: Icon
|
||||
texture: Objects/wall_light.png
|
||||
|
||||
- type: BoundingBox
|
||||
|
||||
- type: PointLight
|
||||
radius: 8
|
||||
energy: 1.2
|
||||
offset: "0, -16"
|
||||
color: "#DCDCC6"
|
||||
|
||||
placement:
|
||||
snap:
|
||||
- Wallmount
|
||||
26
Resources/Prototypes/Engine/Entities/Mobs.yml
Normal file
26
Resources/Prototypes/Engine/Entities/Mobs.yml
Normal file
@@ -0,0 +1,26 @@
|
||||
- type: entity
|
||||
id: __engine_human
|
||||
name: "[engine] Urist McHuman"
|
||||
save: false
|
||||
components:
|
||||
- type: Transform
|
||||
- type: Clickable
|
||||
- type: Sprite
|
||||
sprite: Mob/greyshirt.rsi
|
||||
state: greyshirt
|
||||
scale: 2, 2
|
||||
drawdepth: Mobs
|
||||
|
||||
- type: Icon
|
||||
sprite: Mob/greyshirt.rsi
|
||||
state: greyshirt
|
||||
|
||||
- type: BoundingBox
|
||||
aabb: "0.15,-0.45,1.05,0.45"
|
||||
|
||||
- type: Physics
|
||||
mass: 5
|
||||
|
||||
- type: Collidable
|
||||
DebugColor: "#0000FF"
|
||||
|
||||
@@ -1,21 +1,18 @@
|
||||
- type: entity
|
||||
id: Worktop
|
||||
name: Worktop
|
||||
id: __engine_worktop
|
||||
name: "[engine] worktop"
|
||||
components:
|
||||
- type: Transform
|
||||
- type: Clickable
|
||||
- type: Sprite
|
||||
sprites:
|
||||
- worktop_single
|
||||
drawdepth: Tables
|
||||
texture: Objects/worktop_single.png
|
||||
|
||||
- type: Icon
|
||||
icon: worktop_single
|
||||
texture: Objects/worktop_single.png
|
||||
|
||||
- type: BoundingBox
|
||||
sizeX: 2
|
||||
sizeY: 1.4
|
||||
offsetY: 0.25
|
||||
aabb: "-0.45,-1,0.95,1"
|
||||
DebugColor: "#0000FF"
|
||||
|
||||
- type: Collidable
|
||||
DebugColor: "#0000FF"
|
||||
|
||||
60
Resources/Prototypes/Engine/Entities/Wallmounted.yml
Normal file
60
Resources/Prototypes/Engine/Entities/Wallmounted.yml
Normal file
@@ -0,0 +1,60 @@
|
||||
- type: entity
|
||||
id: __engine_extinguisher
|
||||
name: "[engine] Extinguisher Cabinet"
|
||||
components:
|
||||
- type: Transform
|
||||
- type: Clickable
|
||||
- type: Sprite
|
||||
texture: Objects/fire_extinguisher.png
|
||||
|
||||
- type: Icon
|
||||
texture: Objects/fire_extinguisher.png
|
||||
|
||||
placement:
|
||||
mode: AlignWall
|
||||
range: 200
|
||||
nodes:
|
||||
- 18
|
||||
- 26
|
||||
- 32
|
||||
snap:
|
||||
- Wallmount
|
||||
|
||||
- type: entity
|
||||
id: __engine_fire_alarm
|
||||
name: "[engine] Fire Alarm"
|
||||
components:
|
||||
- type: Transform
|
||||
- type: Clickable
|
||||
- type: Sprite
|
||||
texture: Objects/fire_alarm_off.png
|
||||
|
||||
- type: Icon
|
||||
texture: Objects/fire_alarm_off.png
|
||||
|
||||
placement:
|
||||
mode: AlignWall
|
||||
range: 180
|
||||
nodes:
|
||||
- 5
|
||||
- 10
|
||||
- 15
|
||||
snap:
|
||||
- Wallmount
|
||||
|
||||
- type: entity
|
||||
id: __engine_med_cabinet
|
||||
name: "[engine] Medical Cabinet"
|
||||
components:
|
||||
- type: Transform
|
||||
- type: Clickable
|
||||
- type: Sprite
|
||||
texture: Objects/med_cabinet.png
|
||||
|
||||
- type: Icon
|
||||
texture: Objects/med_cabinet.png
|
||||
|
||||
placement:
|
||||
mode: AlignWall
|
||||
snap:
|
||||
- Wallmount
|
||||
22
Resources/Prototypes/Engine/Entities/Walls.yml
Normal file
22
Resources/Prototypes/Engine/Entities/Walls.yml
Normal file
@@ -0,0 +1,22 @@
|
||||
- type: entity
|
||||
id: __engine_wall
|
||||
name: "[engine] Wall"
|
||||
components:
|
||||
- type: Transform
|
||||
- type: Clickable
|
||||
- type: Sprite
|
||||
drawdepth: Walls
|
||||
texture: Tiles/wall_texture.png
|
||||
|
||||
- type: Icon
|
||||
texture: Tiles/wall_texture.png
|
||||
|
||||
- type: BoundingBox
|
||||
- type: Collidable
|
||||
- type: Occluder
|
||||
sizeX: 32
|
||||
sizeY: 32
|
||||
|
||||
placement:
|
||||
snap:
|
||||
- Wall
|
||||
@@ -1,33 +0,0 @@
|
||||
- type: entity
|
||||
id: Janitor_Suit
|
||||
name: Janitor Jumpsuit
|
||||
components:
|
||||
- type: Transform
|
||||
- type: Clickable
|
||||
- type: WearableAnimatedSprite
|
||||
sprite: player_jumpsuit_gray
|
||||
notWornSprite: janitorsuit
|
||||
|
||||
- type: Icon
|
||||
icon: janitorsuit
|
||||
|
||||
- type: BoundingBox
|
||||
- type: Physics
|
||||
mass: 5
|
||||
|
||||
- type: entity
|
||||
id: Shoes
|
||||
name: Shoes
|
||||
components:
|
||||
- type: Transform
|
||||
- type: Clickable
|
||||
- type: WearableAnimatedSprite
|
||||
sprite: player_toolbox
|
||||
notWornSprite: shoes
|
||||
|
||||
- type: Icon
|
||||
icon: shoes
|
||||
|
||||
- type: BoundingBox
|
||||
- type: Physics
|
||||
mass: 5
|
||||
@@ -1,16 +0,0 @@
|
||||
- type: entity
|
||||
id: Toolbox
|
||||
name: Toolbox
|
||||
components:
|
||||
- type: Transform
|
||||
- type: Clickable
|
||||
- type: WearableAnimatedSprite
|
||||
sprite: player_toolbox
|
||||
notWornSprite: toolbox_r
|
||||
|
||||
- type: Icon
|
||||
icon: toolbox_r
|
||||
|
||||
- type: BoundingBox
|
||||
- type: Physics
|
||||
mass: 5
|
||||
@@ -1,17 +0,0 @@
|
||||
- type: entity
|
||||
id: Door
|
||||
name: Door
|
||||
components:
|
||||
- type: Transform
|
||||
- type: Clickable
|
||||
- type: Sprite
|
||||
drawdepth: FloorPlaceable
|
||||
sprites:
|
||||
- door_ew
|
||||
- door_ewo
|
||||
|
||||
- type: Icon
|
||||
icon: door_ew
|
||||
|
||||
- type: BoundingBox
|
||||
- type: Collidable
|
||||
@@ -1,22 +0,0 @@
|
||||
- type: entity
|
||||
id: WallLight
|
||||
name: Wall Light
|
||||
components:
|
||||
- type: Transform
|
||||
- type: Clickable
|
||||
- type: Sprite
|
||||
sprites:
|
||||
- wall_light
|
||||
|
||||
- type: Icon
|
||||
icon: wall_light
|
||||
|
||||
- type: PointLight
|
||||
lightoffsetx: 0
|
||||
lightoffsety: 0
|
||||
lightradius: 1024
|
||||
lightColorR: 220
|
||||
lightColorG: 220
|
||||
lightColorB: 198
|
||||
mask: whitemask
|
||||
startState: On
|
||||
@@ -1,23 +0,0 @@
|
||||
- type: entity
|
||||
id: HumanMob
|
||||
name: Urist McHuman
|
||||
components:
|
||||
- type: Transform
|
||||
- type: Clickable
|
||||
- type: AnimatedSprite
|
||||
sprite: player
|
||||
|
||||
- type: Icon
|
||||
icon: player
|
||||
|
||||
- type: BoundingBox
|
||||
sizeX: 0.9
|
||||
sizeY: 0.9
|
||||
|
||||
- type: ParticleSystem
|
||||
- type: Physics
|
||||
mass: 5
|
||||
|
||||
- type: Collidable
|
||||
DebugColor: "#0000FF"
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
- type: entity
|
||||
id: Extinguisher
|
||||
name: Extinguisher Cabinet
|
||||
components:
|
||||
- type: Transform
|
||||
- type: Clickable
|
||||
- type: Sprite
|
||||
sprites:
|
||||
- fire_extinguisher
|
||||
|
||||
placement:
|
||||
mode: AlignWall
|
||||
range: 200
|
||||
modes:
|
||||
- 18
|
||||
- 26
|
||||
- 32
|
||||
|
||||
- type: entity
|
||||
id: FireAlarm
|
||||
name: Fire Alarm
|
||||
components:
|
||||
- type: Transform
|
||||
- type: Clickable
|
||||
- type: Sprite
|
||||
sprites:
|
||||
- fire_alarm_off
|
||||
|
||||
- type: Icon
|
||||
icon: fire_alarm_off
|
||||
|
||||
placement:
|
||||
mode: AlignWall
|
||||
range: 180
|
||||
nodes:
|
||||
- 5
|
||||
- 10
|
||||
- 15
|
||||
|
||||
- type: entity
|
||||
id: MedCabinet
|
||||
name: Medical Cabinet
|
||||
components:
|
||||
- type: Transform
|
||||
- type: Clickable
|
||||
- type: Sprite
|
||||
sprites:
|
||||
- med_cabinet
|
||||
|
||||
- type: Icon
|
||||
icon: med_cabinet
|
||||
|
||||
placement:
|
||||
mode: AlignWall
|
||||
7
Resources/Prototypes/Shaders/outline.yml
Normal file
7
Resources/Prototypes/Shaders/outline.yml
Normal file
@@ -0,0 +1,7 @@
|
||||
- type: shader
|
||||
id: selection_outline
|
||||
kind: source
|
||||
path: "/Shaders/outline.gdsl"
|
||||
params:
|
||||
outline_width: 1
|
||||
outline_color: "#FF000055"
|
||||
5
Resources/Prototypes/Shaders/stockshaders.yml
Normal file
5
Resources/Prototypes/Shaders/stockshaders.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
# Generic canvas shader without light shading.
|
||||
- type: shader
|
||||
id: unshaded
|
||||
kind: canvas
|
||||
light_mode: unshaded
|
||||
@@ -1,6 +0,0 @@
|
||||
#version 120
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = vec4(0,0,0,1);
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
#version 120
|
||||
void main()
|
||||
{
|
||||
// transform the vertex position
|
||||
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
|
||||
|
||||
// transform the texture coordinates
|
||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||
|
||||
// forward the vertex color
|
||||
gl_FrontColor = gl_Color;
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
#version 120
|
||||
// Amount to blur.
|
||||
float blurAmount = 0.0135;
|
||||
|
||||
// Our texture sampler.
|
||||
uniform sampler2D sourceSampler;
|
||||
|
||||
|
||||
// Function to perform the sampling for the blur.
|
||||
vec4 psBlurSample(vec2 Tex , vec4 baseColor, float offX, float offY)
|
||||
{
|
||||
vec4 Color; // Output.
|
||||
float scaler = 0; // Scale of the sample.
|
||||
|
||||
// Calculate sample.
|
||||
scaler = (1 + (offY * offX));
|
||||
Tex.x = Tex.x + offX;
|
||||
Tex.y = Tex.y + offY;
|
||||
|
||||
Color = baseColor + texture2D(sourceSampler, Tex / scaler);
|
||||
return Color;
|
||||
}
|
||||
|
||||
|
||||
vec4 Blur()
|
||||
{
|
||||
vec4 Color = vec4(0); // Output.
|
||||
float Alpha = 0; // Alpha component.
|
||||
float blurValue = 0; // Blur value.
|
||||
|
||||
blurValue = blurAmount / 1000.0f;
|
||||
|
||||
if (blurAmount < 0)
|
||||
blurValue = 0;
|
||||
|
||||
if (blurAmount > 10)
|
||||
blurValue = 0.01;
|
||||
|
||||
|
||||
Color = texture2D(sourceSampler, gl_TexCoord[0].xy);
|
||||
|
||||
// Store the alpha for later, we don't want to blur that.
|
||||
Alpha = Color.a;
|
||||
|
||||
// Sample eight directions + the center.
|
||||
Color = psBlurSample(gl_TexCoord[0].xy, Color, -blurValue, -blurValue);
|
||||
Color = psBlurSample(gl_TexCoord[0].xy, Color, 0, -blurValue);
|
||||
Color = psBlurSample(gl_TexCoord[0].xy, Color, blurValue, -blurValue);
|
||||
Color = psBlurSample(gl_TexCoord[0].xy, Color, -blurValue, blurValue);
|
||||
Color = psBlurSample(gl_TexCoord[0].xy, Color, 0, blurValue);
|
||||
Color = psBlurSample(gl_TexCoord[0].xy, Color, blurValue, blurValue);
|
||||
Color = psBlurSample(gl_TexCoord[0].xy, Color, -blurValue, 0);
|
||||
Color = psBlurSample(gl_TexCoord[0].xy, Color, blurValue, 0);
|
||||
|
||||
// Calculate final color.
|
||||
Color.rgb = clamp((Color.rgb / 9) * vec3(.8,.8,.8),0,1);
|
||||
// Restore and combine the alpha.
|
||||
Color.a = Alpha * float(1);
|
||||
|
||||
return Color;
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = Blur();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
#version 120
|
||||
void main()
|
||||
{
|
||||
// transform the vertex position
|
||||
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
|
||||
|
||||
// transform the texture coordinates
|
||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||
|
||||
// forward the vertex color
|
||||
gl_FrontColor = gl_Color;
|
||||
}
|
||||
|
||||
@@ -1,56 +0,0 @@
|
||||
#version 120
|
||||
uniform sampler2D backgroundSampler;
|
||||
uniform sampler2D spriteSampler;
|
||||
|
||||
vec2 spriteDimensions;
|
||||
vec2 backbufferSize;
|
||||
|
||||
float cloakAmount = 0;
|
||||
|
||||
|
||||
|
||||
float refractionIndex = 1;
|
||||
|
||||
|
||||
|
||||
vec4 simplePS()
|
||||
{
|
||||
vec2 scaler = spriteDimensions/backbufferSize;
|
||||
vec2 backPos = vec2(0,0);
|
||||
vec4 spriteColor;
|
||||
vec4 newColor;
|
||||
|
||||
spriteColor = texture2D(spriteSampler, gl_TexCoord[0].xy);
|
||||
|
||||
if (spriteColor.a > 0)
|
||||
{
|
||||
backPos = (gl_TexCoord[0].xy * scaler);
|
||||
|
||||
|
||||
if ((spriteColor.r >= 0) && (spriteColor.r < 0.5))
|
||||
backPos.x += (spriteColor.r * cloakAmount) * (scaler.x / refractionIndex);
|
||||
else
|
||||
backPos.x -= (spriteColor.r * cloakAmount) * (scaler.x / refractionIndex);
|
||||
|
||||
if ((spriteColor.g >= 0.0) && (spriteColor.g < 0.5))
|
||||
backPos.y += (spriteColor.g * cloakAmount) * (scaler.y / refractionIndex);
|
||||
else
|
||||
backPos.y -= (spriteColor.g * cloakAmount) * (scaler.y / refractionIndex);
|
||||
|
||||
backPos.x += (spriteColor.b * cloakAmount) * (scaler.y / refractionIndex);
|
||||
backPos.y += (spriteColor.b * cloakAmount) * (scaler.y / refractionIndex);
|
||||
|
||||
newColor = texture2D(backgroundSampler, backPos);
|
||||
newColor = (newColor * (1 - (spriteColor.a - cloakAmount))) + (spriteColor * (spriteColor.a - cloakAmount));
|
||||
newColor.a = spriteColor.a;
|
||||
newColor *= vec4(.8,.8,.8,1);
|
||||
}
|
||||
|
||||
return newColor;
|
||||
}
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = simplePS();
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
#version 120
|
||||
void main()
|
||||
{
|
||||
// transform the vertex position
|
||||
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
|
||||
|
||||
// transform the texture coordinates
|
||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||
|
||||
// forward the vertex color
|
||||
gl_FrontColor = gl_Color;
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
#version 120
|
||||
uniform sampler2D sceneSampler;
|
||||
|
||||
|
||||
float duration;
|
||||
vec3 color_offset = vec3(0.2, 0.4, 0.3);
|
||||
int Iterations = 128;
|
||||
vec2 Pan = vec2(0.3776610, -0.3435075);
|
||||
float Zoom = 0.4;
|
||||
float Aspect = 1;
|
||||
vec2 JuliaSeed = vec2(-0.439, 0.576);
|
||||
vec3 ColorScale = vec3(6, 5, 4);
|
||||
|
||||
vec4 DeathShaderPS()
|
||||
{
|
||||
vec4 c = texture2D(sceneSampler, gl_TexCoord[0].xy);
|
||||
|
||||
c.b = c.g = 0;
|
||||
return c;
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = DeathShaderPS();
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
#version 120
|
||||
void main()
|
||||
{
|
||||
// transform the vertex position
|
||||
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
|
||||
|
||||
// transform the texture coordinates
|
||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||
|
||||
// forward the vertex color
|
||||
gl_FrontColor = gl_Color;
|
||||
}
|
||||
@@ -1,77 +0,0 @@
|
||||
#version 120
|
||||
#define RADIUS 11
|
||||
#define KERNEL_SIZE (RADIUS * 2 + 1)
|
||||
|
||||
uniform vec2 weights_offsets[KERNEL_SIZE];
|
||||
uniform vec2 weights_offsets0;
|
||||
uniform vec2 weights_offsets1;
|
||||
uniform vec2 weights_offsets2;
|
||||
uniform vec2 weights_offsets3;
|
||||
uniform vec2 weights_offsets4;
|
||||
uniform vec2 weights_offsets5;
|
||||
uniform vec2 weights_offsets6;
|
||||
uniform vec2 weights_offsets7;
|
||||
uniform vec2 weights_offsets8;
|
||||
uniform vec2 weights_offsets9;
|
||||
uniform vec2 weights_offsets10;
|
||||
uniform vec2 weights_offsets11;
|
||||
uniform vec2 weights_offsets12;
|
||||
uniform vec2 weights_offsets13;
|
||||
uniform vec2 weights_offsets14;
|
||||
uniform vec2 weights_offsets15;
|
||||
uniform vec2 weights_offsets16;
|
||||
uniform vec2 weights_offsets17;
|
||||
uniform vec2 weights_offsets18;
|
||||
uniform vec2 weights_offsets19;
|
||||
uniform vec2 weights_offsets20;
|
||||
uniform vec2 weights_offsets21;
|
||||
uniform vec2 weights_offsets22;
|
||||
|
||||
|
||||
uniform sampler2D colorMapTexture;
|
||||
|
||||
vec4 GaussianBlurHorizontal()
|
||||
{
|
||||
vec4 color = vec4(0,0,0,0);
|
||||
|
||||
vec2 weights_offsets[KERNEL_SIZE] = vec2[KERNEL_SIZE]
|
||||
(
|
||||
weights_offsets0,
|
||||
weights_offsets1,
|
||||
weights_offsets2,
|
||||
weights_offsets3,
|
||||
weights_offsets4,
|
||||
weights_offsets5,
|
||||
weights_offsets6,
|
||||
weights_offsets7,
|
||||
weights_offsets8,
|
||||
weights_offsets9,
|
||||
weights_offsets10,
|
||||
weights_offsets11,
|
||||
weights_offsets12,
|
||||
weights_offsets13,
|
||||
weights_offsets14,
|
||||
weights_offsets15,
|
||||
weights_offsets16,
|
||||
weights_offsets17,
|
||||
weights_offsets18,
|
||||
weights_offsets19,
|
||||
weights_offsets20,
|
||||
weights_offsets21,
|
||||
weights_offsets22
|
||||
);
|
||||
|
||||
|
||||
for (int i = 0; i < KERNEL_SIZE; ++i)
|
||||
{
|
||||
color += texture2D(colorMapTexture, vec2(gl_TexCoord[0].x + weights_offsets[i].y, gl_TexCoord[0].y))* weights_offsets[i].x;
|
||||
}
|
||||
|
||||
return color;
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = GaussianBlurHorizontal();
|
||||
}
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
#version 120
|
||||
void main()
|
||||
{
|
||||
// transform the vertex position
|
||||
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
|
||||
|
||||
// transform the texture coordinates
|
||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||
|
||||
// forward the vertex color
|
||||
gl_FrontColor = gl_Color;
|
||||
}
|
||||
@@ -1,73 +0,0 @@
|
||||
#version 120
|
||||
#define RADIUS 11
|
||||
#define KERNEL_SIZE (RADIUS * 2 + 1)
|
||||
|
||||
uniform vec2 weights_offsets[KERNEL_SIZE];
|
||||
uniform vec2 weights_offsets0;
|
||||
uniform vec2 weights_offsets1;
|
||||
uniform vec2 weights_offsets2;
|
||||
uniform vec2 weights_offsets3;
|
||||
uniform vec2 weights_offsets4;
|
||||
uniform vec2 weights_offsets5;
|
||||
uniform vec2 weights_offsets6;
|
||||
uniform vec2 weights_offsets7;
|
||||
uniform vec2 weights_offsets8;
|
||||
uniform vec2 weights_offsets9;
|
||||
uniform vec2 weights_offsets10;
|
||||
uniform vec2 weights_offsets11;
|
||||
uniform vec2 weights_offsets12;
|
||||
uniform vec2 weights_offsets13;
|
||||
uniform vec2 weights_offsets14;
|
||||
uniform vec2 weights_offsets15;
|
||||
uniform vec2 weights_offsets16;
|
||||
uniform vec2 weights_offsets17;
|
||||
uniform vec2 weights_offsets18;
|
||||
uniform vec2 weights_offsets19;
|
||||
uniform vec2 weights_offsets20;
|
||||
uniform vec2 weights_offsets21;
|
||||
uniform vec2 weights_offsets22;
|
||||
|
||||
uniform sampler2D colorMapTexture;
|
||||
|
||||
vec4 GaussianBlurVertical()
|
||||
{
|
||||
vec2 weights_offsets[KERNEL_SIZE] = vec2[KERNEL_SIZE]
|
||||
(
|
||||
weights_offsets0,
|
||||
weights_offsets1,
|
||||
weights_offsets2,
|
||||
weights_offsets3,
|
||||
weights_offsets4,
|
||||
weights_offsets5,
|
||||
weights_offsets6,
|
||||
weights_offsets7,
|
||||
weights_offsets8,
|
||||
weights_offsets9,
|
||||
weights_offsets10,
|
||||
weights_offsets11,
|
||||
weights_offsets12,
|
||||
weights_offsets13,
|
||||
weights_offsets14,
|
||||
weights_offsets15,
|
||||
weights_offsets16,
|
||||
weights_offsets17,
|
||||
weights_offsets18,
|
||||
weights_offsets19,
|
||||
weights_offsets20,
|
||||
weights_offsets21,
|
||||
weights_offsets22
|
||||
);
|
||||
|
||||
vec4 color = vec4(0,0,0,0);
|
||||
|
||||
for (int i = 0; i < KERNEL_SIZE; ++i)
|
||||
{
|
||||
color += texture2D(colorMapTexture, vec2(gl_TexCoord[0].x, gl_TexCoord[0].y + weights_offsets[i].y)) * weights_offsets[i].x; // M A G I K
|
||||
}
|
||||
return color;
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = GaussianBlurVertical();
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
#version 120
|
||||
void main()
|
||||
{
|
||||
// transform the vertex position
|
||||
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
|
||||
|
||||
// transform the texture coordinates
|
||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||
|
||||
// forward the vertex color
|
||||
gl_FrontColor = gl_Color;
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
#version 120
|
||||
#define RADIUS 3
|
||||
#define KERNEL_SIZE (RADIUS * 2 + 1)
|
||||
|
||||
uniform vec2 weights_offsets[KERNEL_SIZE];
|
||||
uniform vec2 weights_offsets0;
|
||||
uniform vec2 weights_offsets1;
|
||||
uniform vec2 weights_offsets2;
|
||||
uniform vec2 weights_offsets3;
|
||||
uniform vec2 weights_offsets4;
|
||||
uniform vec2 weights_offsets5;
|
||||
uniform vec2 weights_offsets6;
|
||||
|
||||
uniform sampler2D colorMapTexture;
|
||||
|
||||
vec4 GaussianBlurHorizontal()
|
||||
{
|
||||
vec4 color = vec4(0,0,0,0);
|
||||
|
||||
vec2 weights_offsets[KERNEL_SIZE] = vec2[KERNEL_SIZE]
|
||||
(
|
||||
weights_offsets0,
|
||||
weights_offsets1,
|
||||
weights_offsets2,
|
||||
weights_offsets3,
|
||||
weights_offsets4,
|
||||
weights_offsets5,
|
||||
weights_offsets6
|
||||
);
|
||||
|
||||
for (int i = 0; i < KERNEL_SIZE; ++i)
|
||||
color += texture2D(colorMapTexture, vec2(gl_TexCoord[0].x + weights_offsets[i].y, gl_TexCoord[0].y)) * weights_offsets[i].x;
|
||||
|
||||
return color;
|
||||
}
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = GaussianBlurHorizontal();
|
||||
}
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
#version 120
|
||||
void main()
|
||||
{
|
||||
// transform the vertex position
|
||||
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
|
||||
|
||||
// transform the texture coordinates
|
||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||
|
||||
// forward the vertex color
|
||||
gl_FrontColor = gl_Color;
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
#version 120
|
||||
#define RADIUS 3
|
||||
#define KERNEL_SIZE (RADIUS * 2 + 1)
|
||||
|
||||
uniform vec2 weights_offsets[KERNEL_SIZE];
|
||||
uniform vec2 weights_offsets0;
|
||||
uniform vec2 weights_offsets1;
|
||||
uniform vec2 weights_offsets2;
|
||||
uniform vec2 weights_offsets3;
|
||||
uniform vec2 weights_offsets4;
|
||||
uniform vec2 weights_offsets5;
|
||||
uniform vec2 weights_offsets6;
|
||||
|
||||
uniform sampler2D colorMapTexture;
|
||||
|
||||
vec4 GaussianBlurVertical()
|
||||
{
|
||||
vec4 color = vec4(0,0,0,0);
|
||||
|
||||
vec2 weights_offsets[KERNEL_SIZE] = vec2[KERNEL_SIZE]
|
||||
(
|
||||
weights_offsets0,
|
||||
weights_offsets1,
|
||||
weights_offsets2,
|
||||
weights_offsets3,
|
||||
weights_offsets4,
|
||||
weights_offsets5,
|
||||
weights_offsets6
|
||||
);
|
||||
|
||||
for (int i = 0; i < KERNEL_SIZE; ++i)
|
||||
color += texture2D(colorMapTexture, vec2(gl_TexCoord[0].x, gl_TexCoord[0].y + weights_offsets[i].y)) * weights_offsets[i].x;
|
||||
|
||||
return color;
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = GaussianBlurVertical();
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
#version 120
|
||||
attribute vec4 a_color;
|
||||
attribute vec3 a_position;
|
||||
attribute vec2 a_texCoord0;
|
||||
|
||||
varying vec2 TexCoord;
|
||||
|
||||
void main()
|
||||
{
|
||||
// transform the vertex position
|
||||
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
|
||||
|
||||
// transform the texture coordinates
|
||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||
|
||||
// forward the vertex color
|
||||
gl_FrontColor = gl_Color;
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
#version 120
|
||||
#define RADIUS 5
|
||||
#define KERNEL_SIZE (RADIUS * 2 + 1)
|
||||
|
||||
uniform vec2 weights_offsets[KERNEL_SIZE];
|
||||
uniform vec2 weights_offsets0;
|
||||
uniform vec2 weights_offsets1;
|
||||
uniform vec2 weights_offsets2;
|
||||
uniform vec2 weights_offsets3;
|
||||
uniform vec2 weights_offsets4;
|
||||
uniform vec2 weights_offsets5;
|
||||
uniform vec2 weights_offsets6;
|
||||
uniform vec2 weights_offsets7;
|
||||
uniform vec2 weights_offsets8;
|
||||
uniform vec2 weights_offsets9;
|
||||
uniform vec2 weights_offsets10;
|
||||
|
||||
uniform sampler2D colorMapTexture;
|
||||
|
||||
vec4 GaussianBlurHorizontal()
|
||||
{
|
||||
vec4 color = vec4(0,0,0,0);
|
||||
|
||||
vec2 weights_offsets[KERNEL_SIZE] = vec2[KERNEL_SIZE]
|
||||
(
|
||||
weights_offsets0,
|
||||
weights_offsets1,
|
||||
weights_offsets2,
|
||||
weights_offsets3,
|
||||
weights_offsets4,
|
||||
weights_offsets5,
|
||||
weights_offsets6,
|
||||
weights_offsets7,
|
||||
weights_offsets8,
|
||||
weights_offsets9,
|
||||
weights_offsets10
|
||||
);
|
||||
|
||||
for (int i = 0; i < KERNEL_SIZE; ++i)
|
||||
color += texture2D(colorMapTexture, vec2(gl_TexCoord[0].x + weights_offsets[i].y, gl_TexCoord[0].y)) * weights_offsets[i].x;
|
||||
|
||||
return color;
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = GaussianBlurHorizontal();
|
||||
}
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
#version 120
|
||||
void main()
|
||||
{
|
||||
// transform the vertex position
|
||||
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
|
||||
|
||||
// transform the texture coordinates
|
||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||
|
||||
// forward the vertex color
|
||||
gl_FrontColor = gl_Color;
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
#version 120
|
||||
#define RADIUS 5
|
||||
#define KERNEL_SIZE (RADIUS * 2 + 1)
|
||||
|
||||
uniform vec2 weights_offsets[KERNEL_SIZE];
|
||||
uniform vec2 weights_offsets0;
|
||||
uniform vec2 weights_offsets1;
|
||||
uniform vec2 weights_offsets2;
|
||||
uniform vec2 weights_offsets3;
|
||||
uniform vec2 weights_offsets4;
|
||||
uniform vec2 weights_offsets5;
|
||||
uniform vec2 weights_offsets6;
|
||||
uniform vec2 weights_offsets7;
|
||||
uniform vec2 weights_offsets8;
|
||||
uniform vec2 weights_offsets9;
|
||||
uniform vec2 weights_offsets10;
|
||||
|
||||
uniform sampler2D colorMapTexture;
|
||||
|
||||
vec4 GaussianBlurVertical()
|
||||
{
|
||||
vec4 color = vec4(0,0,0,0);
|
||||
|
||||
vec2 weights_offsets[KERNEL_SIZE] = vec2[KERNEL_SIZE]
|
||||
(
|
||||
weights_offsets0,
|
||||
weights_offsets1,
|
||||
weights_offsets2,
|
||||
weights_offsets3,
|
||||
weights_offsets4,
|
||||
weights_offsets5,
|
||||
weights_offsets6,
|
||||
weights_offsets7,
|
||||
weights_offsets8,
|
||||
weights_offsets9,
|
||||
weights_offsets10
|
||||
);
|
||||
|
||||
for (int i = 0; i < KERNEL_SIZE; ++i)
|
||||
color += texture2D(colorMapTexture, vec2(gl_TexCoord[0].x, gl_TexCoord[0].y + weights_offsets[i].y)) * weights_offsets[i].x;
|
||||
|
||||
return color;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = GaussianBlurVertical();
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
#version 120
|
||||
void main()
|
||||
{
|
||||
// transform the vertex position
|
||||
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
|
||||
|
||||
// transform the texture coordinates
|
||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||
|
||||
// forward the vertex color
|
||||
gl_FrontColor = gl_Color;
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
#version 120
|
||||
#define RADIUS 7
|
||||
#define KERNEL_SIZE (RADIUS * 2 + 1)
|
||||
|
||||
uniform vec2 weights_offsets[KERNEL_SIZE];
|
||||
uniform vec2 weights_offsets0;
|
||||
uniform vec2 weights_offsets1;
|
||||
uniform vec2 weights_offsets2;
|
||||
uniform vec2 weights_offsets3;
|
||||
uniform vec2 weights_offsets4;
|
||||
uniform vec2 weights_offsets5;
|
||||
uniform vec2 weights_offsets6;
|
||||
uniform vec2 weights_offsets7;
|
||||
uniform vec2 weights_offsets8;
|
||||
uniform vec2 weights_offsets9;
|
||||
uniform vec2 weights_offsets10;
|
||||
uniform vec2 weights_offsets11;
|
||||
uniform vec2 weights_offsets12;
|
||||
uniform vec2 weights_offsets13;
|
||||
uniform vec2 weights_offsets14;
|
||||
|
||||
uniform sampler2D colorMapTexture;
|
||||
|
||||
vec4 GaussianBlurHorizontal()
|
||||
{
|
||||
vec4 color = vec4(0,0,0,0);
|
||||
|
||||
vec2 weights_offsets[KERNEL_SIZE] = vec2[KERNEL_SIZE]
|
||||
(
|
||||
weights_offsets0,
|
||||
weights_offsets1,
|
||||
weights_offsets2,
|
||||
weights_offsets3,
|
||||
weights_offsets4,
|
||||
weights_offsets5,
|
||||
weights_offsets6,
|
||||
weights_offsets7,
|
||||
weights_offsets8,
|
||||
weights_offsets9,
|
||||
weights_offsets10,
|
||||
weights_offsets11,
|
||||
weights_offsets12,
|
||||
weights_offsets13,
|
||||
weights_offsets14
|
||||
);
|
||||
|
||||
for (int i = 0; i < KERNEL_SIZE; ++i)
|
||||
color += texture2D(colorMapTexture, vec2(gl_TexCoord[0].x + weights_offsets[i].y, gl_TexCoord[0].y)) * weights_offsets[i].x;
|
||||
|
||||
return color;
|
||||
}
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = GaussianBlurHorizontal();
|
||||
}
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
#version 120
|
||||
void main()
|
||||
{
|
||||
// transform the vertex position
|
||||
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
|
||||
|
||||
// transform the texture coordinates
|
||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||
|
||||
// forward the vertex color
|
||||
gl_FrontColor = gl_Color;
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
#version 120
|
||||
#define RADIUS 7
|
||||
#define KERNEL_SIZE (RADIUS * 2 + 1)
|
||||
|
||||
uniform vec2 weights_offsets[KERNEL_SIZE];
|
||||
uniform vec2 weights_offsets0;
|
||||
uniform vec2 weights_offsets1;
|
||||
uniform vec2 weights_offsets2;
|
||||
uniform vec2 weights_offsets3;
|
||||
uniform vec2 weights_offsets4;
|
||||
uniform vec2 weights_offsets5;
|
||||
uniform vec2 weights_offsets6;
|
||||
uniform vec2 weights_offsets7;
|
||||
uniform vec2 weights_offsets8;
|
||||
uniform vec2 weights_offsets9;
|
||||
uniform vec2 weights_offsets10;
|
||||
uniform vec2 weights_offsets11;
|
||||
uniform vec2 weights_offsets12;
|
||||
uniform vec2 weights_offsets13;
|
||||
uniform vec2 weights_offsets14;
|
||||
|
||||
|
||||
uniform sampler2D colorMapTexture;
|
||||
|
||||
vec4 GaussianBlurVertical()
|
||||
{
|
||||
vec4 color = vec4(0,0,0,0);
|
||||
|
||||
vec2 weights_offsets[KERNEL_SIZE] = vec2[KERNEL_SIZE]
|
||||
(
|
||||
weights_offsets0,
|
||||
weights_offsets1,
|
||||
weights_offsets2,
|
||||
weights_offsets3,
|
||||
weights_offsets4,
|
||||
weights_offsets5,
|
||||
weights_offsets6,
|
||||
weights_offsets7,
|
||||
weights_offsets8,
|
||||
weights_offsets9,
|
||||
weights_offsets10,
|
||||
weights_offsets11,
|
||||
weights_offsets12,
|
||||
weights_offsets13,
|
||||
weights_offsets14
|
||||
);
|
||||
|
||||
for (int i = 0; i < KERNEL_SIZE; ++i)
|
||||
color += texture2D(colorMapTexture, vec2(gl_TexCoord[0].x, gl_TexCoord[0].y + weights_offsets[i].y)) * weights_offsets[i].x;
|
||||
|
||||
return color;
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = GaussianBlurVertical();
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
#version 120
|
||||
void main()
|
||||
{
|
||||
// transform the vertex position
|
||||
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
|
||||
|
||||
// transform the texture coordinates
|
||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||
|
||||
// forward the vertex color
|
||||
gl_FrontColor = gl_Color;
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
#version 120
|
||||
#define RADIUS 9
|
||||
#define KERNEL_SIZE (RADIUS * 2 + 1)
|
||||
|
||||
uniform vec2 weights_offsets[KERNEL_SIZE];
|
||||
uniform vec2 weights_offsets0;
|
||||
uniform vec2 weights_offsets1;
|
||||
uniform vec2 weights_offsets2;
|
||||
uniform vec2 weights_offsets3;
|
||||
uniform vec2 weights_offsets4;
|
||||
uniform vec2 weights_offsets5;
|
||||
uniform vec2 weights_offsets6;
|
||||
uniform vec2 weights_offsets7;
|
||||
uniform vec2 weights_offsets8;
|
||||
uniform vec2 weights_offsets9;
|
||||
uniform vec2 weights_offsets10;
|
||||
uniform vec2 weights_offsets11;
|
||||
uniform vec2 weights_offsets12;
|
||||
uniform vec2 weights_offsets13;
|
||||
uniform vec2 weights_offsets14;
|
||||
uniform vec2 weights_offsets15;
|
||||
uniform vec2 weights_offsets16;
|
||||
uniform vec2 weights_offsets17;
|
||||
uniform vec2 weights_offsets18;
|
||||
|
||||
uniform sampler2D colorMapTexture;
|
||||
|
||||
vec4 GaussianBlurHorizontal()
|
||||
{
|
||||
vec4 color = vec4(0,0,0,0);
|
||||
|
||||
vec2 weights_offsets[KERNEL_SIZE] = vec2[KERNEL_SIZE]
|
||||
(
|
||||
weights_offsets0,
|
||||
weights_offsets1,
|
||||
weights_offsets2,
|
||||
weights_offsets3,
|
||||
weights_offsets4,
|
||||
weights_offsets5,
|
||||
weights_offsets6,
|
||||
weights_offsets7,
|
||||
weights_offsets8,
|
||||
weights_offsets9,
|
||||
weights_offsets10,
|
||||
weights_offsets11,
|
||||
weights_offsets12,
|
||||
weights_offsets13,
|
||||
weights_offsets14,
|
||||
weights_offsets15,
|
||||
weights_offsets16,
|
||||
weights_offsets17,
|
||||
weights_offsets18
|
||||
);
|
||||
|
||||
for (int i = 0; i < KERNEL_SIZE; ++i)
|
||||
color += texture2D(colorMapTexture, vec2(gl_TexCoord[0].x + weights_offsets[i].y, gl_TexCoord[0].y)) * weights_offsets[i].x;
|
||||
|
||||
return color;
|
||||
}
|
||||
void main()
|
||||
{
|
||||
|
||||
gl_FragColor = GaussianBlurHorizontal();
|
||||
}
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
#version 120
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
// transform the vertex position
|
||||
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
|
||||
|
||||
// transform the texture coordinates
|
||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||
|
||||
// forward the vertex color
|
||||
gl_FrontColor = gl_Color;
|
||||
}
|
||||
@@ -1,66 +0,0 @@
|
||||
#version 120
|
||||
#define RADIUS 9
|
||||
#define KERNEL_SIZE (RADIUS * 2 + 1)
|
||||
|
||||
uniform vec2 weights_offsets[KERNEL_SIZE];
|
||||
uniform vec2 weights_offsets0;
|
||||
uniform vec2 weights_offsets1;
|
||||
uniform vec2 weights_offsets2;
|
||||
uniform vec2 weights_offsets3;
|
||||
uniform vec2 weights_offsets4;
|
||||
uniform vec2 weights_offsets5;
|
||||
uniform vec2 weights_offsets6;
|
||||
uniform vec2 weights_offsets7;
|
||||
uniform vec2 weights_offsets8;
|
||||
uniform vec2 weights_offsets9;
|
||||
uniform vec2 weights_offsets10;
|
||||
uniform vec2 weights_offsets11;
|
||||
uniform vec2 weights_offsets12;
|
||||
uniform vec2 weights_offsets13;
|
||||
uniform vec2 weights_offsets14;
|
||||
uniform vec2 weights_offsets15;
|
||||
uniform vec2 weights_offsets16;
|
||||
uniform vec2 weights_offsets17;
|
||||
uniform vec2 weights_offsets18;
|
||||
|
||||
uniform sampler2D colorMapTexture;
|
||||
|
||||
vec4 GaussianBlurVertical()
|
||||
{
|
||||
vec4 color = vec4(0,0,0,0);
|
||||
|
||||
vec2 weights_offsets[KERNEL_SIZE] = vec2[KERNEL_SIZE]
|
||||
(
|
||||
weights_offsets0,
|
||||
weights_offsets1,
|
||||
weights_offsets2,
|
||||
weights_offsets3,
|
||||
weights_offsets4,
|
||||
weights_offsets5,
|
||||
weights_offsets6,
|
||||
weights_offsets7,
|
||||
weights_offsets8,
|
||||
weights_offsets9,
|
||||
weights_offsets10,
|
||||
weights_offsets11,
|
||||
weights_offsets12,
|
||||
weights_offsets13,
|
||||
weights_offsets14,
|
||||
weights_offsets15,
|
||||
weights_offsets16,
|
||||
weights_offsets17,
|
||||
weights_offsets18
|
||||
);
|
||||
|
||||
for (int i = 0; i < KERNEL_SIZE; ++i)
|
||||
color += texture2D(colorMapTexture, vec2(gl_TexCoord[0].x, gl_TexCoord[0].y + weights_offsets[i].y)) * weights_offsets[i].x;
|
||||
|
||||
return color;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = GaussianBlurVertical();
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
#version 120
|
||||
void main()
|
||||
{
|
||||
// transform the vertex position
|
||||
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
|
||||
|
||||
// transform the texture coordinates
|
||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||
|
||||
// forward the vertex color
|
||||
gl_FrontColor = gl_Color;
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
#version 120
|
||||
uniform sampler2D TextureUnit0;
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = texture2D(TextureUnit0,gl_TexCoord[0].xy);
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
#version 120
|
||||
void main()
|
||||
{
|
||||
// transform the vertex position
|
||||
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
|
||||
|
||||
// transform the texture coordinates
|
||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||
|
||||
// forward the vertex color
|
||||
gl_FrontColor = gl_Color;
|
||||
}
|
||||
@@ -1,85 +0,0 @@
|
||||
#version 120
|
||||
#define NUM_LIGHTS 6
|
||||
uniform vec4 LightPosData0;
|
||||
uniform vec4 LightPosData1;
|
||||
uniform vec4 LightPosData2;
|
||||
uniform vec4 LightPosData3;
|
||||
uniform vec4 LightPosData4;
|
||||
uniform vec4 LightPosData5;
|
||||
uniform vec4 LightPosData[NUM_LIGHTS];
|
||||
|
||||
uniform vec4 Colors[NUM_LIGHTS];
|
||||
uniform vec4 Colors0;
|
||||
uniform vec4 Colors1;
|
||||
uniform vec4 Colors2;
|
||||
uniform vec4 Colors3;
|
||||
uniform vec4 Colors4;
|
||||
uniform vec4 Colors5;
|
||||
|
||||
uniform sampler2D light0;
|
||||
uniform sampler2D light1;
|
||||
uniform sampler2D light2;
|
||||
uniform sampler2D light3;
|
||||
uniform sampler2D light4;
|
||||
uniform sampler2D light5;
|
||||
|
||||
uniform sampler2D sceneTexture;
|
||||
|
||||
vec4 PreLightBlendPS()
|
||||
{
|
||||
vec4 Colors[NUM_LIGHTS] = vec4[NUM_LIGHTS]
|
||||
(
|
||||
Colors0,
|
||||
Colors1,
|
||||
Colors2,
|
||||
Colors3,
|
||||
Colors4,
|
||||
Colors5
|
||||
);
|
||||
|
||||
vec4 LightPosData[NUM_LIGHTS] = vec4[NUM_LIGHTS]
|
||||
(
|
||||
LightPosData0,
|
||||
LightPosData1,
|
||||
LightPosData2,
|
||||
LightPosData3,
|
||||
LightPosData4,
|
||||
LightPosData5
|
||||
);
|
||||
|
||||
vec4 l[NUM_LIGHTS];
|
||||
vec2 ltc[NUM_LIGHTS];
|
||||
for(int i = 0;i<NUM_LIGHTS;i++)
|
||||
{
|
||||
ltc[i] = vec2((gl_TexCoord[0].x - LightPosData[i].x) * LightPosData[i].z, (gl_TexCoord[0].y - LightPosData[i].y) * LightPosData[i].w);
|
||||
}
|
||||
l[0] = texture2D(light0, ltc[0]);
|
||||
l[1] = texture2D(light1, ltc[1]);
|
||||
l[2] = texture2D(light2, ltc[2]);
|
||||
l[3] = texture2D(light3, ltc[3]);
|
||||
l[4] = texture2D(light4, ltc[4]);
|
||||
l[5] = texture2D(light5, ltc[5]);
|
||||
|
||||
l[0].rgb = l[0].rgb * Colors[0].rgb;
|
||||
l[1].rgb = l[1].rgb * Colors[1].rgb;
|
||||
l[2].rgb = l[2].rgb * Colors[2].rgb;
|
||||
l[3].rgb = l[3].rgb * Colors[3].rgb;
|
||||
l[4].rgb = l[4].rgb * Colors[4].rgb;
|
||||
l[5].rgb = l[5].rgb * Colors[5].rgb;
|
||||
|
||||
vec4 s = texture2D(sceneTexture, gl_TexCoord[0].xy); // sample existing lights
|
||||
|
||||
//Add the lights together
|
||||
float r = sqrt(pow(l[0].r, 2) + pow(l[1].r, 2) + pow(l[2].r, 2) + pow(l[3].r, 2) + pow(l[4].r, 2) + pow(l[5].r, 2) + pow(s.r, 2));
|
||||
float g = sqrt(pow(l[0].g, 2) + pow(l[1].g, 2) + pow(l[2].g, 2) + pow(l[3].g, 2) + pow(l[4].g, 2) + pow(l[5].g, 2) + pow(s.g, 2));
|
||||
float b = sqrt(pow(l[0].b, 2) + pow(l[1].b, 2) + pow(l[2].b, 2) + pow(l[3].b, 2) + pow(l[4].b, 2) + pow(l[5].b, 2) + pow(s.b, 2));
|
||||
vec4 c = vec4(r,g,b, 1);
|
||||
return c;
|
||||
//Return the light color
|
||||
return vec4(c.rgb,min(1, 1/max(c.r, max(c.g,c.b))));
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = PreLightBlendPS();
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
#version 120
|
||||
void main()
|
||||
{
|
||||
// transform the vertex position
|
||||
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
|
||||
|
||||
// transform the texture coordinates
|
||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||
|
||||
// forward the vertex color
|
||||
gl_FrontColor = gl_Color;
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
#version 120
|
||||
uniform sampler2D TextureUnit0;
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
|
||||
gl_FragColor = texture2D(TextureUnit0,gl_TexCoord[0].xy) + vec4(.5,0,0,0);
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
#version 120
|
||||
void main()
|
||||
{
|
||||
// transform the vertex position
|
||||
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
|
||||
|
||||
// transform the texture coordinates
|
||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||
|
||||
// forward the vertex color
|
||||
gl_FrontColor = gl_Color;
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
#version 120
|
||||
uniform sampler2D playerViewSampler;
|
||||
uniform sampler2D sceneSampler;
|
||||
uniform sampler2D lightSampler;
|
||||
|
||||
vec4 DrawTilesInversePlayerViewPS(vec2 TexCoord)
|
||||
{
|
||||
vec4 pv = texture2D(playerViewSampler, TexCoord);
|
||||
float v = 1 - min(length(pv.rgb),1);
|
||||
vec4 s = texture2D(sceneSampler, TexCoord);
|
||||
vec4 t = texture2D(lightSampler, TexCoord);
|
||||
return vec4(t.rgb + s.rgb, v);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = DrawTilesInversePlayerViewPS(gl_TexCoord[0].xy);
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
#version 120
|
||||
void main()
|
||||
{
|
||||
// transform the vertex position
|
||||
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
|
||||
|
||||
// transform the texture coordinates
|
||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||
|
||||
// forward the vertex color
|
||||
gl_FrontColor = gl_Color;
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
#version 120
|
||||
uniform sampler2D LightTexture;
|
||||
uniform sampler2D SceneTexture;
|
||||
uniform sampler2D PlayerViewTexture;
|
||||
uniform sampler2D OutOfViewTexture;
|
||||
|
||||
uniform vec4 AmbientLight;
|
||||
uniform vec4 MaskProps;
|
||||
|
||||
|
||||
vec4 LightBlendPS(vec2 TexCoord)
|
||||
{
|
||||
vec4 a = AmbientLight;
|
||||
vec4 l = texture2D(LightTexture, TexCoord); //Sample light/shadows
|
||||
l = max(l,a); // Set a minimum level of light
|
||||
vec4 c = texture2D(SceneTexture, TexCoord); //Sample scene color
|
||||
vec4 pv = texture2D(PlayerViewTexture, TexCoord); // Sample player view
|
||||
|
||||
vec2 masktc = TexCoord;
|
||||
masktc.x = masktc.x * MaskProps.x * MaskProps.z;
|
||||
masktc.y = masktc.y * MaskProps.y * MaskProps.w;
|
||||
|
||||
vec4 t = texture2D(OutOfViewTexture, masktc); // Sample mask
|
||||
|
||||
//Generate scuzz for occluded areas
|
||||
/*float4 t;
|
||||
float2 lines;
|
||||
lines.x = 1 * (TexCoord.x * MaskProps.x + MaskProps.z);
|
||||
lines.y = 1 * (TexCoord.y * MaskProps.y + MaskProps.w);
|
||||
float s = (sin(lines.x + lines.y + lines.y) + sin(lines.x - lines.y));
|
||||
t.rgb = 0;
|
||||
if(s > 0.5)
|
||||
{
|
||||
t.rgb = 0.1;
|
||||
}*/
|
||||
|
||||
t.a = 1;
|
||||
//End generate scuzz
|
||||
|
||||
vec3 h; // calculate hard light
|
||||
h.r = l.r <= 0.5 ? 2 * l.r * c.r : 1 - (2 * (1 - l.r) * (1 - c.r) );
|
||||
h.g = l.g <= 0.5 ? 2 * l.g * c.g : 1 - (2 * (1 - l.g) * (1 - c.g) );
|
||||
h.b = l.b <= 0.5 ? 2 * l.b * c.b : 1 - (2 * (1 - l.b) * (1 - c.b) );
|
||||
|
||||
vec4 result;
|
||||
result = vec4(max(c.rgb*l.rgb, h.rgb), pv.r)* 1;
|
||||
result = result + (t *( 1 - pv.r));
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
|
||||
gl_FragColor = LightBlendPS(gl_TexCoord[0].xy);
|
||||
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
#version 120
|
||||
void main()
|
||||
{
|
||||
// transform the vertex position
|
||||
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
|
||||
|
||||
// transform the texture coordinates
|
||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||
|
||||
// forward the vertex color
|
||||
gl_FrontColor = gl_Color;
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
#version 120
|
||||
uniform sampler2D maskSampler;
|
||||
uniform sampler2D lightSampler;
|
||||
|
||||
uniform vec4 MaskProps;
|
||||
uniform vec4 DiffuseColor;
|
||||
|
||||
vec4 MaskLightPS(vec2 TexCoord)
|
||||
{
|
||||
vec4 p = MaskProps;
|
||||
vec2 tc = TexCoord;
|
||||
vec4 d = DiffuseColor;
|
||||
float t;
|
||||
if(p.x > 0) // x is rot 90 degrees
|
||||
{ // We just flip the axes.
|
||||
t = tc.x;
|
||||
tc.x = tc.y;
|
||||
tc.y = t;
|
||||
}
|
||||
if(p.y > 0) // y is flip horizontally
|
||||
{
|
||||
tc.x = 1 - tc.x;
|
||||
}
|
||||
if(p.z > 0) // z is flip vertically
|
||||
{
|
||||
tc.y = 1 - tc.y;
|
||||
}
|
||||
|
||||
vec4 l = texture2D(lightSampler, TexCoord);
|
||||
l = vec4(l.r * d.r, l.g * d.g, l.b * d.b, l.a);
|
||||
vec4 m = texture2D(maskSampler, tc);
|
||||
|
||||
return vec4(l.rgb, m.r)* l.a;
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = MaskLightPS(gl_TexCoord[0].xy);
|
||||
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
#version 120
|
||||
void main()
|
||||
{
|
||||
// transform the vertex position
|
||||
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
|
||||
|
||||
// transform the texture coordinates
|
||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||
|
||||
// forward the vertex color
|
||||
gl_FrontColor = gl_Color;
|
||||
}
|
||||
59
Resources/Shaders/outline.gdsl
Normal file
59
Resources/Shaders/outline.gdsl
Normal file
@@ -0,0 +1,59 @@
|
||||
shader_type canvas_item;
|
||||
uniform float outline_width = 2.0;
|
||||
uniform vec4 outline_color: hint_color;
|
||||
|
||||
void fragment() {
|
||||
// I, for some reason, cannot put this comment in the top of the file.
|
||||
// Taken from the godot-demo-projects repo.
|
||||
// GODOT ENGINE
|
||||
// http://www.godotengine.org
|
||||
//
|
||||
// ************************************************************************
|
||||
//
|
||||
// Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
//************************************************************************
|
||||
|
||||
vec4 col = texture(TEXTURE, UV);
|
||||
vec2 ps = TEXTURE_PIXEL_SIZE;
|
||||
float a;
|
||||
float maxa = col.a;
|
||||
float mina = col.a;
|
||||
|
||||
a = texture(TEXTURE, UV + vec2(0, -outline_width)*ps).a;
|
||||
maxa = max(a, maxa);
|
||||
mina = min(a, mina);
|
||||
|
||||
a = texture(TEXTURE, UV + vec2(0, outline_width)*ps).a;
|
||||
maxa = max(a, maxa);
|
||||
mina = min(a, mina);
|
||||
|
||||
a = texture(TEXTURE, UV + vec2(-outline_width,0)*ps).a;
|
||||
maxa = max(a, maxa);
|
||||
mina = min(a, mina);
|
||||
|
||||
a = texture(TEXTURE, UV + vec2(outline_width, 0)*ps).a;
|
||||
maxa = max(a, maxa);
|
||||
mina = min(a, mina);
|
||||
|
||||
COLOR = mix(col, outline_color, maxa-mina);
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
#version 120
|
||||
|
||||
|
||||
uniform sampler2D inputSampler;
|
||||
|
||||
vec4 CopyPS()
|
||||
{
|
||||
return texture2D(inputSampler, gl_TexCoord[0].xy);
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = CopyPS();
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
#version 120
|
||||
void main()
|
||||
{
|
||||
// transform the vertex position
|
||||
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
|
||||
|
||||
// transform the texture coordinates
|
||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||
|
||||
// forward the vertex color
|
||||
gl_FrontColor = gl_Color;
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
#version 120
|
||||
uniform sampler2D texture;
|
||||
uniform float TextureDimensions;
|
||||
|
||||
|
||||
vec4 HorizontalReductionPS()
|
||||
{
|
||||
vec2 color = texture2D(texture, gl_TexCoord[0].xy).rg;
|
||||
vec2 colorR;
|
||||
// This modulus bullshit is because every texel in the source image is evaluated in GLSL
|
||||
// If we don't check whether the texel is odd or even, we would end up
|
||||
// incorrectly taking the max of the pixel to the right versus this one,
|
||||
// making our horizontal reduction invalid.
|
||||
if (mod(gl_TexCoord[0].x / TextureDimensions, 2) == 0)
|
||||
colorR = texture2D(texture, gl_TexCoord[0].xy + vec2(TextureDimensions,0)).rg;
|
||||
else
|
||||
colorR = texture2D(texture, gl_TexCoord[0].xy - vec2(TextureDimensions,0)).rg;
|
||||
vec2 result = min(color, colorR);
|
||||
return vec4(result,0,1);
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = HorizontalReductionPS();
|
||||
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
#version 120
|
||||
void main()
|
||||
{
|
||||
// transform the vertex position
|
||||
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
|
||||
|
||||
// transform the texture coordinates
|
||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||
|
||||
// forward the vertex color
|
||||
gl_FrontColor = gl_Color;
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
#version 120
|
||||
uniform vec2 renderTargetSize;
|
||||
|
||||
uniform sampler2D inputSampler;
|
||||
const float minBlur = 1.0;
|
||||
const float maxBlur = 20.0;
|
||||
const int g_cKernelSize = 13;
|
||||
const vec2 weights_offsets0 = vec2( -6, 0.002216 );
|
||||
const vec2 weights_offsets1 = vec2( -5, 0.008764 );
|
||||
const vec2 weights_offsets2 = vec2( -4, 0.026995 );
|
||||
const vec2 weights_offsets3 = vec2( -3, 0.064759 );
|
||||
const vec2 weights_offsets4 = vec2( -2, 0.120985 );
|
||||
const vec2 weights_offsets5 = vec2( -1, 0.176033 );
|
||||
const vec2 weights_offsets6 = vec2( 0, 0.199471 );
|
||||
const vec2 weights_offsets7 = vec2( 1, 0.176033 );
|
||||
const vec2 weights_offsets8 = vec2( 2, 0.120985 );
|
||||
const vec2 weights_offsets9 = vec2( 3, 0.064759 );
|
||||
const vec2 weights_offsets10 = vec2( 4, 0.026995 );
|
||||
const vec2 weights_offsets11 = vec2( 5, 0.008764 );
|
||||
const vec2 weights_offsets12 = vec2( 6, 0.002216 );
|
||||
uniform vec2 OffsetAndWeight[g_cKernelSize] = vec2[g_cKernelSize]
|
||||
(
|
||||
weights_offsets0,
|
||||
weights_offsets1,
|
||||
weights_offsets2,
|
||||
weights_offsets3,
|
||||
weights_offsets4,
|
||||
weights_offsets5,
|
||||
weights_offsets6,
|
||||
weights_offsets7,
|
||||
weights_offsets8,
|
||||
weights_offsets9,
|
||||
weights_offsets10,
|
||||
weights_offsets11,
|
||||
weights_offsets12
|
||||
);
|
||||
|
||||
vec4 BlurHorizontallyPS()
|
||||
{
|
||||
float sum=0.;
|
||||
float Distance = texture2D( inputSampler, gl_TexCoord[0].xy).b;
|
||||
|
||||
for (int i = 0; i < g_cKernelSize; i++)
|
||||
{
|
||||
sum += texture2D( inputSampler, gl_TexCoord[0].xy + OffsetAndWeight[i].x * mix(minBlur, maxBlur , Distance)/renderTargetSize.x * vec2(1,0) ).r * OffsetAndWeight[i].y;
|
||||
}
|
||||
|
||||
return vec4(sum, sum, Distance, 1);
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = BlurHorizontallyPS();
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
#version 120
|
||||
void main()
|
||||
{
|
||||
// transform the vertex position
|
||||
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
|
||||
|
||||
// transform the texture coordinates
|
||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||
|
||||
// forward the vertex color
|
||||
gl_FrontColor = gl_Color;
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
#version 120
|
||||
uniform vec2 renderTargetSize;
|
||||
|
||||
uniform sampler2D inputSampler;
|
||||
const float minBlur = 1.0;
|
||||
const float maxBlur = 20.0;
|
||||
const int g_cKernelSize = 13;
|
||||
const vec2 weights_offsets0 = vec2( -6, 0.002216 );
|
||||
const vec2 weights_offsets1 = vec2( -5, 0.008764 );
|
||||
const vec2 weights_offsets2 = vec2( -4, 0.026995 );
|
||||
const vec2 weights_offsets3 = vec2( -3, 0.064759 );
|
||||
const vec2 weights_offsets4 = vec2( -2, 0.120985 );
|
||||
const vec2 weights_offsets5 = vec2( -1, 0.176033 );
|
||||
const vec2 weights_offsets6 = vec2( 0, 0.199471 );
|
||||
const vec2 weights_offsets7 = vec2( 1, 0.176033 );
|
||||
const vec2 weights_offsets8 = vec2( 2, 0.120985 );
|
||||
const vec2 weights_offsets9 = vec2( 3, 0.064759 );
|
||||
const vec2 weights_offsets10 = vec2( 4, 0.026995 );
|
||||
const vec2 weights_offsets11 = vec2( 5, 0.008764 );
|
||||
const vec2 weights_offsets12 = vec2( 6, 0.002216 );
|
||||
uniform vec2 OffsetAndWeight[g_cKernelSize] = vec2[g_cKernelSize]
|
||||
(
|
||||
weights_offsets0,
|
||||
weights_offsets1,
|
||||
weights_offsets2,
|
||||
weights_offsets3,
|
||||
weights_offsets4,
|
||||
weights_offsets5,
|
||||
weights_offsets6,
|
||||
weights_offsets7,
|
||||
weights_offsets8,
|
||||
weights_offsets9,
|
||||
weights_offsets10,
|
||||
weights_offsets11,
|
||||
weights_offsets12
|
||||
);
|
||||
|
||||
vec4 BlurVerticallyPS()
|
||||
{
|
||||
float sum=0;
|
||||
float Distance = texture2D( inputSampler, gl_TexCoord[0].xy).b;
|
||||
|
||||
for (int i = 0; i < g_cKernelSize; i++)
|
||||
{
|
||||
sum += texture2D( inputSampler, gl_TexCoord[0].xy + OffsetAndWeight[i].x * mix(minBlur, maxBlur , Distance)/renderTargetSize.x * vec2(0,1) ).r * OffsetAndWeight[i].y;
|
||||
}
|
||||
|
||||
float d = 2 * length(gl_TexCoord[0].xy - 0.5f);
|
||||
float attenuation = pow(clamp(1.0f - d,0,1),1.0f);
|
||||
|
||||
return vec4(vec3(sum * attenuation), 1);
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = BlurVerticallyPS();
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
#version 120
|
||||
void main()
|
||||
{
|
||||
// transform the vertex position
|
||||
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
|
||||
|
||||
// transform the texture coordinates
|
||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||
|
||||
// forward the vertex color
|
||||
gl_FrontColor = gl_Color;
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
#version 120
|
||||
uniform sampler2D sourceSampler;
|
||||
uniform vec2 renderTargetSize;
|
||||
|
||||
vec4 ComputeDistancesPS()
|
||||
{
|
||||
vec4 color = texture2D(sourceSampler,gl_TexCoord[0].xy);
|
||||
|
||||
float Distance;
|
||||
if (color.a > .3)
|
||||
Distance = length(gl_TexCoord[0].xy - .5);
|
||||
else
|
||||
Distance = 1.0;
|
||||
|
||||
return vec4 (Distance, Distance,Distance,1);
|
||||
|
||||
}
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = ComputeDistancesPS();
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
#version 120
|
||||
void main()
|
||||
{
|
||||
// transform the vertex position
|
||||
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
|
||||
|
||||
// transform the texture coordinates
|
||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||
|
||||
// forward the vertex color
|
||||
gl_FrontColor = gl_Color;
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
#version 120
|
||||
|
||||
uniform sampler2D inputSampler;
|
||||
|
||||
|
||||
vec4 DistortPS()
|
||||
{
|
||||
//translate u and v into [-1 , 1] domain
|
||||
float u0 = gl_TexCoord[0].x * 2 - 1;
|
||||
float v0 = gl_TexCoord[0].y * 2 - 1;
|
||||
|
||||
//then, as u0 approaches 0 (the center), v should also approach 0
|
||||
v0 = v0 * abs(u0);
|
||||
|
||||
//convert back from [-1,1] domain to [0,1] domain
|
||||
v0 = (v0 + 1) / 2;
|
||||
|
||||
//we now have the coordinates for reading from the initial image
|
||||
vec2 newCoords = vec2(gl_TexCoord[0].x, v0);
|
||||
|
||||
//read for both horizontal and vertical direction and store them in separate channels
|
||||
float horizontal = texture2D(inputSampler, newCoords).r;
|
||||
float vertical = texture2D(inputSampler, newCoords.yx).r;
|
||||
return vec4(horizontal,vertical ,0,1);
|
||||
}
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = DistortPS();
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
#version 120
|
||||
void main()
|
||||
{
|
||||
// transform the vertex position
|
||||
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
|
||||
|
||||
// transform the texture coordinates
|
||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||
|
||||
// forward the vertex color
|
||||
gl_FrontColor = gl_Color;
|
||||
}
|
||||
@@ -1,113 +0,0 @@
|
||||
#version 120
|
||||
uniform vec4 MaskProps;
|
||||
uniform vec4 DiffuseColor;
|
||||
uniform vec2 renderTargetSize;
|
||||
uniform float AttenuateShadows;
|
||||
|
||||
uniform sampler2D inputSampler;
|
||||
uniform sampler2D shadowMapSampler;
|
||||
|
||||
|
||||
varying vec2 TexCoord;
|
||||
|
||||
float GetShadowDistanceH(vec2 TexCoord,float displacementV)
|
||||
{
|
||||
float u = TexCoord.x;
|
||||
float v = TexCoord.y;
|
||||
|
||||
u = abs(u-0.5) * 2;
|
||||
v = v * 2 - 1;
|
||||
float v0 = v/u;
|
||||
v0+=displacementV;
|
||||
v0 = (v0 + 1) / 2;
|
||||
|
||||
vec2 newCoords = vec2(TexCoord.x,v0);
|
||||
//horizontal info was stored in the Red component
|
||||
return texture2D(shadowMapSampler, newCoords).r;
|
||||
}
|
||||
|
||||
float GetShadowDistanceV(vec2 TexCoord, float displacementV)
|
||||
{
|
||||
float u = TexCoord.y;
|
||||
float v = TexCoord.x;
|
||||
|
||||
u = abs(u-0.5) * 2;
|
||||
v = v * 2 - 1;
|
||||
float v0 = v/u;
|
||||
v0+=displacementV;
|
||||
v0 = (v0 + 1) / 2;
|
||||
|
||||
vec2 newCoords = vec2(TexCoord.y,v0);
|
||||
//vertical info was stored in the Green component
|
||||
return texture2D(shadowMapSampler, newCoords).g;
|
||||
}
|
||||
|
||||
vec4 MaskLight(vec4 inColor, vec2 TexCoord)
|
||||
{
|
||||
vec4 p = MaskProps;
|
||||
vec2 tc = TexCoord;
|
||||
vec4 d = DiffuseColor;
|
||||
float t;
|
||||
if(p.x > 0) // x is rot 90 degrees
|
||||
{ // We just flip the axes.
|
||||
t = tc.x;
|
||||
tc.x = tc.y;
|
||||
tc.y = t;
|
||||
}
|
||||
if(p.y > 0) // y is flip horizontally
|
||||
{
|
||||
tc.x = 1 - tc.x;
|
||||
}
|
||||
if(p.z > 0) // z is flip vertically
|
||||
{
|
||||
tc.y = 1 - tc.y;
|
||||
}
|
||||
|
||||
vec4 l = inColor;
|
||||
l = vec4(l.r * d.r, l.g * d.g, l.b * d.b, l.a);
|
||||
vec4 m = texture2D(inputSampler, tc);
|
||||
|
||||
return vec4((l.rgb * m.r), l.a);
|
||||
}
|
||||
|
||||
vec4 DrawShadowsPS()
|
||||
{
|
||||
// distance of this pixel from the center
|
||||
float Distance = length(gl_TexCoord[0].xy - 0.5);
|
||||
//Distance *= renderTargetSize.x;
|
||||
//apply a 2-pixel bias
|
||||
//Distance -=2;
|
||||
|
||||
//distance stored in the shadow map
|
||||
float shadowMapDistance;
|
||||
|
||||
//coords in [-1,1]
|
||||
float nY = 2.0*( gl_TexCoord[0].y - 0.5);
|
||||
float nX = 2.0*( gl_TexCoord[0].x - 0.5);
|
||||
|
||||
//we use these to determine which quadrant we are in
|
||||
if(abs(nY)<abs(nX))
|
||||
{
|
||||
shadowMapDistance = GetShadowDistanceH(gl_TexCoord[0].xy,0);
|
||||
}
|
||||
else
|
||||
{
|
||||
shadowMapDistance = GetShadowDistanceV(gl_TexCoord[0].xy,0);
|
||||
}
|
||||
|
||||
//if distance to this pixel is lower than distance from shadowMap,
|
||||
//then we are not in shadow
|
||||
float light = Distance <= shadowMapDistance ? 1:0;
|
||||
|
||||
float d = 2 * length(gl_TexCoord[0].xy - 0.5);
|
||||
float attenuation = max(pow(clamp(1 - d, 0,1),1), AttenuateShadows); //If AttenuateShadows is true, attenuation
|
||||
|
||||
vec4 result = vec4(1 - (light * attenuation) / 2);
|
||||
result = MaskLight(result, gl_TexCoord[0].xy);
|
||||
return result;
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = DrawShadowsPS();
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
#version 120
|
||||
void main()
|
||||
{
|
||||
// transform the vertex position
|
||||
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
|
||||
|
||||
// transform the texture coordinates
|
||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||
|
||||
// forward the vertex color
|
||||
gl_FrontColor = gl_Color;
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
# Used for debugging BuildResourcePack.py without needing to be on Windows.
|
||||
# Writes a single dummy png to the output dir.
|
||||
# Doesn't work on Windows due to lack of shebangs. RIP.
|
||||
# Well at least not directly from buildResourcePack.py
|
||||
# NOTE: Requires Pillow
|
||||
|
||||
from PIL import Image
|
||||
import os
|
||||
|
||||
print("*** Running dummy sprite renderer! ***")
|
||||
image = Image.new("RGB", (32, 32), "#FF0000")
|
||||
|
||||
if not os.path.exists("output"):
|
||||
os.mkdir("output")
|
||||
|
||||
image.save(os.path.join("output", "test.png"))
|
||||
|
||||
with open(os.path.join("output", "test.xml"), "w"):
|
||||
# Create empty file.
|
||||
pass
|
||||
@@ -1 +0,0 @@
|
||||
Pillow==4.1.0
|
||||
BIN
Resources/Textures/Effects/Light/lighting_falloff_10.png
Normal file
BIN
Resources/Textures/Effects/Light/lighting_falloff_10.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 30 KiB |
BIN
Resources/Textures/Effects/Light/lighting_falloff_2.png
Normal file
BIN
Resources/Textures/Effects/Light/lighting_falloff_2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.6 KiB |
BIN
Resources/Textures/Effects/Light/lighting_falloff_3.png
Normal file
BIN
Resources/Textures/Effects/Light/lighting_falloff_3.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.7 KiB |
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user