daily update on 20240514 by nitload youmu
This commit is contained in:
@@ -33,20 +33,40 @@ namespace StgSharp
|
||||
VertexArray vao;
|
||||
ElementBuffer ebo;
|
||||
|
||||
internal TimeSpanProvider spanProvider;
|
||||
|
||||
internal static vec3d DefaultRotation(TimeSpanProvider provider, out float rotation)
|
||||
{
|
||||
rotation = 0.1f;
|
||||
float angle = provider.CurrentSpan * 0.1f;
|
||||
return new vec3d(
|
||||
0.01f * Scaler.Cos(angle),
|
||||
- 0.01f * Scaler.Sin(angle),
|
||||
0
|
||||
);
|
||||
}
|
||||
|
||||
protected override void Init()
|
||||
{
|
||||
spanProvider = new TimeSpanProvider(1 / 60.00f, TimeSpanProvider.DefaultProvider);
|
||||
|
||||
buffer = new PlainInstancingBuffer<ParticleOnPlain>();
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
float ai =Scaler.Abs(i - 5.0f);
|
||||
for (int t = 0; t < 10; t++)
|
||||
{
|
||||
float at = Scaler.Abs(t - 5.0f);
|
||||
|
||||
ParticleOnPlain p = new ParticleOnPlain(buffer);
|
||||
((IInstancing<ParticleOnPlain>)p).Coord = new vec3d(
|
||||
(-5 + i) * 0.2f + 0.1f, (-5 + t) * 0.2f + 0.1f, 0);
|
||||
((IInstancing<ParticleOnPlain>)p).Scale = Scaler.MinOf(i,t) * 0.2f;
|
||||
((IInstancing<ParticleOnPlain>)p).Motion = GeometryMotion.DefaultMotion;
|
||||
((IInstancing<ParticleOnPlain>)p).Scale =
|
||||
Scaler.MinOf(ai, at) * 0.4f + 0.1f;
|
||||
((IInstancing<ParticleOnPlain>)p).Motion = new GeometryMotion(
|
||||
true,spanProvider,
|
||||
DefaultRotation)
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,7 +103,7 @@ namespace StgSharp
|
||||
ebo.SetValue(0, rec.Indices, BufferUsage.STATIC_DRAW);
|
||||
vao.SetVertexAttribute(0, 3, TypeCode.Single, false, 4 * sizeof(float),0);
|
||||
|
||||
vbo.WriteVectorData(1, buffer.CoordSpan,BufferUsage.STATIC_DRAW);
|
||||
vbo.WriteVectorData(1, buffer.CoordSpan,BufferUsage.STREAM_DRAW);
|
||||
vao.SetVertexAttribute(1, 3, TypeCode.Single, false, 4 * sizeof(float), 0);
|
||||
vao.SetVertexAttribute(2, 1, TypeCode.Single, false, 4 * sizeof(float), 3 * sizeof(float));
|
||||
|
||||
@@ -111,10 +131,16 @@ namespace StgSharp
|
||||
protected override void Main(in Dictionary<string, BlueprintPipeline> input, in Dictionary<string, BlueprintPipeline> output)
|
||||
{
|
||||
|
||||
buffer.UpdateAllParticles();
|
||||
|
||||
GL.ClearColor(0.6f,0.1f,0.3f,1);
|
||||
GL.Clear(MaskBufferBit.COLOR | MaskBufferBit.DEPTH);
|
||||
|
||||
vao.Bind(0);
|
||||
|
||||
vbo.Bind(1);
|
||||
vbo.WriteVectorData(1, buffer.CoordSpan, BufferUsage.STREAM_DRAW);
|
||||
|
||||
s.Use();
|
||||
|
||||
NativeCamera.SetAllUniforms();
|
||||
|
||||
@@ -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+56459deec57aa5078d6bb5991dbf32f29c06e826")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+a3506c96a3f6c7df608c22594ca2eaec41efa511")]
|
||||
[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/56459deec57aa5078d6bb5991dbf32f29c06e826/*"}}
|
||||
{"documents":{"D:\\NitloadIndustry\\研究项目\\1-Flagship\\TH2020\\ProjectFile\\*":"https://raw.githubusercontent.com/Nitload-NSI/CCD_Github/a3506c96a3f6c7df608c22594ca2eaec41efa511/*"}}
|
||||
Reference in New Issue
Block a user