Delta Engine
»
General
»
Showcase
»
2D Water rendering
Joined: 8/21/2011(UTC) Posts: 28
Thanks: 1 times
|
Hi all, As promised i've completed 2D water rendering using Delta Engine milestone 2. Basically i've just added the code bellow to Renderer class. Code:
public void DrawPrimitives(VertexPositionColor[] vertices)
{
draw.DisableTexturing();
draw.DrawVertices(VerticesMode.Triangles, vertices);
}
Video here: Hope you like it, source code is attached. Edited by user Thursday, February 7, 2013 10:50:45 PM(UTC)
| Reason: Not specified File Attachment(s):  WaterDemo.zip (274kb) downloaded 10 time(s).You cannot view/download attachments. Try to login or register.
|
|
|
|
Joined: 10/11/2011(UTC) Posts: 11
Thanks: 4 times
|
Hi Amer,
looks cool, but I get the following error (Water.cs) when I compile your source code:
Error 1 'DeltaEngine.Rendering.Renderer' does not contain a definition for 'DrawPrimitives' and no extension method 'DrawPrimitives' accepting a first argument of type 'DeltaEngine.Rendering.Renderer' could be found (are you missing a using directive or an assembly reference?) C:\Documents and Settings\fj0t0331\My Documents\Visual Studio 2010\Projects\WaterDemo\Water.cs 166 13 WaterDemo
Joerg
|
|
|
|
Joined: 8/21/2011(UTC) Posts: 28
Thanks: 1 times
|
Originally Posted by: Wolfhund  Hi Amer,
looks cool, but I get the following error (Water.cs) when I compile your source code:
Error 1 'DeltaEngine.Rendering.Renderer' does not contain a definition for 'DrawPrimitives' and no extension method 'DrawPrimitives' accepting a first argument of type 'DeltaEngine.Rendering.Renderer' could be found (are you missing a using directive or an assembly reference?) C:\Documents and Settings\fj0t0331\My Documents\Visual Studio 2010\Projects\WaterDemo\Water.cs 166 13 WaterDemo
Joerg
Indeed you need to add the DrawPrimitives method to Renderer class, take the snippet above and add it, then you're done. Hope this helps, Amer
|
|
|
|
Joined: 10/11/2011(UTC) Posts: 11
Thanks: 4 times
|
Originally Posted by: Amer  Indeed you need to add the DrawPrimitives method to Renderer class, take the snippet above and add it, then you're done.
Hope this helps, Amer Hi Amer, thanks for your reply, however don't know where to add the mentioned method. Can't find any renderer class. Can you tell were excactly to add the snippet? And should it not read like this? Drawing instead of draw? Code:
public void DrawPrimitives(VertexPositionColor[] vertices)
{
Drawing.DisableTexturing();
Drawing.DrawVertices(VerticesMode.Triangles, vertices);
}
Thanks, Joerg Edited by user Tuesday, February 12, 2013 9:45:12 AM(UTC)
| Reason: Code Formatting
|
|
|
|
Joined: 8/21/2011(UTC) Posts: 28
Thanks: 1 times
|
Originally Posted by: Wolfhund  Hi Amer, thanks for your reply, however don't know where to add the mentioned method. Can't find any renderer class. Can you tell were excactly to add the snippet? And should it not read like this? Drawing instead of draw? Code:
public void DrawPrimitives(VertexPositionColor[] vertices)
{
Drawing.DisableTexturing();
Drawing.DrawVertices(VerticesMode.Triangles, vertices);
}
Thanks, Joerg Sorry for not being cleaver, you need to add it into DeltaEngine\Rendering\Renderer.cs class. Maybe someone of DE team can add it.
|
|
|
|
Medals:  Joined: 8/20/2011(UTC) Posts: 1,421 Location: Hannover
Thanks: 18 times Was thanked: 97 time(s) in 92 post(s)
|
Cool stuff, yes, we will add it to our new samples section we will open soon.
|
|
|
|
Joined: 3/18/2013(UTC) Posts: 29
Thanks: 5 times
|
Hallo,
I just started studying DeltaEngine. With the latest release (v0.9.7.3) the Water example has some errors that I have fixed like that:
Input --> InputCommands ToQuadraticSpace --> FromPixelSpace renderer.Screen.ViewportPixelSize --> Viewport
I've also added DrawPrimitives to the Renderer class. But the right click does nothing, though it calls the water class for update... any advices?
|
|
|
|
Delta Engine
»
General
»
Showcase
»
2D Water rendering
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.