• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

Prasoon Pankaj

Members
  • Content count

    12
  • Joined

  • Last visited

Community Reputation

104 Neutral

About Prasoon Pankaj

  • Rank
    Member
  1. We are trying to get DirectShow work with USB video capture devices like this. The code simply adds the capture source's filter (capFilter) in the capture graph and then connects it to VMR9 renderer already added to the graph. [CODE]captureGraph.RenderStream(null, MediaType.Video, capFilter, null, vmr9);[/CODE] At present, everything runs without throwing any exception, but the output is just black. I checked the capture source's output in GraphStudio, but it also resulted in the same black output.
  2. Just need to figure out a way, using Pixel Shader, to project a texture to an arbitary user-defined rectangle. Will be accepting coordinates of the four sides of a quadrilateral: [color="#808080"][code] /// <defaultValue>0,0</defaultValue> float2 TopLeft : register(c0); /// <defaultValue>1,0</defaultValue> float2 TopRight : register(c1); /// <defaultValue>0,1</defaultValue> float2 BottomLeft : register(c2); /// <defaultValue>1,1</defaultValue> float2 BottomRight : register(c3); [/code][/color] Tried couple of interpolation algorithm, but couldn't manage to get it right. Is there any sample you guys think which I might be able to modify to get the desired result?
  3. I tried to load the data using CopyPixels(), but it throws D3DXERR_INVALIDDATA exception. [code] RenderTargetBitmap bmp = GetBitmap();// copy into a byte array int stride = bmp.PixelWidth * 4; byte[] data = new byte[bmp.PixelHeight * stride]; bmp.CopyPixels(data, stride, 0); // create texture using (MemoryStream ms = new MemoryStream(data)) { ms.Seek(0, SeekOrigin.Begin); if (dxDevice != null) { // next line throws D3DXERR_INVALIDDATA exception texture = TextureLoader.FromStream(dxDevice, ms); } } [/code]
  4. Well, the problem is simple, I have something rendered on a WPF Visual. I want to get it to on a DirectX Texture. At present, I using the following code to get the job done. [code] var bmp = new System.Windows.Media.Imaging.RenderTargetBitmap(bound.Width, bound.Height, 96, 96, System.Windows.Media.PixelFormats.Pbgra32); bmp.Render(drawingVisual); var encoder = new System.Windows.Media.Imaging.PngBitmapEncoder(); encoder.Frames.Add(System.Windows.Media.Imaging.BitmapFrame.Create(bmp)); Texture texture = new Texture(dxDevice, bound.Width, bound.Height, 1, Usage.RenderTarget, Format.A8R8G8B8, Pool.Default); using (MemoryStream ms = new MemoryStream()) { encoder.Save(ms); ms.Seek(0, SeekOrigin.Begin); Surface privateSurface = texture.GetSurfaceLevel(0); SurfaceLoader.FromStream(privateSurface, ms, Filter.None, Color.MediumAquamarine.ToArgb()); ms.Close(); } return texture; // our prepared texture [/code] But it's somewhat slow, in an obvious manner. Can you guys suggest something which could possibly make it quicker?
  5. It was giving me some hit. So, I changed the logic to use CustomVertex.Transformed[] and used the following logic in my render loop: [code] var blendedFillColor = /* color remains the same, just changing the alpha value */; device.TextureState[0].ConstantColor = blendedFillColor; device.TextureState[0].ColorOperation = TextureOperation.SelectArg1; device.TextureState[0].AlphaOperation = TextureOperation.SelectArg1; device.TextureState[0].ColorArgument1 = TextureArgument.Constant; device.TextureState[0].AlphaArgument1 = TextureArgument.Constant; device.SetStreamSource(0, this._vertexBuffer, 0); device.VertexFormat = CustomVertex.Transformed.Format; device.DrawPrimitives(PrimitiveType.TriangleStrip, 0, 2); [/code] Anything you guys wanna suggest?
  6. [quote name='smasherprog' timestamp='1303078436' post='4799630'] Instead of changing the information per vertex, why not set an alpha value per object? There isnt a need to change it per vertex when it can be set in the shader. [/quote] Can you please share few links to the stuff you are talking about? Or may be a sample code to illustrate.
  7. In my render loop I'm trying to change alpha value overtime to make objects to fade-in/out: [code] var blendedFillColor = /* color remains the same, just changing the alpha value */; var vertices = (CustomVertex.TransformedColored[])_vertexBuffer.Lock(0, 0); for (int vertexIndex = 0; vertexIndex < 4; vertexIndex++) { vertices[vertexIndex].Color = blendedFillColor.ToArgb(); } _vertexBuffer.Unlock(); dxDevice.SetStreamSource(0, _vertexBuffer, 0); dxDevice.VertexFormat = CustomVertex.TransformedColored.Format; dxDevice.DrawPrimitives(PrimitiveType.TriangleStrip, 0, 2); [/code] Is Lock() and Unlock() operation on the vertex buffer a performance hit? And also can I avoid it in my case?
  8. Well, I tried many forums* before but I guess GameDev forums might have the right people to address my problem. So, here it goes: I tried to google it out, but is there any sample Shader effect which I could use to produce an outlined FormattedText. I was able to get the outline by using BuildGeometry(), but the performance is very poor! PS: Since I'm new to this and still learning, it would be helpful if anyone can suggest whether it would be even possible or not. * http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/f8a62177-622a-4844-a18c-274c438223a0
  9. So, I finally figured it out. It's all related to Sprites and its Begin() method. Sprite.Begin() will modify the RenderState and disable stencil. We can prevent it by setting SpriteFlags.DoNotModifyRenderState flag, but then the alpha blending is not supported when sprites are drawn. What I did now was simply call Sprite.Begin() without SpriteFlags.DoNotModifyRenderState flag set. And before the call to Sprite.Draw(), enabled stencil on the device.
  10. OK.. So I figured out how to get it done. Referred to this post - http://www.gamedev.net/community/forums/viewreply.asp?ID=1999276 But now the sprite is ignoring alpha values and rendering sprites opaque. Similar to the effect we get when alpha blending is set to false.
  11. Was trying to get Stencil to work in my app. I use Sprites to render content on to the Device. Content could be movies, pictures or text. Can I set the stencil buffer using these Sprites, which can be used in later passes to stencil out other Sprites being rendered? I'm even not able to stencil out any of the Sprites by setting StencilFunction = Compare.Never! Anything wrong that I might be doing? I've already spent almost an entire day checking out posts related to Stencils in MDX, but just couldn't get it to work. Bit more searching got me to a technique wherein we draw silhouette of the shapes to be added to the stencil buffer. Is this really required in my case? I just want to use the Sprites, and add them to stencil buffer to stencil out other Sprites. Anybody? [Edited by - Prasoon Pankaj on September 16, 2010 2:49:44 PM]