Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge from other fork #6

Open
wants to merge 66 commits into
base: net7
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
1dc2118
UPDATE: Tried the bait and switch method with the Compute fork from…
damian-666 Nov 7, 2022
85918e2
Update README.md
damian-666 Nov 11, 2022
540cf49
Update README.md
damian-666 Nov 11, 2022
356e7ff
UPDATE W SOME BABBLING ABOUT WHAT ID COLLAB ON
damian-666 Nov 11, 2022
e13d611
Update CodingwDamianCLA.md
damian-666 Dec 30, 2022
5af40bb
add anycpu
damian-666 Jan 10, 2023
96454d4
Update README.md
damian-666 Jan 16, 2023
9fc1d91
add red
damian-666 Jan 17, 2023
ee8f989
commetn
damian-666 Jan 17, 2023
31829b3
grrr renndertarget Getclipped
damian-666 Jan 17, 2023
7ad247c
Changing some comments
Guillermo689 Jan 17, 2023
2c82d3c
earsae tets comments
damian-666 Jan 18, 2023
b6107d2
remove teh config , its jut anycpu.. if you dont select android it wi…
damian-666 Jan 19, 2023
e2de6b8
add global.json
damian-666 Jan 19, 2023
56e50c3
pyt shader back fully test release and debug
damian-666 Jan 19, 2023
836d3b1
simplify config, anycpu
damian-666 Jan 19, 2023
f186766
Merge branch 'master' of https://github.com/damian-666/MGShadersXPlat…
damian-666 Jan 19, 2023
b64f3df
remove arm64
damian-666 Jan 19, 2023
1230783
updare to net7
damian-666 Jan 19, 2023
e4b9dac
put pack is pubishable
damian-666 Jan 19, 2023
d724bfd
change to no rendertarget
damian-666 Jan 19, 2023
6b93e0a
do a bunch of tests ARRARGHH
damian-666 Jan 22, 2023
17373ba
copy old 2 buffer render target sprite makinging blending clipper
damian-666 Jan 22, 2023
59f2401
LOAD old 2 texture param clip shader that uses render target under #i…
damian-666 Jan 22, 2023
9e3a51f
Merge branch 'master' of https://github.com/damian-666/MGShadersXPlat…
damian-666 Jan 22, 2023
c8f59a9
update targegt android sdk to 33 for latest EU permssions.. supports …
damian-666 Jan 22, 2023
cd1602a
Added bloom effect in new functions at the end to keep things easily …
Guillermo689 Jan 22, 2023
526f6c4
Merge branch 'master' of https://github.com/damian-666/MGShadersXPlat…
Guillermo689 Jan 22, 2023
64644a4
Added glow effect on the image on two scripts at the end of the code …
Guillermo689 Jan 22, 2023
dbc21f7
fix the black adnd white thing
damian-666 Jan 23, 2023
9234dcb
define bloom test to trst.. fix color
damian-666 Jan 23, 2023
3db4ac7
remove wiondows formthe mgcb file.
damian-666 Jan 24, 2023
22b708f
set up a organised draw test righ and interface
damian-666 Jan 26, 2023
15c6601
add graphictst rig
damian-666 Jan 26, 2023
9b96e91
Merge branch 'master' of https://github.com/damian-666/MGShadersXPlat…
damian-666 Jan 26, 2023
a116214
rename tehe test.. fix the clipshader rever for now
damian-666 Jan 26, 2023
08122a9
fix the rig.. biuilds and put todos under MOVE
damian-666 Jan 26, 2023
539150f
rearchtext... start invert lcass...
damian-666 Jan 26, 2023
e570739
push dirtyh flile
damian-666 Jan 26, 2023
715fcb7
add static class with shard stuff that maybe otehr tests will want to…
damian-666 Jan 27, 2023
fbe014f
I make several effects on a sprite to understand how really works.
Guillermo689 Jan 27, 2023
fb08e86
Renamed the effects with prefix Effect and the type of effect it does.
Guillermo689 Jan 27, 2023
fd5fc3c
Deleted the InvertEffect and the class that were messing around, got …
Guillermo689 Jan 27, 2023
ad1e59a
Remove all the other draws from the Invert.cs and the Updates, left o…
Guillermo689 Jan 27, 2023
a62b1b1
Added a class for each effect.
Guillermo689 Jan 27, 2023
57a1cdf
Cleaned the code a bit and put the sprite image in a rectangle, can b…
Guillermo689 Jan 27, 2023
a25093f
Made a saturation EffectSaturate.fx while testing how to make the glo…
Guillermo689 Feb 3, 2023
a1bf066
Added the effects that weren't committed before, also the Bloomtest c…
Guillermo689 Feb 3, 2023
e010762
Merge pull request #8 from Guillermo689/master
damian-666 Feb 4, 2023
7ace20a
Made the DrawLine method to draw a line across a start point and an e…
Guillermo689 Feb 6, 2023
17a40e4
Fixed build errors on Bloom and Saturate.fx but Bloom.fx is not worki…
Guillermo689 Feb 6, 2023
404f729
Merge pull request #9 from Guillermo689/master
damian-666 Feb 7, 2023
874712b
Pushing the mising files
Guillermo689 Feb 7, 2023
a0d9149
Merge pull request #10 from Guillermo689/master
damian-666 Feb 8, 2023
707fe8f
plese review all diffs..
damian-666 Feb 8, 2023
71e544d
Merge pull request #11 from damian-666/collab
damian-666 Feb 8, 2023
51071df
add miissing base file and revert by blom chagnes.. maybe go back to…
damian-666 Feb 8, 2023
e82de0c
just soe unfiished code .. mjst bge a full class somewhere or smaple …
damian-666 Feb 12, 2023
43c10e0
put the clip sprinte back in TODO figue out how to use so not pass 2 …
damian-666 Feb 12, 2023
2ff7d94
todo try key color tranparet red?
damian-666 Feb 12, 2023
a9e12a3
put bakc the old boom w RT target REVIEW::
damian-666 Feb 12, 2023
ba76a46
check thx xparent source doesnt draw.. if red then donet drww... drwa…
damian-666 Feb 12, 2023
4d5834c
add E to toggle some efffets
damian-666 Feb 12, 2023
272d54d
try isadroid rutntime swtich but wont load will have to put my ui
damian-666 Feb 12, 2023
9a7f7f1
Update README.md
damian-666 Mar 10, 2023
f417517
Update README.md
damian-666 Mar 13, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .config/global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"sdk": {
"version": "7.0.100",
"rollForward": "major",
"allowPrerelease": true
}
}
30 changes: 14 additions & 16 deletions AndroidApp/Activity1.cs
Original file line number Diff line number Diff line change
@@ -1,51 +1,49 @@
using Android.App;
using Android.Content.PM;
using Android.OS;

