Compare commits
6 Commits
d0fbd31c1d
...
ILGpu
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c65346aeec | ||
|
|
a74ae1167e | ||
|
|
d7d2091d64 | ||
|
|
ea28738280 | ||
|
|
2faab96a7d | ||
|
|
8c5ca2ce21 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -3,3 +3,4 @@ obj/
|
|||||||
/packages/
|
/packages/
|
||||||
riderModule.iml
|
riderModule.iml
|
||||||
/_ReSharper.Caches/
|
/_ReSharper.Caches/
|
||||||
|
publish/
|
||||||
6
.run/Release Build Linux-x64.run.xml
Normal file
6
.run/Release Build Linux-x64.run.xml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<component name="ProjectRunConfigurationManager">
|
||||||
|
<configuration default="false" name="Release Build Linux-x64" type="DotNetFolderPublish" factoryName="Publish to folder">
|
||||||
|
<riderPublish configuration="Release" delete_existing_files="true" include_native_libs_for_self_extract="true" platform="Any CPU" produce_single_file="true" runtime="linux-x64" target_folder="$PROJECT_DIR$/SDFMapCreator/publish/linux-x64" target_framework="net8.0" uuid_high="-7972981449231152312" uuid_low="-5206031561210231144" />
|
||||||
|
<method v="2" />
|
||||||
|
</configuration>
|
||||||
|
</component>
|
||||||
6
.run/Release Build Win-x64.run.xml
Normal file
6
.run/Release Build Win-x64.run.xml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<component name="ProjectRunConfigurationManager">
|
||||||
|
<configuration default="false" name="Release Build Win-x64" type="DotNetFolderPublish" factoryName="Publish to folder">
|
||||||
|
<riderPublish configuration="Release" delete_existing_files="true" include_native_libs_for_self_extract="true" platform="Any CPU" produce_single_file="true" runtime="win-x64" target_folder="$PROJECT_DIR$/SDFMapCreator/publish/win-x64" target_framework="net8.0" uuid_high="-7972981449231152312" uuid_low="-5206031561210231144" />
|
||||||
|
<method v="2" />
|
||||||
|
</configuration>
|
||||||
|
</component>
|
||||||
@@ -12,4 +12,8 @@
|
|||||||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/INDENT_NESTED_FOR_STMT/@EntryValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/INDENT_NESTED_FOR_STMT/@EntryValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_BEFORE_ARROW_WITH_EXPRESSIONS/@EntryValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_BEFORE_ARROW_WITH_EXPRESSIONS/@EntryValue">True</s:Boolean>
|
||||||
<s:Int64 x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_LIMIT/@EntryValue">151</s:Int64>
|
<s:Int64 x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_LIMIT/@EntryValue">151</s:Int64>
|
||||||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_OBJECT_AND_COLLECTION_INITIALIZER_STYLE/@EntryValue">WRAP_IF_LONG</s:String></wpf:ResourceDictionary>
|
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_OBJECT_AND_COLLECTION_INITIALIZER_STYLE/@EntryValue">WRAP_IF_LONG</s:String>
|
||||||
|
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpKeepExistingMigration/@EntryIndexedValue">True</s:Boolean>
|
||||||
|
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpPlaceEmbeddedOnSameLineMigration/@EntryIndexedValue">True</s:Boolean>
|
||||||
|
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpUseContinuousIndentInsideBracesMigration/@EntryIndexedValue">True</s:Boolean>
|
||||||
|
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateBlankLinesAroundFieldToBlankLinesAroundProperty/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
|
||||||
@@ -116,7 +116,7 @@ public static class Program {
|
|||||||
|
|
||||||
for (var x = 0; x < width; x++)
|
for (var x = 0; x < width; x++)
|
||||||
for (var y = 0; y < height; y++)
|
for (var y = 0; y < height; y++)
|
||||||
finalImage[x, y] = new(Images[0].Pixels[x, y].X);
|
finalImage[x, y] = new(ImageMasks[0].Mask[x, y].X != 0 || ImageMasks[0].Mask[x, y].Y > 0 ? MAX : MIN);
|
||||||
|
|
||||||
for (var i = 0; i < Gradients.Count; i++) {
|
for (var i = 0; i < Gradients.Count; i++) {
|
||||||
var mask = ImageMasks[i + 1];
|
var mask = ImageMasks[i + 1];
|
||||||
|
|||||||
@@ -39,7 +39,10 @@ public partial class SdfKernels {
|
|||||||
var x = index.X;
|
var x = index.X;
|
||||||
var y = index.Y;
|
var y = index.Y;
|
||||||
//if we are on the edge of the image, return false
|
//if we are on the edge of the image, return false
|
||||||
if (x == 0 || y == 0 || x == width - 1 || y == height - 1) return;
|
if (x == 0 || y == 0 || x == width - 1 || y == height - 1) {
|
||||||
|
mask[index].Y = 1f; //set the edge flag
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
//check the 3x3 kernel
|
//check the 3x3 kernel
|
||||||
for (var xi = x - 1; xi <= x + 1; xi++) {
|
for (var xi = x - 1; xi <= x + 1; xi++) {
|
||||||
@@ -78,7 +81,7 @@ public partial class SdfKernels {
|
|||||||
ArrayView2D<Vector3, Stride2D.DenseX> sdfb,
|
ArrayView2D<Vector3, Stride2D.DenseX> sdfb,
|
||||||
ArrayView2D<Vector3, Stride2D.DenseX> gradient
|
ArrayView2D<Vector3, Stride2D.DenseX> gradient
|
||||||
) { //early exit if not on mask
|
) { //early exit if not on mask
|
||||||
if (mask[index].X == 0f || mask[index].Y > 0f) return;
|
if (mask[index].X == 0f) return;
|
||||||
var a = sdfa[index].X;
|
var a = sdfa[index].X;
|
||||||
var b = sdfb[index].X;
|
var b = sdfb[index].X;
|
||||||
gradient[index] = new(a / (a + b));
|
gradient[index] = new(a / (a + b));
|
||||||
|
|||||||
Reference in New Issue
Block a user