2020-08-05 03:50:44 +00:00
|
|
|
using System.IO;
|
|
|
|
|
|
|
|
namespace Kav
|
|
|
|
{
|
|
|
|
internal class Resources
|
|
|
|
{
|
2020-10-01 19:46:25 +00:00
|
|
|
public static byte[] DeferredPBR_AmbientLightEffect
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
|
|
|
if (ambientLightEffect == null)
|
|
|
|
{
|
|
|
|
ambientLightEffect = GetResource("DeferredPBR_AmbientLightEffect");
|
|
|
|
}
|
|
|
|
return ambientLightEffect;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
public static byte[] DeferredPBR_PointLightEffect
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
|
|
|
if (pointLightEffect == null)
|
|
|
|
{
|
|
|
|
pointLightEffect = GetResource("DeferredPBR_PointLightEffect");
|
|
|
|
}
|
|
|
|
return pointLightEffect;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static byte[] DeferredPBR_DirectionalLightEffect
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
|
|
|
if (directionalLightEffect == null)
|
|
|
|
{
|
|
|
|
directionalLightEffect = GetResource("DeferredPBR_DirectionalLightEffect");
|
|
|
|
}
|
|
|
|
return directionalLightEffect;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-08-27 18:14:17 +00:00
|
|
|
public static byte[] DeferredPBR_GBufferEffect
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
|
|
|
if (gBufferEffect == null)
|
|
|
|
{
|
|
|
|
gBufferEffect = GetResource("DeferredPBR_GBufferEffect");
|
|
|
|
}
|
|
|
|
return gBufferEffect;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-10-01 19:46:25 +00:00
|
|
|
public static byte[] ToneMapEffect
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
|
|
|
if (toneMapEffect == null)
|
|
|
|
{
|
|
|
|
toneMapEffect = GetResource("ToneMapEffect");
|
|
|
|
}
|
|
|
|
return toneMapEffect;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-10-01 21:52:19 +00:00
|
|
|
public static byte[] Deferred_ToonEffect
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
|
|
|
if (deferredToonEffect == null)
|
|
|
|
{
|
|
|
|
deferredToonEffect = GetResource("Deferred_ToonEffect");
|
|
|
|
}
|
|
|
|
return deferredToonEffect;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-08-27 18:14:17 +00:00
|
|
|
public static byte[] DeferredPBREffect
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
|
|
|
if (deferredPBREffect == null)
|
|
|
|
{
|
|
|
|
deferredPBREffect = GetResource("DeferredPBREffect");
|
|
|
|
}
|
|
|
|
return deferredPBREffect;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-08-05 03:50:44 +00:00
|
|
|
public static byte[] PBREffect
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
|
|
|
if (pbrEffect == null)
|
|
|
|
{
|
|
|
|
pbrEffect = GetResource("PBREffect");
|
|
|
|
}
|
|
|
|
return pbrEffect;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-08-07 00:58:50 +00:00
|
|
|
public static byte[] SimpleDepthEffect
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
|
|
|
if (simpleDepthEffect == null)
|
|
|
|
{
|
2020-08-07 08:12:46 +00:00
|
|
|
simpleDepthEffect = GetResource("SimpleDepthEffect");
|
2020-08-07 00:58:50 +00:00
|
|
|
}
|
|
|
|
return simpleDepthEffect;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-10-01 19:46:25 +00:00
|
|
|
private static byte[] ambientLightEffect;
|
|
|
|
private static byte[] pointLightEffect;
|
|
|
|
private static byte[] directionalLightEffect;
|
2020-08-27 18:14:17 +00:00
|
|
|
private static byte[] gBufferEffect;
|
2020-10-01 19:46:25 +00:00
|
|
|
private static byte[] toneMapEffect;
|
2020-10-01 21:52:19 +00:00
|
|
|
private static byte[] deferredToonEffect;
|
2020-08-27 18:14:17 +00:00
|
|
|
private static byte[] deferredPBREffect;
|
2020-08-05 03:50:44 +00:00
|
|
|
private static byte[] pbrEffect;
|
2020-08-07 00:58:50 +00:00
|
|
|
private static byte[] simpleDepthEffect;
|
2020-08-05 03:50:44 +00:00
|
|
|
|
|
|
|
private static byte[] GetResource(string name)
|
|
|
|
{
|
|
|
|
Stream stream = typeof(Resources).Assembly.GetManifestResourceStream(
|
2020-08-06 07:10:23 +00:00
|
|
|
"Kav.Resources." + name + ".fxb"
|
2020-08-05 03:50:44 +00:00
|
|
|
);
|
|
|
|
using (MemoryStream ms = new MemoryStream())
|
|
|
|
{
|
|
|
|
stream.CopyTo(ms);
|
|
|
|
return ms.ToArray();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|