daily update on 20240506 by nitload youmu
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
#version 330 core
|
||||
|
||||
in vec4 TexColor;
|
||||
in vec2 TexCoord;
|
||||
|
||||
out vec4 FragColor;
|
||||
|
||||
uniform vec4 color;
|
||||
uniform sampler2D ourTexture;
|
||||
uniform sampler2D ourTexture2;
|
||||
|
||||
@@ -12,6 +12,6 @@ void main()
|
||||
{
|
||||
vec4 tex1 = texture(ourTexture, TexCoord);
|
||||
vec4 tex2 = texture(ourTexture2,TexCoord);
|
||||
FragColor = mix(tex1 * vec4( TexColor.xyz, 1.0), tex2, 0.2) /* *vec4( TexColor,1.0) /**/;
|
||||
FragColor = mix(tex1 * vec4( color.xyz, 1.0), tex2, 0.2) /* *vec4( TexColor,1.0) /**/;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,23 +4,13 @@ layout(location = 0) in vec3 aPos;
|
||||
layout(location = 1) in vec3 aColor;
|
||||
layout(location = 2) in vec2 aTextCoord;
|
||||
|
||||
out vec4 TexColor;
|
||||
out vec2 TexCoord;
|
||||
|
||||
uniform vec4 color;
|
||||
uniform mat4x4 camera;
|
||||
|
||||
void main()
|
||||
{
|
||||
float as = sin( color.w );
|
||||
float ac = cos( color.w );
|
||||
mat4x4 rotation = mat4x4(
|
||||
ac,-as,0,0,
|
||||
as,ac,0,0,
|
||||
0,0,1,0,
|
||||
0,0,0,1
|
||||
);
|
||||
TexColor = color;
|
||||
|
||||
TexCoord = aTextCoord;
|
||||
vec4 temp = vec4(aPos.xyz,1.0);
|
||||
gl_Position = /**/ camera * /**/ temp;
|
||||
|
||||
@@ -1,4 +1,34 @@
|
||||
using StgSharp;
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// file="MainRenderStream.cs"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using StgSharp;
|
||||
using StgSharp.Geometries;
|
||||
using StgSharp.Graphics;
|
||||
using StgSharp.Logic;
|
||||
@@ -15,12 +45,13 @@ namespace StgSharp
|
||||
|
||||
public class MainRenderStream : glRenderStream
|
||||
{
|
||||
private Uniform<float, float, float, float> color;
|
||||
|
||||
private ElementBuffer ebo;
|
||||
private Uniform<int> ourTexture;
|
||||
private Uniform<int> ourTexture2;
|
||||
private ShaderProgram shader;
|
||||
private Texture texture;
|
||||
private Uniform<float, float, float, float> color;
|
||||
private Uniform<int> ourTexture;
|
||||
private Uniform<int> ourTexture2;
|
||||
private VertexArray vao;
|
||||
private VertexBuffer vbo;
|
||||
|
||||
@@ -42,16 +73,13 @@ namespace StgSharp
|
||||
/**/
|
||||
}
|
||||
|
||||
protected sealed override void Init()
|
||||
protected override sealed void Init()
|
||||
{
|
||||
SetSizeLimit(800, 800, 800, 800);
|
||||
|
||||
|
||||
FrameSizeCallback =
|
||||
(IntPtr id, uint width, uint height) =>
|
||||
{
|
||||
GL.Viewport(0, 0, width, height);
|
||||
};
|
||||
(IntPtr id, uint width, uint height) => GL.Viewport(0, 0, width, height);
|
||||
|
||||
shader = CreateShaderProgram();
|
||||
var vertex = CreateShaderSegment(ShaderType.Vertex, 1);
|
||||
@@ -122,19 +150,19 @@ namespace StgSharp
|
||||
new vec3d(0, 0, 100),
|
||||
new vec3d(0, 1, 0)
|
||||
);
|
||||
NativeCameraViewRange(new Degree(5),(0, 0), (50f, 50f));
|
||||
NativeCameraUniform(shader, "NativeCamera");
|
||||
|
||||
NativeCameraViewRange(new Degree(10f), (0, 0), (50f, 50f));
|
||||
NativeCameraUniform(shader, "camera");
|
||||
|
||||
}
|
||||
|
||||
protected sealed override void Main(
|
||||
protected override sealed void Main(
|
||||
in Dictionary<string, BlueprintPipeline> input,
|
||||
in Dictionary<string, BlueprintPipeline> output
|
||||
)
|
||||
{
|
||||
GL.ClearColor(0.333f, 0.555f, 0.555f, 1.0f);
|
||||
//Console.WriteLine(1);
|
||||
GL.Clear(MaskBufferBit.COLOR | MaskBufferBit.DEPTH);
|
||||
GL.Clear(MaskBufferBit.COLOR /**/| MaskBufferBit.DEPTH /**/ );
|
||||
|
||||
/**/
|
||||
vao.Bind(0);
|
||||
@@ -148,29 +176,26 @@ namespace StgSharp
|
||||
/**/
|
||||
|
||||
/**/
|
||||
float time = /* CurrentFrameCount / /**/ 60.0f;
|
||||
float time = /* CurrentFrameCount, / /**/ 60.0f;
|
||||
|
||||
//Console.WriteLine(2);
|
||||
|
||||
GL.SetValue(color,
|
||||
0.5f + MathF.Cos(time),
|
||||
0.5f + MathF.Sin(time * 0.66667f + (2 * Scaler.Pi / 3)),
|
||||
0.5f + MathF.Sin(time * 0.33333f + (Scaler.Pi / 3)),
|
||||
0.5f + MathF.Sin((time * 0.66667f) + ((2 * Scaler.Pi) / 3)),
|
||||
0.5f + MathF.Sin((time * 0.33333f) + (Scaler.Pi / 3)),
|
||||
time
|
||||
);
|
||||
|
||||
NativeCamera.SetAllUniforms();
|
||||
/**/
|
||||
|
||||
//Console.WriteLine(NativeCamera.Projection);
|
||||
|
||||
GL.DrawElements(GepmetryType.TRIANGLES, 6, TypeCode.UInt32, IntPtr.Zero);
|
||||
|
||||
//vao.BindNull();
|
||||
vao.BindNull();
|
||||
/**/
|
||||
//Console.WriteLine(3);
|
||||
BlueprintPipeline.SkipAll(output);
|
||||
|
||||
//Console.WriteLine(4);
|
||||
//Console.Clear();
|
||||
}
|
||||
|
||||
protected override void ProcessInput()
|
||||
@@ -183,20 +208,25 @@ namespace StgSharp
|
||||
}
|
||||
if (InternalIO.glfwGetKey(this.CanvasHandle, GLconst.GLFW_KEY_UP) == KeyStatus.PRESS)
|
||||
{
|
||||
//Console.WriteLine(8);
|
||||
NativeCamera.Pitch(new Radius(movement));
|
||||
}
|
||||
else if (InternalIO.glfwGetKey(this.CanvasHandle, GLconst.GLFW_KEY_DOWN) == KeyStatus.PRESS)
|
||||
{
|
||||
//Console.WriteLine(2);
|
||||
NativeCamera.Pitch(new Radius(-movement));
|
||||
}
|
||||
if (InternalIO.glfwGetKey(CanvasHandle, GLconst.GLFW_KEY_LEFT) == KeyStatus.PRESS)
|
||||
{
|
||||
//Console.WriteLine(4);
|
||||
NativeCamera.Yaw(new Radius(-movement));
|
||||
}
|
||||
else if (InternalIO.glfwGetKey(CanvasHandle, GLconst.GLFW_KEY_RIGHT) == KeyStatus.PRESS)
|
||||
{
|
||||
//Console.WriteLine(6);
|
||||
NativeCamera.Yaw(new Radius(movement));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace StgSharp
|
||||
{
|
||||
try
|
||||
{
|
||||
InternalIO.InternalWriteLog($"\n\n\nProgram Started",LogType.Info);
|
||||
InternalIO.InternalWriteLog($"Program Started",LogType.Info);
|
||||
|
||||
//StgSharp.TryCreatWindow();
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ using System.Reflection;
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("StgSharpDebug")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+8149dfacb01d49f8173ee2799eb2bc20f34ee231")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+66efce19fcb461782c49255dc5500144f8c267e6")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("StgSharpDebug")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("StgSharpDebug")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"documents":{"D:\\NitloadIndustry\\研究项目\\1-Flagship\\TH2020\\ProjectFile\\*":"https://raw.githubusercontent.com/Nitload-NSI/CCD_Github/8149dfacb01d49f8173ee2799eb2bc20f34ee231/*"}}
|
||||
{"documents":{"D:\\NitloadIndustry\\研究项目\\1-Flagship\\TH2020\\ProjectFile\\*":"https://raw.githubusercontent.com/Nitload-NSI/CCD_Github/66efce19fcb461782c49255dc5500144f8c267e6/*"}}
|
||||
@@ -14,7 +14,7 @@ using System.Reflection;
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("StgSharpDebug")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Release")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+9a10ec201c1e78c441727446c2649fae962d9b7a")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+66efce19fcb461782c49255dc5500144f8c267e6")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("StgSharpDebug")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("StgSharpDebug")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
||||
@@ -14,7 +14,7 @@ using System.Reflection;
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("StgSharpDebug")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+98aa111a299366695c7ec9bbfdce90445050afa2")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+66efce19fcb461782c49255dc5500144f8c267e6")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("StgSharpDebug")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("StgSharpDebug")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"documents":{"D:\\NitloadIndustry\\研究项目\\1-Flagship\\TH2020\\ProjectFile\\*":"https://raw.githubusercontent.com/Nitload-NSI/CCD_Github/98aa111a299366695c7ec9bbfdce90445050afa2/*"}}
|
||||
{"documents":{"D:\\NitloadIndustry\\研究项目\\1-Flagship\\TH2020\\ProjectFile\\*":"https://raw.githubusercontent.com/Nitload-NSI/CCD_Github/66efce19fcb461782c49255dc5500144f8c267e6/*"}}
|
||||
@@ -14,7 +14,7 @@ using System.Reflection;
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("StgSharpDebug")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Release")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+9a10ec201c1e78c441727446c2649fae962d9b7a")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+66efce19fcb461782c49255dc5500144f8c267e6")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("StgSharpDebug")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("StgSharpDebug")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"documents":{"D:\\NitloadIndustry\\研究项目\\1-Flagship\\TH2020\\ProjectFile\\*":"https://raw.githubusercontent.com/Nitload-NSI/CCD_Github/9a10ec201c1e78c441727446c2649fae962d9b7a/*"}}
|
||||
{"documents":{"D:\\NitloadIndustry\\研究项目\\1-Flagship\\TH2020\\ProjectFile\\*":"https://raw.githubusercontent.com/Nitload-NSI/CCD_Github/66efce19fcb461782c49255dc5500144f8c267e6/*"}}
|
||||
Reference in New Issue
Block a user