Jump to content

  • Log In with Google      Sign In   
  • Create Account

Gavin Williams

Member Since 04 Dec 2010
Offline Last Active Yesterday, 07:08 PM

#5197439 Game Entity object graph serialization

Posted by Gavin Williams on 10 December 2014 - 01:27 PM

Binary is simple and effective for saving game-state.




#5197437 Want to become a Computer Scientist

Posted by Gavin Williams on 10 December 2014 - 01:24 PM

@Olof Hedman - no but it's damn hard. Most people who start a degree will not reach master or doctorate level. It does take unusual commitment.




#5196427 Please give me some lectures for directx programming

Posted by Gavin Williams on 05 December 2014 - 06:39 AM

There are a couple of books you could get ...

Introduction to 3D Game Programming with DirectX 11 - Frank D. Luna

Practical Rendering and Computation with Direct 3D 11 - Jason Z. Matt P. Jack H.

There is also a commonly referenced website:

 

http://www.rastertek.com/

***********************************************************

Direct X is a pretty huge topic, just asking for 'advice' on using it is almost like asking for advice on programming. What do you want people to say?

Here's some advice ... it's really great, very interesting, powerful, but difficult at times. You will need to spend A LOT of time learning it, and much more mastering it. Read Books, read websites & blogs on rendering topics and techniques, look at sample code. Start with creating your device, then render a triangle, then a cube, then get your cube to rotate. Texture it. Add lights. Learn High Level Shader Language - that's a must! HLSL is awsome but it can be difficult to debug and get working. Learn to use Graphics Diagnostics in VS. Beyond that any advice is going to start getting pretty specific. Good luck.




#5195650 how to create gui buttons with DirectX 11?

Posted by Gavin Williams on 01 December 2014 - 02:04 AM