using Android.Views;
using MGCore;
using Microsoft.Xna.Framework;

using MGCore;


namespace MGXPlatfrm.Android
{
[Activity(

Label = "MGXAndroid6",
MainLauncher = true,
Icon = "@drawable/icon",
Icon = "@drawable/icon",
AlwaysRetainTaskState = true,
LaunchMode = LaunchMode.SingleInstance,
ScreenOrientation = ScreenOrientation.FullUser,
ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.Keyboard | ConfigChanges.KeyboardHidden | ConfigChanges.ScreenSize
ConfigurationChanges = ConfigChanges.Orientation|ConfigChanges.Keyboard|ConfigChanges.KeyboardHidden|ConfigChanges.ScreenSize
)]


public class Activity1 : AndroidGameActivity//, IOnSystemUiVisibilityChangeListener //was to hide hte navigation stuffk broken now
{

private View _view;
private CoreGame _game;
private GraphicsTestRig _game;


static Activity1()//set these before any dependencies get called
static Activity1()//set these before any dependencies get called
{

CoreGame.IsDirectX = false;//
GraphicsTestRig.IsAndroid=true;
GraphicsTestRig.IsDirectX=false;//
}

protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);


_game = new CoreGame();

_view = _game.Services.GetService(typeof(View)) as View;
_game=new GraphicsTestRig();

_view=_game.Services.GetService(typeof(View)) as View;

// this.Window.DecorView.SetOnSystemUiVisibilityChangeListener(this);
//
// this.Window.DecorView.SetOnSystemUiVisibilityChangeListener(this);
//
SetContentView(_view);


Expand Down
35 changes: 25 additions & 10 deletions AndroidApp/AndroidApp.csproj
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0-android31.0</TargetFramework>
<SupportedOSPlatformVersion>23.0</SupportedOSPlatformVersion>
<TargetFramework>net7.0-android33.0</TargetFramework>
<OutputType>Exe</OutputType>
<ApplicationId>com.companyname.MGClipFXv2</ApplicationId>
<ApplicationId>com.MotherLoader.MGClipFX</ApplicationId>
<ApplicationVersion>1</ApplicationVersion>
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
<PackageIcon>Icon.png</PackageIcon>
Expand All @@ -12,23 +11,39 @@

<BaseOutputPath>..\bin\</BaseOutputPath>

<Title>AndroidClipMGTest</Title>
<Title>AndroidShadersMGTest</Title>

<Nullable>warnings</Nullable>

<IsPublishable>False</IsPublishable>

<SupportedOSPlatformVersion>23.0</SupportedOSPlatformVersion>


</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='Debug'">
<DefineConstants>$(DefineConstants)</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Release'">
<DefineConstants>$(DefineConstants)</DefineConstants>

</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
<PublishTrimmed>False</PublishTrimmed>
<PropertyGroup Condition="'$(Configuration)'=='Release'">
<RunAOTCompilation>False</RunAOTCompilation>
<PublishTrimmed>False</PublishTrimmed>
<DefineConstants>$(DefineConstants)</DefineConstants>
<DebugType>none</DebugType>
</PropertyGroup>


<PropertyGroup Condition="'$(Configuration)'=='Debug'">
<AndroidCreatePackagePerAbi>True</AndroidCreatePackagePerAbi>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='Release'">
<AndroidCreatePackagePerAbi>True</AndroidCreatePackagePerAbi>
</PropertyGroup>




<ItemGroup>
<PackageReference Include="MonoGame.Content.Builder.Task" Version="3.8.1.303" />
<PackageReference Include="MonoGame.Framework.Android" Version="3.8.1.303" />
Expand Down
2 changes: 1 addition & 1 deletion AndroidApp/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="MGXShaderTest.Droid" android:versionName="0.9`" android:installLocation="auto" android:versionCode="1">
<uses-sdk android:minSdkVersion="23" android:targetSdkVersion="31" />
<uses-sdk android:minSdkVersion="23" android:targetSdkVersion="33" />
<application android:label="MGXShaderTest"></application>
</manifest>
4 changes: 2 additions & 2 deletions CodingwDamianCLA.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Thank you for your interest in contributing to the open source projects of Damian. In order to clarify the intellectual property license granted with Contributions from any person or entity, Coding with Damian must have a Contributor License Agreement ("Agreement") on file that has been signed by each Contributor, indicating agreement to the license terms below. This Agreement is for your protection as a Contributor as well as the protection of Coding with Damian; it does not change your rights to use your own Contributions for any other purpose.

You accept and agree to the following terms and conditions for Your present and future Contributions submitted to Coding with Damian. Except for the licenses granted herein to Coding with Damian and recipients of software distributed by Coding with Calvin, You reserve all right, title, and interest in and to Your Contributions.
You accept and agree to the following terms and conditions for Your present and future Contributions submitted to Coding with Damian. Except for the licenses granted herein to Coding with Damian and recipients of software distributed by Coding with Damian, You reserve all right, title, and interest in and to Your Contributions.

#### Definitions

Expand All @@ -12,4 +12,4 @@ You accept and agree to the following terms and conditions for Your present and
1. You represent that each of Your Contributions is Your original creation (see section 7 for submissions on behalf of others). You represent that Your Contribution submissions include complete details of any third-party license or other restriction (including, but not limited to, related patents and trademarks) of which You are personally aware and which are associated with any part of Your Contributions.
1. You are not expected to provide support for Your Contributions, except to the extent You desire to provide support. You may provide support for free, for a fee, or not at all. Unless required by applicable law or agreed to in writing, You provide Your Contributions on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON- INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE.
1. Should You wish to submit work that is not Your original creation, You may submit it to Coding with Damian separately from any Contribution, identifying the complete details of its source and of any license or other restriction (including, but not limited to, related patents, trademarks, and license agreements) of which You are personally aware, and conspicuously marking the work as "Submitted on behalf of a third-party: [named here]".
1. You agree to notify Coding with Damian of any facts or circumstances of which You become aware that would make these representations inaccurate in any respect.
1. You agree to notify Coding with Damian of any facts or circumstances of which You become aware that would make these representations inaccurate in any respect.
7 changes: 3 additions & 4 deletions ConsoleAppDX/CWindowsAppDX.csproj
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows</TargetFramework>
<TargetFramework>net7.0-windows</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>warnings</Nullable>
<Platforms>x64;ARM64</Platforms>
<Platforms>x64;ARM64;AnyCPU</Platforms>
<PlatformTarget>AnyCPU</PlatformTarget>
<IsPublishable>True</IsPublishable>

<BaseOutputPath>..\bin\</BaseOutputPath>

<Title></Title>

<PackageOutputPath />


<PackageId />
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='Debug'">
Expand Down
4 changes: 2 additions & 2 deletions ConsoleAppDX/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using MGCore;

{
var game = new CoreGame();
CoreGame.IsDirectX = true;
var game = new GraphicsTestRig();
GraphicsTestRig.IsDirectX=true;
game.Run(); //this starts the render loop
}
8 changes: 4 additions & 4 deletions ConsoleAppGL/ConsoleAppGL.csproj
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<OutputType>WinExe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Platforms>ARM64;x64</Platforms>
<PlatformTarget>x64</PlatformTarget>
<Platforms>AnyCPU</Platforms>
<PlatformTarget>AnyCPU</PlatformTarget>
<IsPublishable>True</IsPublishable>
<BaseOutputPath>..\bin\</BaseOutputPath>
<EnableNETAnalyzers>False</EnableNETAnalyzers>
Expand Down
14 changes: 6 additions & 8 deletions ConsoleAppGL/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,12 @@
System.Diagnostics.ProcessStartInfo start =
new System.Diagnostics.ProcessStartInfo();

// var path = Assembly.GetEntryAssembly()?.Location; //might need the exe path on some system.. this is close..
// var path = Assembly.GetEntryAssembly()?.Location; //might need the exe path on some system.. this is close..


GraphicsTestRig.IsDirectX=false;

var game = new GraphicsTestRig();

start.FileName=
//path +
@"\ConsoleAppGL.exe";
start.WindowStyle=System.Diagnostics.ProcessWindowStyle.Hidden; //Hides GUI
start.CreateNoWindow=true; //Hides console //TODO doesnt work always... todo save window pos but this requires dev branche fixes...
var game = new CoreGame();
CoreGame.IsDirectX = false;
game.Run(); //this starts the render loop
}
2 changes: 1 addition & 1 deletion IOSApp/IOSApp.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0-ios</TargetFramework>
<TargetFramework>net7.0-ios</TargetFramework>
<OutputType>Exe</OutputType>
<SupportedOSPlatformVersion>11.2</SupportedOSPlatformVersion>
<CodesignKey>iPhone Developer</CodesignKey>
Expand Down
9 changes: 3 additions & 6 deletions IOSApp/Program.cs
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
using Foundation;
using System;
using UIKit;


