Skip to content

Commit

Permalink
Merge pull request #341 from FUSEEProjectTeam/feature/RemoveShaderSrc…
Browse files Browse the repository at this point in the history
…ParamFromGUINode

Remove shader src parameters from GUINode
  • Loading branch information
RedImp1470 authored Sep 22, 2021
2 parents 9b06e42 + eef8e0b commit bdbf82e
Show file tree
Hide file tree
Showing 17 changed files with 13 additions and 173 deletions.
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
8 changes: 0 additions & 8 deletions Examples/Complete/BoneAnimation/Core/Bone.cs
Original file line number Diff line number Diff line change
Expand Up @@ -319,10 +319,6 @@ public override void RenderAFrame()

private SceneContainer CreateGui()
{
var vsTex = AssetStorage.Get<string>("texture.vert");
var psTex = AssetStorage.Get<string>("texture.frag");
var psText = AssetStorage.Get<string>("text.frag");

var canvasWidth = Width / 100f;
var canvasHeight = Height / 100f;

Expand All @@ -337,8 +333,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 +350,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
8 changes: 0 additions & 8 deletions Examples/Complete/Camera/Core/Camera.cs
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,6 @@ private void UserSideFrustumCulling(IList<SceneNode> nodeChildren, FrustumF frus

private SceneContainer CreateGui()
{
string vsTex = AssetStorage.Get<string>("texture.vert");
string psTex = AssetStorage.Get<string>("texture.frag");
string psText = AssetStorage.Get<string>("text.frag");

float canvasWidth = Width / 100f;
float canvasHeight = Height / 100f;

Expand All @@ -255,8 +251,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 +268,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
5 changes: 0 additions & 5 deletions Examples/Complete/ComputeFractal/Core/ComputeFractal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,6 @@ private float Sawtooth(float i, float m)

private SceneContainer CreateGui()
{
var vsTex = AssetStorage.Get<string>("texture.vert");
var psText = AssetStorage.Get<string>("text.frag");

var canvasWidth = Width / 100f;
var canvasHeight = Height / 100f;

Expand All @@ -184,8 +181,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
8 changes: 0 additions & 8 deletions Examples/Complete/Integrations/Core/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,6 @@ public void ChangeRocketZ(float z)

private SceneContainer CreateGui()
{
var vsTex = AssetStorage.Get<string>("texture.vert");
var psTex = AssetStorage.Get<string>("texture.frag");
var psText = AssetStorage.Get<string>("text.frag");

var canvasWidth = Width / 100f;
var canvasHeight = Height / 100f;

Expand All @@ -175,8 +171,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 +188,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
20 changes: 0 additions & 20 deletions Examples/Complete/Labyrinth/Core/Labyrinth.cs
Original file line number Diff line number Diff line change
Expand Up @@ -359,10 +359,6 @@ public override void RenderAFrame()

private SceneContainer CreateGui()
{
var vsTex = AssetStorage.Get<string>("texture.vert");
var psTex = AssetStorage.Get<string>("texture.frag");
var psText = AssetStorage.Get<string>("text.frag");

var canvasWidth = Width / 100f;
var canvasHeight = Height / 100f;

Expand All @@ -377,8 +373,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 +390,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 +401,6 @@ private SceneContainer CreateGui()
var timer = new TextNode(
"00:00.00",
"Timer",
vsTex,
psText,
UIElementPosition.GetAnchors(AnchorPos.TopTopRight),
new MinMaxRect
{
Expand Down Expand Up @@ -740,10 +730,6 @@ public void Winner()
// Creates winning display
public SceneContainer WinningDisplay()
{
var vsTex = AssetStorage.Get<string>("texture.vert");
var psTex = AssetStorage.Get<string>("texture.frag");
var psText = AssetStorage.Get<string>("text.frag");

var canvasWidth = Width / 100f;
var canvasHeight = Height / 100f;

Expand All @@ -758,8 +744,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 +761,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 +772,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
8 changes: 0 additions & 8 deletions Examples/Complete/Picking/Core/Picking.cs
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,6 @@ public override void RenderAFrame()

private SceneContainer CreateGui()
{
var vsTex = AssetStorage.Get<string>("texture.vert");
var psTex = AssetStorage.Get<string>("texture.frag");
var psText = AssetStorage.Get<string>("text.frag");

var canvasWidth = Width / 100f;
var canvasHeight = Height / 100f;

Expand All @@ -189,8 +185,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 +202,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
Loading

0 comments on commit bdbf82e

Please sign in to comment.