If you have SpriteBatch available, you can use that ...

            if (srvNormal == null) // then render a simple text button
            {
                // set viewport - sprite batch uses full viewport
                Viewport windowViewport = new Viewport(0, 0, UI.Window.ClientSize.Width, UI.Window.ClientSize.Height);
                UI.Window.Device3D.ImmediateContext.Rasterizer.SetViewport(windowViewport);

                // render background
                if (State == States.Down)
                {
                    UserInterface.SpriteBatch.Begin();
                    SpriteBatchDraw.DrawSolidRectangleAA(new RectangleF(absRegion.X + 2, absRegion.Y + 2, absRegion.Width - 4, absRegion.Height - 4), Color.White);
                    SpriteBatchDraw.DrawSolidRectangleAA(new RectangleF(absRegion.X + 5, absRegion.Y + 5, absRegion.Width - 10, absRegion.Height - 10), Color.Black);
                    UserInterface.SpriteBatch.End();

                     // cost [3949-5037 ticks]
                    RenderTarget renderTarget2D = UI.Window.RenderTarget2d;
                    renderTarget2D.BeginDraw();
                    renderTarget2D.Transform = Matrix.Scaling((absRegion.Width - 4) / (float)absRegion.Width) * Matrix.Translation(2, 2, 0);
                    renderTarget2D.DrawText(Text, TextFormat, new RectangleF(absRegion.X, absRegion.Y, absRegion.Width, absRegion.Height), Brush);
                    renderTarget2D.EndDraw();
                }

If you don't have a SpriteBatch facility, then you're right, you can use screen co-ordinates.




#5195629 I am all prepared to get into game development, how do I start then?

Posted by Gavin Williams on 30 November 2014 - 11:43 PM

 

They only support the respective programming language in their name,

That used to be true, as of.. think its 2013, maybe 2012, either way they changed it. One install for all three languages.

are generally limited in their functionality and not allowed for use in commercial projects

They are almost completely fully featured, there are only a few things that you can't do with express that you can with the paid versions. Also I don't know where you read that but as far as I know you can use them for commercial projects just fine.

As for the OP, I highly recommend Visual studio 2013 express edition(desktop, since I doubt you want to write those silly windows store apps.)

 

 

In regards to your suggestion that store apps are silly, I don't think this is good advice at all to give someone starting today. They will take what you are saying to heart, and it's bad information to be bandying around. WinRT, with which store apps are built with is being lined up as the successor to Win32. As of next year, with the coming of Windows 10, WinRT apps will have equal billing on the desktop by the expansion of their windowing options, ie non-docked / snapped & desktop integration. WinRT is not a silly little toy cooked up to appease the mobile crowd only. Yes, it targets mobile very well, but the WinRT / XAML stack and the language projections provide a powerful system that will be just as effective for desktop application in the next generation of Windows. Arguably, it will be preferable to using traditional technologies as it is fleshed out.

I have worked with WinRT a little, and I completely believe that there will come a time, when it doesn't make sense to use Win32 and the traditional desktop model any more.

And with the availability of Community Edition, I would choose that over express from now on.




#5194523 real time reflections from arbitory surfaces.

Posted by Gavin Williams on 24 November 2014 - 07:36 PM

You need to ask a question please.




#5164924 Exporting non-indexed vertex data from 3DSMAx

Posted by Gavin Williams on 05 July 2014 - 01:33 PM

I think the answer is to write a custom exporter using MAXScript, which I'm trying to do now.




#5150015 limit on the how many bytes that can be passed across shaders

Posted by Gavin Williams on 27 April 2014 - 09:12 PM

Have a look here for the limits:

 

http://msdn.microsoft.com/en-us/library/windows/desktop/ff819065%28v=vs.85%29.aspx

 

So, the register limit looks to be 32 for shader inputs/outputs. You are creating 4x3x3+2 = 38 registers. So even with your a 'fix' for the alignment / padding, you will still be breaching the register limit. You will need another solution.

 

Edit: I agree with spazzarama below. I took a second look at it.




#5149750 ReportLiveObjects() isn't giving me enough information.

Posted by Gavin Williams on 26 April 2014 - 07:17 PM

Ok, so something I have never realized, is that a second (debug) device needs to be created in order to use reporting.

device3DDebug = new DeviceDebug(Device3D);

Then:

device3DDebug.ReportLiveDeviceObjects(ReportingLevel.Detail);

Gives the proper output. Thanks Mona2000

 

Edit: Some useful references

 

http://blogs.msdn.com/b/chuckw/archive/2012/11/30/direct3d-sdk-debug-layer-tricks.aspx

http://seanmiddleditch.com/journal/2014/02/direct3d-11-debug-api-tricks/




#5144921 change 1D addres to 2D addres

Posted by Gavin Williams on 07 April 2014 - 12:14 AM

Do you expect someone to have a faster method ? Do you have a performance issue with this code ?
 

If you are stressing over optimizations with code like this, I'll be surprised if you ever get anything done, really!

Just write your code, there is nothing wrong with your code unless you know there is something wrong. Especially this code, it's about as simple as it gets. There are a couple of ways to do it, but they boil down to the same thing, a few ops, which is totally not worth worrying about.

Come back when you have a function that's taking 10,000 ticks to complete, then we can talk about optimization.




#5127720 AMD's Mantle API

Posted by Gavin Williams on 31 January 2014 - 07:24 AM

Wow, the first I heard of Mantle was seeing an anouncement today that Battlefield 4 supports it as an alternative to DX with the 14.1 beta drivers. Here's a link to the BF4 page with performance comparisions ..

 

http://battlelog.battlefield.com/bf4/news/view/bf4-mantle-live/




#5117530 Collision problem

Posted by Gavin Williams on 17 December 2013 - 04:24 AM

Are you a machine ? You've collided with human beings in a public forum and banged square up against their strange habits of communicating in words.

 

Hello, what is your code and model number. We can exchange code in your native language. What will we make ? Physics, excellent. Do we understand one another ?




#5084178 Test for a range not being covered by a list of ranges.

Posted by Gavin Williams on 08 August 2013 - 11:19 AM

I just want to mention an immensely useful article by Eric Lippert http://blogs.msdn.com/b/ericlippert/archive/tags/shadowcasting/ which helped me get a grasp of the traditional way to compute visibility.




#5081615 Please help me get started

Posted by Gavin Williams on 29 July 2013 - 10:33 PM

Hi GDR,

 

I've sent through the solution, I've included a few details in the email, and removed a couple of things from the project that would cause a crash. If you have any question, just put them up here, as I don't check my email that often.

 

In regards to smooth animation and smooth frame-rate. It's almost impossible to get a consistent frame-rate, so the best strategy is to accept that every frame is going to last a different amount of time and write your physics to accommodate different frame times. As you'll see in my solution I use inter-op in the Clock class to access the performance counter. This gives me the highest accuracy reading of elapsed time over the frame. This is not the only way to measure frame-time but it's the way i do it. I then use that time to scale the velocity. So a short frame will result in a shorter movement over the frame while a longer frame will result in greater movement. So over many frames, you're objects do move smoothly.

 

Gavin




#5081355 Please help me get started

Posted by Gavin Williams on 28 July 2013 - 10:24 PM

Hi GDR.

 

Can i straighten out one point first, WPF can create smooth and continuous motion, no worries. And if all you are creating is a desktop application with not too complex graphics then WPF is perfect for you needs. I can provide you with a small WPF application that generates circles and allows you to drag and throw them around and does collision detection between the objects, although I didn't bother doing wall detection at the time but that's easy, and there are a couple of buttons in the app that don't work. It will certainly show you how to use a continuous time 'heartbeat' to create smooth motion/animation.

 

It sounds to me as though WPF would be more suitable to your needs.

 

Write an email to gavin_w3@yahoo.com.au with GDR in the subject line and I'll fix you up with the solution. Unfortunately when I checked it, it was updated to VS11 so you'll probably need to manually build it again.

 

I am personally using SharpDX at the moment with DirectX 11.1, I have also used SlimDX and XNA in the past. I would not recommend XNA, nor DirectX 9. Those technologies are in support mode and the newer DirectX versions have more features and are more future proof. There is very little reason to use those older technologies when DX 11 is widely available. You have to ask yourself why you need Direct X 9 support and why you would want to use that rather than a more fully featured and more modern library. Why are you considering XP support ? No one has XP anymore. Even if one or two people can pipe up and say 'I use XP' ... it's irrelevant. Just my 2c.






PARTNERS