• 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.

begemot

Members
  • Content count

    15
  • Joined

  • Last visited

Community Reputation

103 Neutral

About begemot

  • Rank
    Member
  1. Hi! Help me please to resolve the next problem. I have source picture in YUV format, saved in ARGB texture. In my effect in first pass I transform it. It is ok. But if my picture will be resized, it looks very poorly((((((( So, I think I need apply any filters to my result image. How I can do it? I try set parameters as [font=Consolas][size=2][font=Consolas][size=2]device.SetSamplerState(0, [/size][/font][/size][/font][font=Consolas][size=2][color=#2b91af][font=Consolas][size=2][color=#2b91af][font=Consolas][size=2][color=#2b91af]SamplerState[/color][/size][/font][/color][/size][/font][/color][/size][/font][font=Consolas][size=2][font=Consolas][size=2].MinFilter, [/size][/font][/size][/font][font=Consolas][size=2][color=#2b91af][font=Consolas][size=2][color=#2b91af][font=Consolas][size=2][color=#2b91af]TextureFilter[/color][/size][/font][/color][/size][/font][/color][/size][/font][font=Consolas][size=2][font=Consolas][size=2].Linear);[/size][/font][/size][/font] [font=Consolas][size=2][font=Consolas][size=2]device.SetSamplerState(0, [/size][/font][/size][/font][font=Consolas][size=2][color=#2b91af][font=Consolas][size=2][color=#2b91af][font=Consolas][size=2][color=#2b91af]SamplerState[/color][/size][/font][/color][/size][/font][/color][/size][/font][font=Consolas][size=2][font=Consolas][size=2].MagFilter, [/size][/font][/size][/font][font=Consolas][size=2][color=#2b91af][font=Consolas][size=2][color=#2b91af][font=Consolas][size=2][color=#2b91af]TextureFilter[/color][/size][/font][/color][/size][/font][/color][/size][/font][font=Consolas][size=2][font=Consolas][size=2].Linear);[/size][/font][/size][/font] [font=Consolas][size=2][font=Consolas][size=2]device.SetSamplerState(0, [/size][/font][/size][/font][font=Consolas][size=2][color=#2b91af][font=Consolas][size=2][color=#2b91af][font=Consolas][size=2][color=#2b91af]SamplerState[/color][/size][/font][/color][/size][/font][/color][/size][/font][font=Consolas][size=2][font=Consolas][size=2].MipFilter, [/size][/font][/size][/font][font=Consolas][size=2][color=#2b91af][font=Consolas][size=2][color=#2b91af][font=Consolas][size=2][color=#2b91af]TextureFilter[/color][/size][/font][/color][/size][/font][/color][/size][/font][font=Consolas][size=2][font=Consolas][size=2].Linear);[/size][/font][/size][/font] but they effects on source texture and my result image is very very bad. How I can apply filters only after first pass? One way was in getting image after first pass, creating sampler in effect as [font=Consolas][size=2][font=Consolas][size=2]texture rT2;[/size][/font][/size][/font] [font=Consolas][size=2][font=Consolas][size=2]sampler resultTex2 = sampler_state[/size][/font][/size][/font] [font=Consolas][size=2][font=Consolas][size=2]{[/size][/font][/size][/font] [font=Consolas][size=2][font=Consolas][size=2]Texture = (rT2);[/size][/font][/size][/font] [font=Consolas][size=2][font=Consolas][size=2]MinFilter = LINEAR;[/size][/font][/size][/font] [font=Consolas][size=2][font=Consolas][size=2]MagFilter = LINEAR;[/size][/font][/size][/font] [font=Consolas][size=2][font=Consolas][size=2]MipFilter = LINEAR;[/size][/font][/size][/font] [font=Consolas][size=2][font=Consolas][size=2]};[/size][/font][/size][/font] and start second simple pass) If it is a good way, how I can get image after first pass and put it to sampler?
  2. Thank you very much
  3. I use line per line CopyMemory from kernel32.dll because I don't understand how copy data from IntPtr to IntPtr by Marshal.Copy. It seems to me, It works a little bit faster then primary unsafe code.
  4. the function CopyMemory costs 52%
  5. Also YUV->RGB conversion was discussed. Can you help me in this? Can I get frames from my video files in YUV format or I must do any convertions between getting frame and copying steps?
  6. My problem is in copying a lot of memory in textures. I need execute operation of updating for 36 images with rate 25 times per second. If I have images 300x200 size I takes about 60 ms for copying and display. But if my pictures reach 700x500 size it takes just 150 ms (I tested with 16bpp format). I think to resize my images before copying, but I don't know how to do it. can ipp libs do it? Is it realy?
  7. I have texture and can do next operation [font="Consolas"][size="2"][color="#0000ff"][font="Consolas"][size="2"][color="#0000ff"][font="Consolas"][size="2"][color="#0000ff"]using[/color][/size][/font][/color][/size][/font][/color][/size][/font][font="Consolas"][size="2"][font="Consolas"][size="2"] ([/size][/font][/size][/font][font="Consolas"][size="2"][color="#2b91af"][font="Consolas"][size="2"][color="#2b91af"][font="Consolas"][size="2"][color="#2b91af"]Surface[/color][/size][/font][/color][/size][/font][/color][/size][/font][font="Consolas"][size="2"][font="Consolas"][size="2"] surface = t.GetSurfaceLevel(0))[/size][/font][/size][/font] [font="Consolas"][size="2"][font="Consolas"][size="2"]{[/size][/font][/size][/font] [font="Consolas"][size="2"][color="#2b91af"][font="Consolas"][size="2"][color="#2b91af"][font="Consolas"][size="2"][color="#2b91af"]DataRectangle[/color][/size][/font][/color][/size][/font][/color][/size][/font][font="Consolas"][size="2"][font="Consolas"][size="2"] dr = surface.LockRectangle([/size][/font][/size][/font][font="Consolas"][size="2"][color="#2b91af"][font="Consolas"][size="2"][color="#2b91af"][font="Consolas"][size="2"][color="#2b91af"]LockFlags[/color][/size][/font][/color][/size][/font][/color][/size][/font][font="Consolas"][size="2"][font="Consolas"][size="2"].Discard);[/size][/font][/size][/font] [font="Consolas"][size="2"][color="#0000ff"][font="Consolas"][size="2"][color="#0000ff"][font="Consolas"][size="2"][color="#0000ff"]int[/color][/size][/font][/color][/size][/font][/color][/size][/font][font="Consolas"][size="2"][font="Consolas"][size="2"] d_pit = dr.Pitch;[/size][/font][/size][/font] [font="Consolas"][size="2"][color="#0000ff"][font="Consolas"][size="2"][color="#0000ff"][font="Consolas"][size="2"][color="#0000ff"]for[/color][/size][/font][/color][/size][/font][/color][/size][/font][font="Consolas"][size="2"][font="Consolas"][size="2"] ([/size][/font][/size][/font][font="Consolas"][size="2"][color="#0000ff"][font="Consolas"][size="2"][color="#0000ff"][font="Consolas"][size="2"][color="#0000ff"]int[/color][/size][/font][/color][/size][/font][/color][/size][/font][font="Consolas"][size="2"][font="Consolas"][size="2"] j = 0; j < heightdef; j++)[/size][/font][/size][/font] [font="Consolas"][size="2"][font="Consolas"][size="2"]CopyMemory(dr.Data.DataPointer.ToInt32() + j*d_pit,[/size][/font][/size][/font][font="Consolas"][size="2"][font="Consolas"][size="2"]ptr.ToInt32() + [/size][/font][/size][/font][font="Consolas"][size="2"][font="Consolas"][size="2"]j*pit,[/size][/font][/size][/font][font="Consolas"][size="2"][font="Consolas"][size="2"]d_pit);[/size][/font][/size][/font] [font="Consolas"][size="2"][font="Consolas"][size="2"]surface.UnlockRectangle();[/size][/font][/size][/font] [font="Consolas"][size="2"][font="Consolas"][size="2"]}[/size][/font][/size][/font] [font="Consolas"][size="2"][font="Consolas"][size="2"]then I pass it to shader.[/size][/font][/size][/font] [font="Consolas"][size="2"][font="Consolas"][size="2"]Is it the fastest way? [/size][/font][/size][/font]
  8. But I don't understand how I pass my surface to shader.. I can create texture, Get surface as [font="Consolas"][size="2"][font="Consolas"][size="2"]Texture.GetSurfaceLevel(0)[/size][/font][/size][/font], [font="Consolas"][size="2"][font="Consolas"][size="2"]update surface using line per line CopyMemory and pass to shader texture. Is it right?[/size][/font][/size][/font]
  9. I tested creating texture from memory using Texture.FromMemory () (Nik02 was right in data format - it must contain BITMAPINFOHEADER),but it is very slow.. Now I do CopyMemory -this way a little bit faster when unsafe copying. Working with video memory throw surfaces is faster then throw textures?
  10. Which of ways of creating texture you suppose is the fastest? Texture.FromMemory Texture.FromStream new Texture() and copy data
  11. May be, those copying code can be exclude in the following ways: 1. My idea to put bytes to shader/effect 2. Create texture from memory. In this case I have error in code [font="Consolas"][size="2"][color="#2b91af"][font="Consolas"][size="2"][color="#2b91af"][font="Consolas"][size="2"][color="#2b91af"]Texture[/color][/size][/font][/color][/size][/font][/color][/size][/font][font="Consolas"][size="2"][font="Consolas"][size="2"][color="#000000"].FromMemory(device, imageBytes,widthdef,heightdef,1,[/color][/size][/font][/size][/font][font="Consolas"][size="2"][color="#2b91af"][font="Consolas"][size="2"][color="#2b91af"][font="Consolas"][size="2"][color="#2b91af"]Usage[/color][/size][/font][/color][/size][/font][/color][/size][/font][font="Consolas"][size="2"][font="Consolas"][size="2"][color="#000000"].None,[/color][/size][/font][/size][/font][font="Consolas"][size="2"][color="#2b91af"][font="Consolas"][size="2"][color="#2b91af"][font="Consolas"][size="2"][color="#2b91af"]Format[/color][/size][/font][/color][/size][/font][/color][/size][/font][font="Consolas"][size="2"][font="Consolas"][size="2"][color="#000000"].A8R8G8B8,[/color][/size][/font][/size][/font][font="Consolas"][size="2"][color="#2b91af"][font="Consolas"][size="2"][color="#2b91af"][font="Consolas"][size="2"][color="#2b91af"]Pool[/color][/size][/font][/color][/size][/font][/color][/size][/font][font="Consolas"][size="2"][font="Consolas"][size="2"][color="#000000"].Default,[/color][/size][/font][/size][/font][font="Consolas"][size="2"][color="#2b91af"][font="Consolas"][size="2"][color="#2b91af"][font="Consolas"][size="2"][color="#2b91af"]Filter[/color][/size][/font][/color][/size][/font][/color][/size][/font][font="Consolas"][size="2"][font="Consolas"][size="2"][color="#000000"].None,[/color][/size][/font][/size][/font][font="Consolas"][size="2"][color="#2b91af"][font="Consolas"][size="2"][color="#2b91af"][font="Consolas"][size="2"][color="#2b91af"]Filter[/color][/size][/font][/color][/size][/font][/color][/size][/font][font="Consolas"][size="2"][font="Consolas"][size="2"][color="#000000"].None,[/color][/size][/font][/size][/font][font="Consolas"][size="2"][color="#2b91af"][font="Consolas"][size="2"][color="#2b91af"][font="Consolas"][size="2"][color="#2b91af"]Color[/color][/size][/font][/color][/size][/font][/color][/size][/font][font="Consolas"][size="2"][font="Consolas"][size="2"][color="#000000"].White.ToArgb())[/color][/size][/font][/size][/font] [font="Consolas"][size="2"][font="Consolas"][size="2"][color="#000000"]In what I'm mistake?[/color][/size][/font][/size][/font] 3. Create one - dimension texture and pass it to shader/effect
  12. It seems to me, that I can not use Marshal.Copy so as pitch of source image not equals texture's pitch at times.. I'm dreaming to remove this copying process.. Yes. I need get and display frames from video file in realtime mode)))
  13. May be creating parameters are not optimized? or code to fill?
  14. I need to use D3D9.. Now I create texture as [font="Consolas"][size="2"][color="#0000ff"][font="Consolas"][size="2"][color="#0000ff"][font="Consolas"][size="2"][color="#0000ff"]new[/color][/size][/font][/color][/size][/font][/color][/size][/font][font="Consolas"][size="2"][font="Consolas"][size="2"][color="#000000"] [/color][/size][/font][/size][/font][font="Consolas"][size="2"][color="#2b91af"][font="Consolas"][size="2"][color="#2b91af"][font="Consolas"][size="2"][color="#2b91af"]Texture[/color][/size][/font][/color][/size][/font][/color][/size][/font][font="Consolas"][size="2"][font="Consolas"][size="2"][color="#000000"](device, w[/color][/size][/font][/size][/font][font="Consolas"][size="2"][font="Consolas"][size="2"][color="#000000"], h[/color][/size][/font][/size][/font][font="Consolas"][size="2"][font="Consolas"][size="2"][color="#000000"], 1, [/color][/size][/font][/size][/font][font="Consolas"][size="2"][color="#2b91af"][font="Consolas"][size="2"][color="#2b91af"][font="Consolas"][size="2"][color="#2b91af"]Usage[/color][/size][/font][/color][/size][/font][/color][/size][/font][font="Consolas"][size="2"][font="Consolas"][size="2"][color="#000000"].Dynamic, [/color][/size][/font][/size][/font][font="Consolas"][size="2"][color="#2b91af"][font="Consolas"][size="2"][color="#2b91af"][font="Consolas"][size="2"][color="#2b91af"]Format[/color][/size][/font][/color][/size][/font][/color][/size][/font][font="Consolas"][size="2"][font="Consolas"][size="2"][color="#000000"].A8R8G8B8,[/color][/size][/font][/size][/font][font="Consolas"][size="2"][color="#2b91af"][font="Consolas"][size="2"][color="#2b91af"][font="Consolas"][size="2"][color="#2b91af"]Pool[/color][/size][/font][/color][/size][/font][/color][/size][/font][font="Consolas"][size="2"][font="Consolas"][size="2"][color="#000000"].Default);[/color][/size][/font][/size][/font] [font="Consolas"][size="2"][font="Consolas"][size="2"][color="#000000"]and then fill it [/color][/size][/font][/size][/font] [font="Consolas"][size="2"][font="Consolas"][size="2"][color="#000000"][font="Consolas"][size="2"][color="#2b91af"][font="Consolas"][size="2"][color="#2b91af"][font="Consolas"][size="2"][color="#2b91af"]DataRectangle[/color][/size][/font][/color][/size][/font][/color][/size][/font][font="Consolas"][size="2"][font="Consolas"][size="2"] a_ = t.LockRectangle(0, [/size][/font][/size][/font][font="Consolas"][size="2"][color="#2b91af"][font="Consolas"][size="2"][color="#2b91af"][font="Consolas"][size="2"][color="#2b91af"]LockFlags[/color][/size][/font][/color][/size][/font][/color][/size][/font][font="Consolas"][size="2"][font="Consolas"][size="2"].None);[/size][/font][/size][/font][/color][/size][/font][/size][/font] [font="Consolas"][size="2"][font="Consolas"][size="2"][color="#000000"][font="Consolas"][size="2"][color="#0000ff"][font="Consolas"][size="2"][color="#0000ff"][font="Consolas"][size="2"][color="#0000ff"]int[/color][/size][/font][/color][/size][/font][/color][/size][/font][font="Consolas"][size="2"][font="Consolas"][size="2"] pitch = (([/size][/font][/size][/font][font="Consolas"][size="2"][color="#0000ff"][font="Consolas"][size="2"][color="#0000ff"][font="Consolas"][size="2"][color="#0000ff"]int[/color][/size][/font][/color][/size][/font][/color][/size][/font][font="Consolas"][size="2"][font="Consolas"][size="2"])a_.Pitch / [/size][/font][/size][/font][font="Consolas"][size="2"][color="#0000ff"][font="Consolas"][size="2"][color="#0000ff"][font="Consolas"][size="2"][color="#0000ff"]sizeof[/color][/size][/font][/color][/size][/font][/color][/size][/font][font="Consolas"][size="2"][font="Consolas"][size="2"]([/size][/font][/size][/font][font="Consolas"][size="2"][color="#0000ff"][font="Consolas"][size="2"][color="#0000ff"][font="Consolas"][size="2"][color="#0000ff"]ushort[/color][/size][/font][/color][/size][/font][/color][/size][/font][font="Consolas"][size="2"][font="Consolas"][size="2"]));[/size][/font][/size][/font][/color][/size][/font][/size][/font] [font="Consolas"][size="2"][font="Consolas"][size="2"][color="#000000"][font="Consolas"][size="2"][color="#2b91af"][font="Consolas"][size="2"][color="#2b91af"][font="Consolas"][size="2"][color="#2b91af"]DataStream[/color][/size][/font][/color][/size][/font][/color][/size][/font][font="Consolas"][size="2"][font="Consolas"][size="2"] a = a_.Data;[/size][/font][/size][/font][/color][/size][/font][/size][/font] [font="Consolas"][size="2"][font="Consolas"][size="2"][color="#000000"][font="Consolas"][size="2"][color="#0000ff"][font="Consolas"][size="2"][color="#0000ff"][font="Consolas"][size="2"][color="#0000ff"]unsafe[/color][/size][/font][/color][/size][/font][/color][/size][/font][/color][/size][/font][/size][/font] [font="Consolas"][size="2"][font="Consolas"][size="2"][color="#000000"][font="Consolas"][size="2"][font="Consolas"][size="2"]{[/size][/font][/size][/font][/color][/size][/font][/size][/font] [font="Consolas"][size="2"][font="Consolas"][size="2"][color="#000000"][font="Consolas"][size="2"][color="#0000ff"][font="Consolas"][size="2"][color="#0000ff"][font="Consolas"][size="2"][color="#0000ff"]ushort[/color][/size][/font][/color][/size][/font][/color][/size][/font][font="Consolas"][size="2"][font="Consolas"][size="2"]* to = ([/size][/font][/size][/font][font="Consolas"][size="2"][color="#0000ff"][font="Consolas"][size="2"][color="#0000ff"][font="Consolas"][size="2"][color="#0000ff"]ushort[/color][/size][/font][/color][/size][/font][/color][/size][/font][font="Consolas"][size="2"][font="Consolas"][size="2"]*)a.DataPointer;[/size][/font][/size][/font][/color][/size][/font][/size][/font] [font="Consolas"][size="2"][font="Consolas"][size="2"][color="#000000"][font="Consolas"][size="2"][color="#0000ff"][font="Consolas"][size="2"][color="#0000ff"][font="Consolas"][size="2"][color="#0000ff"]ushort[/color][/size][/font][/color][/size][/font][/color][/size][/font][font="Consolas"][size="2"][font="Consolas"][size="2"]* from = ([/size][/font][/size][/font][font="Consolas"][size="2"][color="#0000ff"][font="Consolas"][size="2"][color="#0000ff"][font="Consolas"][size="2"][color="#0000ff"]ushort[/color][/size][/font][/color][/size][/font][/color][/size][/font][font="Consolas"][size="2"][font="Consolas"][size="2"]*)ptr.ToPointer();[/size][/font][/size][/font][/color][/size][/font][/size][/font] [font="Consolas"][size="2"][font="Consolas"][size="2"][color="#000000"][font="Consolas"][size="2"][color="#0000ff"][font="Consolas"][size="2"][color="#0000ff"][font="Consolas"][size="2"][color="#0000ff"]for[/color][/size][/font][/color][/size][/font][/color][/size][/font][font="Consolas"][size="2"][font="Consolas"][size="2"] ([/size][/font][/size][/font][font="Consolas"][size="2"][color="#0000ff"][font="Consolas"][size="2"][color="#0000ff"][font="Consolas"][size="2"][color="#0000ff"]int[/color][/size][/font][/color][/size][/font][/color][/size][/font][font="Consolas"][size="2"][font="Consolas"][size="2"] j = 0; j < heightdef; j++)[/size][/font][/size][/font][/color][/size][/font][/size][/font] [font="Consolas"][size="2"][font="Consolas"][size="2"][color="#000000"][font="Consolas"][size="2"][color="#0000ff"][font="Consolas"][size="2"][color="#0000ff"][font="Consolas"][size="2"][color="#0000ff"]for[/color][/size][/font][/color][/size][/font][/color][/size][/font][font="Consolas"][size="2"][font="Consolas"][size="2"] ([/size][/font][/size][/font][font="Consolas"][size="2"][color="#0000ff"][font="Consolas"][size="2"][color="#0000ff"][font="Consolas"][size="2"][color="#0000ff"]int[/color][/size][/font][/color][/size][/font][/color][/size][/font][font="Consolas"][size="2"][font="Consolas"][size="2"] i = 0; i < pit; i++)[/size][/font][/size][/font][/color][/size][/font][/size][/font] [font="Consolas"][size="2"][font="Consolas"][size="2"][color="#000000"][font="Consolas"][size="2"][font="Consolas"][size="2"]to[i + j * pitch] = from[i + j * pit];[/size][/font][/size][/font][/color][/size][/font][/size][/font] [font="Consolas"][size="2"][font="Consolas"][size="2"][color="#000000"][font="Consolas"][size="2"][font="Consolas"][size="2"]}[/size][/font][/size][/font][/color][/size][/font][/size][/font] [font="Consolas"][size="2"][font="Consolas"][size="2"][color="#000000"][font="Consolas"][size="2"][font="Consolas"][size="2"]t.UnlockRectangle(0);[/size][/font][/size][/font][/color][/size][/font][/size][/font] [font="Consolas"][size="2"][font="Consolas"][size="2"] [/size][/font][/size][/font] [font="Consolas"][size="2"][font="Consolas"][size="2"] [/size][/font][/size][/font] [font="Consolas"][size="2"][font="Consolas"][size="2"]then I can set it to my effect to texture parameter: effect.SetTexture("Tex",t). [/size][/font][/size][/font] [font="Consolas"][size="2"][font="Consolas"][size="2"] Is exist any faster way to update texture in effect?[/size][/font][/size][/font]
  15. I have byte array of image's data (or pointer). I have effect with pixel shader to fill result texture. I want to work with my image data in pixel shader without unnecessary transformations. How I can transfer bytes array to my Effect and how I must define it in HLSL program? I'm using SlimDX and C#. Help me,please!!!