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

Remove shader src parameters from GUINode #341

Merged
merged 3 commits into from
Sep 22, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
2 changes: 0 additions & 2 deletions Examples/Complete/AdvancedUI/Core/AdvancedUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -365,8 +365,6 @@ private SceneContainer CreateGui()
Texture guiFuseeLogo = new(AssetStorage.Get<ImageData>("FuseeText.png"));
TextureNode fuseeLogo = new(
"fuseeLogo",
UIHelper.VsTex,
UIHelper.PsTex,
guiFuseeLogo,
UIElementPosition.GetAnchors(AnchorPos.TopTopLeft),
UIElementPosition.CalcOffsets(AnchorPos.TopTopLeft, new float2(0, _canvasHeight - 0.5f), _canvasHeight, _canvasWidth, new float2(1.75f, 0.5f)), float2.One);
Expand Down
12 changes: 0 additions & 12 deletions Examples/Complete/AdvancedUI/Core/UIHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,6 @@ internal static class UIHelper
internal static float2 AnnotationDim = new(3f, 0.5f);
internal static float4 AnnotationBorderThickness = new(6, 0.5f, 0.5f, 0.5f);

internal static string VsTex = AssetStorage.Get<string>("texture.vert");
internal static string PsTex = AssetStorage.Get<string>("texture.frag");
internal static string PsText = AssetStorage.Get<string>("text.frag");
internal static string VsNineSlice = AssetStorage.Get<string>("nineSlice.vert");
internal static string PsNineSlice = AssetStorage.Get<string>("nineSliceTile.frag");

internal static Font FontRaleway = AssetStorage.Get<Font>("Raleway-Regular.ttf");
internal static FontMap RalewayFontMap = new(FontRaleway, 24);