using MGCore;
using UIKit;

namespace IOSApp
{
[Register("AppDelegate")]
internal class Program : UIApplicationDelegate
{


internal static void RunGame()
{
var game=new CoreGame();
var game = new GraphicsTestRig();
game.Run();
}

Expand Down
45 changes: 45 additions & 0 deletions MGCore/Content/Bloom.fx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#if OPENGL
#define SV_POSITION POSITION
#define VS_SHADERMODEL vs_3_0
#define PS_SHADERMODEL ps_3_0
#else
#define VS_SHADERMODEL vs_4_0_level_9_1
#define PS_SHADERMODEL ps_4_0_level_9_1
#endif

#define SAMPLES 15
#define BLOOM_THRESHOLD 0.25
#define BLOOM_INTENSITY 2.0
#define BLOOM_SATURATION 0.8

sampler2D Texture;

float GlowIntensity;
float GlowSize;

float4 main(float2 uv : TEXCOORD) : COLOR
{
float4 color = tex2D(Texture, uv);

float4 sum = 0;
int samples = 5;
float delta = GlowSize / samples;
float intensity = GlowIntensity / samples;
for (int i = 0; i < samples; i++)
{
sum += tex2D(Texture, uv + float2(delta * i, 0)) * intensity;
sum += tex2D(Texture, uv - float2(delta * i, 0)) * intensity;
sum += tex2D(Texture, uv + float2(0, delta * i)) * intensity;
sum += tex2D(Texture, uv - float2(0, delta * i)) * intensity;
}

return color + sum * GlowIntensity;
}

technique Glow
{
pass Pass1
{
PixelShader = compile PS_SHADERMODEL main();
}
}
55 changes: 55 additions & 0 deletions MGCore/Content/BloomCombine.fx
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
// Pixel shader combines the bloom image with the original
// scene, using tweakable intensity levels and saturation.
// This is the final step in applying a bloom postprocess.

sampler BloomSampler : register(s0);
sampler BaseSampler : register(s1);

float BloomIntensity;
float BaseIntensity;

float BloomSaturation;
float BaseSaturation;


// Helper for modifying the saturation of a color.
float4 AdjustSaturation(float4 color, float saturation)
{
// The constants 0.3, 0.59, and 0.11 are chosen because the
// human eye is more sensitive to green light, and less to blue.
float grey = dot(color, float3(0.3, 0.59, 0.11));

return lerp(grey, color, saturation);
}


float4 PixelShaderFunction(float2 texCoord : TEXCOORD0) : COLOR0
{
// Look up the bloom and original base image colors.
float4 bloom = tex2D(BloomSampler, texCoord);
float4 base = tex2D(BaseSampler, texCoord);

// Adjust color saturation and intensity.
bloom = AdjustSaturation(bloom, BloomSaturation) * BloomIntensity;
base = AdjustSaturation(base, BaseSaturation) * BaseIntensity;

// Darken down the base image in areas where there is a lot of bloom,
// to prevent things looking excessively burned-out.
base *= (1 - saturate(bloom));

// Combine the two images.
return base + bloom;
}


technique BloomCombine
{
pass Pass1
{
#if SM4
PixelShader = compile ps_4_0_level_9_1 PixelShaderFunction();
#else
PixelShader = compile ps_2_0 PixelShaderFunction();
#endif
}
}
29 changes: 29 additions & 0 deletions MGCore/Content/BloomExtract.fx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Pixel shader extracts the brighter areas of an image.
// This is the first step in applying a bloom postprocess.

sampler TextureSampler : register(s0);

float BloomThreshold;


float4 PixelShaderFunction(float2 texCoord : TEXCOORD0) : COLOR0
{
// Look up the original image color.
float4 c = tex2D(TextureSampler, texCoord);

// Adjust it to keep only values brighter than the specified threshold.
return saturate((c - BloomThreshold) / (1 - BloomThreshold));
}


technique BloomExtract
{
pass Pass1
{
#if SM4
PixelShader = compile ps_4_0_level_9_1 PixelShaderFunction();
#else
PixelShader = compile ps_2_0 PixelShaderFunction();
#endif
}
}
Loading
Loading