water anim in shader
This commit is contained in:
@@ -10,7 +10,7 @@ namespace OpenRa.Game.Graphics
|
||||
{
|
||||
class HardwarePalette : Sheet
|
||||
{
|
||||
const int maxEntries = 16;
|
||||
const int maxEntries = 8;
|
||||
int allocated = 0;
|
||||
|
||||
public HardwarePalette(Renderer renderer, Map map)
|
||||
|
||||
@@ -31,10 +31,13 @@ namespace OpenRa.Game.Graphics
|
||||
|
||||
public GraphicsDevice Device { get { return device; } }
|
||||
|
||||
public static float waterFrame = 0.0f;
|
||||
|
||||
public void BeginFrame( float2 r1, float2 r2, float2 scroll )
|
||||
{
|
||||
device.Begin();
|
||||
|
||||
SpriteShader.SetValue("palDist", waterFrame);
|
||||
SpriteShader.SetValue("Scroll", scroll);
|
||||
SpriteShader.SetValue("r1", r1);
|
||||
SpriteShader.SetValue("r2", r2);
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace OpenRa.Game.Graphics
|
||||
|
||||
public static void FastCreateQuad(Vertex[] vertices, ushort[] indices, float2 o, Sprite r, int palette, int nv, int ni)
|
||||
{
|
||||
float2 attrib = new float2(palette / 16.0f, channelSelect[(int)r.channel]);
|
||||
float2 attrib = new float2(palette / 8.0f, channelSelect[(int)r.channel]);
|
||||
|
||||
vertices[nv] = new Vertex(KLerp(o, r.size, 0), r.FastMapTextureCoords(0), attrib);
|
||||
vertices[nv + 1] = new Vertex(KLerp(o, r.size, 1), r.FastMapTextureCoords(1), attrib);
|
||||
|
||||
Reference in New Issue
Block a user