Expand Down Expand Up @@ -127,8 +121,6 @@ private static SceneNode CreateAnnotation(float2 pos, float borderScaleFactor, s
{
TextureNode icon = new(
"icon",
VsTex,
PsTex,
iconTex,
new MinMaxRect
{
Expand All @@ -142,8 +134,6 @@ private static SceneNode CreateAnnotation(float2 pos, float borderScaleFactor, s
TextNode annotationText = new(
text,
"annotation text",
VsTex,
PsText,
new MinMaxRect
{
Min = new float2(0, 0),
Expand All @@ -157,8 +147,6 @@ private static SceneNode CreateAnnotation(float2 pos, float borderScaleFactor, s

TextureNode annotation = new(
"Annotation",
VsNineSlice,
PsNineSlice,
frameTex,
new MinMaxRect
{
Expand Down
4 changes: 0 additions & 4 deletions Examples/Complete/BoneAnimation/Core/Bone.cs
Original file line number Diff line number Diff line change
Expand Up @@ -337,8 +337,6 @@ private SceneContainer CreateGui()
var guiFuseeLogo = new Texture(AssetStorage.Get<ImageData>("FuseeText.png"));
var fuseeLogo = new TextureNode(
"fuseeLogo",
vsTex,
psTex,
//Set the albedo texture you want to use.
guiFuseeLogo,
//Define anchor points. They are given in percent, seen from the lower left corner, respectively to the width/height of the parent.
Expand All @@ -356,8 +354,6 @@ private SceneContainer CreateGui()
var text = new TextNode(
"FUSEE Picking Example",
"ButtonText",
vsTex,
psText,
UIElementPosition.GetAnchors(AnchorPos.StretchHorizontal),
UIElementPosition.CalcOffsets(AnchorPos.StretchHorizontal, new float2(canvasWidth / 2 - 4, 0), canvasHeight, canvasWidth, new float2(8, 1)),
guiLatoBlack,
Expand Down
4 changes: 0 additions & 4 deletions Examples/Complete/Camera/Core/Camera.cs
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,6 @@ private SceneContainer CreateGui()
Texture guiFuseeLogo = new(AssetStorage.Get<ImageData>("FuseeText.png"));
TextureNode fuseeLogo = new(
"fuseeLogo",
vsTex,
psTex,
//Set the diffuse texture you want to use.
guiFuseeLogo,
//Define anchor points. They are given in percent, seen from the lower left corner, respectively to the width/height of the parent.
Expand All @@ -274,8 +272,6 @@ private SceneContainer CreateGui()
TextNode text = new(
"FUSEE Camera Example",
"ButtonText",
vsTex,
psText,
UIElementPosition.GetAnchors(AnchorPos.StretchHorizontal),
UIElementPosition.CalcOffsets(AnchorPos.StretchHorizontal, new float2(canvasWidth / 2 - 4, 0), canvasHeight, canvasWidth, new float2(8, 1)),
guiLatoBlack,
Expand Down
13 changes: 11 additions & 2 deletions Examples/Complete/ComputeFractal/Core/ComputeFractal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,19 @@ private float Sawtooth(float i, float m)

private SceneContainer CreateGui()
{

/* Unmerged change from project 'Fusee.Examples.ComputeFractal.Core(net5.0)'
Before:
var vsTex = AssetStorage.Get<string>("texture.vert");
var psText = AssetStorage.Get<string>("text.frag");
After:
_ = AssetStorage.Get<string>("texture.vert");
string psText;
_ = AssetStorage.Get<string>("text.frag");
*/
_ = AssetStorage.Get<string>("texture.vert");
wrestledBearOnce marked this conversation as resolved.
Show resolved Hide resolved
string psText;
_ = AssetStorage.Get<string>("text.frag");
wrestledBearOnce marked this conversation as resolved.
Show resolved Hide resolved

var canvasWidth = Width / 100f;
var canvasHeight = Height / 100f;
Expand All @@ -184,8 +195,6 @@ private SceneContainer CreateGui()
var textNode = new TextNode(
"Fractal Magnification Factor: " + _depthFactor,
"FractalDepth",
vsTex,
psText,
UIElementPosition.GetAnchors(AnchorPos.StretchHorizontal),
UIElementPosition.CalcOffsets(AnchorPos.StretchHorizontal, new float2(canvasWidth / 2 - 4, 0), canvasHeight, canvasWidth, new float2(8, 1)),
guiLatoBlack,
Expand Down
4 changes: 0 additions & 4 deletions Examples/Complete/Integrations/Core/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,6 @@ private SceneContainer CreateGui()
var guiFuseeLogo = new Texture(AssetStorage.Get<ImageData>("FuseeText.png"));
var fuseeLogo = new TextureNode(
"fuseeLogo",
vsTex,
psTex,
//Set the albedo texture you want to use.
guiFuseeLogo,
//Define anchor points. They are given in percent, seen from the lower left corner, respectively to the width/height of the parent.
Expand All @@ -194,8 +192,6 @@ private SceneContainer CreateGui()
var text = new TextNode(
"FUSEE Simple Example",
"ButtonText",
vsTex,
psText,
UIElementPosition.GetAnchors(AnchorPos.StretchHorizontal),
UIElementPosition.CalcOffsets(AnchorPos.StretchHorizontal, new float2(canvasWidth / 2 - 4, 0), canvasHeight, canvasWidth, new float2(8, 1)),
guiLatoBlack,
Expand Down
12 changes: 0 additions & 12 deletions Examples/Complete/Labyrinth/Core/Labyrinth.cs
Original file line number Diff line number Diff line change
Expand Up @@ -377,8 +377,6 @@ private SceneContainer CreateGui()
var guiFuseeLogo = new Texture(AssetStorage.Get<ImageData>("FuseeText.png"));
var fuseeLogo = new TextureNode(
"fuseeLogo",
vsTex,
psTex,
//Set the albedo texture you want to use.
guiFuseeLogo,
//Define anchor points. They are given in percent, seen from the lower left corner, respectively to the width/height of the parent.
Expand All @@ -396,8 +394,6 @@ private SceneContainer CreateGui()
var text = new TextNode(
"FUSEE Simple Example",
"ButtonText",
vsTex,
psText,
UIElementPosition.GetAnchors(AnchorPos.StretchHorizontal),
UIElementPosition.CalcOffsets(AnchorPos.StretchHorizontal, new float2(canvasWidth / 2 - 4, 0), canvasHeight, canvasWidth, new float2(8, 1)),
guiLatoBlack,
Expand All @@ -409,8 +405,6 @@ private SceneContainer CreateGui()
var timer = new TextNode(
"00:00.00",
"Timer",
vsTex,
psText,
UIElementPosition.GetAnchors(AnchorPos.TopTopRight),
new MinMaxRect
{
Expand Down Expand Up @@ -758,8 +752,6 @@ public SceneContainer WinningDisplay()
var guiFuseeLogo = new Texture(AssetStorage.Get<ImageData>("FuseeText.png"));
var fuseeLogo = new TextureNode(
"fuseeLogo",
vsTex,
psText,
//Set the albedo texture you want to use.
guiFuseeLogo,
//Define anchor points. They are given in percent, seen from the lower left corner, respectively to the width/height of the parent.
Expand All @@ -777,8 +769,6 @@ public SceneContainer WinningDisplay()
var text = new TextNode(
"FUSEE Simple Example",
"ButtonText",
vsTex,
psText,
UIElementPosition.GetAnchors(AnchorPos.StretchHorizontal),
UIElementPosition.CalcOffsets(AnchorPos.StretchHorizontal, new float2(canvasWidth / 2 - 4, 0), canvasHeight, canvasWidth, new float2(8, 1)),
guiLatoBlack,
Expand All @@ -790,8 +780,6 @@ public SceneContainer WinningDisplay()
"SOLVED\n" +
_timertext.Text,
"Timer",
vsTex,
psText,
UIElementPosition.GetAnchors(AnchorPos.Middle),
new MinMaxRect
{
Expand Down
27 changes: 0 additions & 27 deletions Examples/Complete/Materials/Core/Materials.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ public override void Init()
Font fontLato = AssetStorage.Get<Font>("Lato-Black.ttf");
FontMap fontLatoMap = new(fontLato, 32);

string vsTex = AssetStorage.Get<string>("texture.vert");
string psTex = AssetStorage.Get<string>("texture.frag");

Icosphere icosphereWithTangents = new(5);
icosphereWithTangents.Tangents = icosphereWithTangents.CalculateTangents();
icosphereWithTangents.BiTangents = icosphereWithTangents.CalculateBiTangents();
Expand Down Expand Up @@ -62,8 +59,6 @@ public override void Init()
new TextNode(
"How-To:\n############################\n- Move with WASD\n- Left mouse button rotates spheres\n- Mouse wheel zooms",
"howTo",
vsTex,
psTex,
UIElementPosition.GetAnchors(AnchorPos.DownDownLeft),
UIElementPosition.CalcOffsets(AnchorPos.DownDownLeft, new float2(-11, -5), canvasHeight, canvasWidth, new float2(12, 1)),
fontLatoMap,
Expand All @@ -87,8 +82,6 @@ public override void Init()
new TextNode(
"Complete",
"desc",
vsTex,
psTex,
MinMaxRect.FromCenterSize(float2.Zero, float2.One),
new MinMaxRect(),
fontLatoMap,
Expand All @@ -97,8 +90,6 @@ public override void Init()
VerticalTextAlignment.Center),new TextNode(
"NOT YET IMPLEMENTED",
"desc",
vsTex,
psTex,
MinMaxRect.FromCenterSize(float2.Zero, float2.One),
new MinMaxRect
{
Expand Down Expand Up @@ -126,8 +117,6 @@ public override void Init()
new TextNode(
"Albedo and Specular",
"desc",
vsTex,
psTex,
MinMaxRect.FromCenterSize(float2.Zero, float2.One),
new MinMaxRect(),
fontLatoMap,
Expand All @@ -151,8 +140,6 @@ public override void Init()
new TextNode(
"Albedo, specular and\nalbedo texture",
"desc",
vsTex,
psTex,
MinMaxRect.FromCenterSize(float2.Zero, float2.One),
new MinMaxRect(),
fontLatoMap,
Expand All @@ -176,8 +163,6 @@ public override void Init()
new TextNode(
"Specular texture",
"desc",
vsTex,
psTex,
MinMaxRect.FromCenterSize(float2.Zero, float2.One),
new MinMaxRect(),
fontLatoMap,
Expand All @@ -187,8 +172,6 @@ public override void Init()
new TextNode(
"NOT YET IMPLEMENTED",
"desc",
vsTex,
psTex,
MinMaxRect.FromCenterSize(float2.Zero, float2.One),
new MinMaxRect
{
Expand Down Expand Up @@ -216,8 +199,6 @@ public override void Init()
new TextNode(
"Normal map",
"desc",
vsTex,
psTex,
MinMaxRect.FromCenterSize(float2.Zero, float2.One),
new MinMaxRect(),
fontLatoMap,
Expand All @@ -241,8 +222,6 @@ public override void Init()
new TextNode(
"Albedo and emissive",
"desc",
vsTex,
psTex,
MinMaxRect.FromCenterSize(float2.Zero, float2.One),
new MinMaxRect(),
fontLatoMap,
Expand All @@ -252,8 +231,6 @@ public override void Init()
new TextNode(
"NOT YET IMPLEMENTED",
"desc",
vsTex,
psTex,
MinMaxRect.FromCenterSize(float2.Zero, float2.One),
new MinMaxRect
{
Expand Down Expand Up @@ -281,8 +258,6 @@ public override void Init()
new TextNode(
"Albedo, emissive and\nemissive texture",
"desc",
vsTex,
psTex,
MinMaxRect.FromCenterSize(float2.Zero, float2.One),
new MinMaxRect(),
fontLatoMap,
Expand All @@ -292,8 +267,6 @@ public override void Init()
new TextNode(
"NOT YET IMPLEMENTED",
"desc",
vsTex,
psTex,
MinMaxRect.FromCenterSize(float2.Zero, float2.One),
new MinMaxRect
{
Expand Down
4 changes: 0 additions & 4 deletions Examples/Complete/Picking/Core/Picking.cs
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,6 @@ private SceneContainer CreateGui()
var guiFuseeLogo = new Texture(AssetStorage.Get<ImageData>("FuseeText.png"));
var fuseeLogo = new TextureNode(
"fuseeLogo",
vsTex,
psTex,
//Set the albedo texture you want to use.
guiFuseeLogo,
//Define anchor points. They are given in percent, seen from the lower left corner, respectively to the width/height of the parent.
Expand All @@ -208,8 +206,6 @@ private SceneContainer CreateGui()
var text = new TextNode(
"FUSEE Picking Example",
"ButtonText",
vsTex,
psText,
UIElementPosition.GetAnchors(AnchorPos.StretchHorizontal),
UIElementPosition.CalcOffsets(AnchorPos.StretchHorizontal, new float2(canvasWidth / 2 - 4, 0), canvasHeight, canvasWidth, new float2(8, 1)),
guiLatoBlack,
Expand Down
4 changes: 0 additions & 4 deletions Examples/Complete/Simple/Core/Simple.cs
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,6 @@ private SceneContainer CreateGui()
var guiFuseeLogo = new Texture(AssetStorage.Get<ImageData>("FuseeText.png"));
var fuseeLogo = new TextureNode(
"fuseeLogo",
vsTex,
psTex,
//Set the albedo texture you want to use.
guiFuseeLogo,
//Define anchor points. They are given in percent, seen from the lower left corner, respectively to the width/height of the parent.
Expand All @@ -170,8 +168,6 @@ private SceneContainer CreateGui()
var text = new TextNode(
"FUSEE Simple Example",
"ButtonText",
vsTex,
psText,
UIElementPosition.GetAnchors(AnchorPos.StretchHorizontal),
UIElementPosition.CalcOffsets(AnchorPos.StretchHorizontal, new float2(canvasWidth / 2 - 4, 0), canvasHeight, canvasWidth, new float2(8, 1)),
guiLatoBlack,
Expand Down
4 changes: 0 additions & 4 deletions Examples/Complete/SimpleDeferred/Core/SimpleDeferred.cs
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,6 @@ private SceneContainer CreateGui()
var guiFuseeLogo = new Texture(AssetStorage.Get<ImageData>("FuseeText.png"));
var fuseeLogo = new TextureNode(
"fuseeLogo",
vsTex,
psTex,
//Set the diffuse texture you want to use.
guiFuseeLogo,
//Define anchor points. They are given in percent, seen from the lower left corner, respectively to the width/height of the parent.
Expand All @@ -309,8 +307,6 @@ private SceneContainer CreateGui()
var text = new TextNode(
"FUSEE Deferred Example",
"ButtonText",
vsTex,
psText,
UIElementPosition.GetAnchors(AnchorPos.StretchHorizontal),
UIElementPosition.CalcOffsets(AnchorPos.StretchHorizontal, new float2(canvasWidth / 2 - 4, 0), canvasHeight, canvasWidth, new float2(8, 1)),
guiLatoBlack,
Expand Down
4 changes: 0 additions & 4 deletions Examples/Complete/Starkiller/Core/Starkiller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,6 @@ private SceneContainer CreateGui()
var guiFuseeLogo = new Texture(AssetStorage.Get<ImageData>("FuseeText.png"));
var fuseeLogo = new TextureNode(
"fuseeLogo",
vsTex,
psTex,
//Set the albedo texture you want to use.
guiFuseeLogo,
//Define anchor points. They are given in percent, seen from the lower left corner, respectively to the width/height of the parent.
Expand Down Expand Up @@ -311,8 +309,6 @@ private SceneContainer CreateGui()
var text = new TextNode(
textToDisplay,
"SceneDescriptionText",
vsTex,
psText,
UIElementPosition.GetAnchors(AnchorPos.StretchHorizontal),
UIElementPosition.CalcOffsets(AnchorPos.StretchHorizontal, new float2(_initCanvasWidth / 2 - 4, 0), _initCanvasHeight, _initCanvasWidth, new float2(8, 1)),
guiLatoBlack,
Expand Down
Loading