gharen2

Members
  • Content count

    687
  • Joined

  • Last visited

Community Reputation

520 Good

About gharen2

  • Rank
    Advanced Member
  1. Wankers

    Why are you guys still feeding this troll?
  2. DX11 [SlimDX] D3D11 From D3D9

    Regarding camera controls: You apply matrices to your shader with code along the lines of DXEffect.GetVariableByName(name).AsMatrix().SetMatrix(someMatrix); . In your shader code, you have a matrix defined with a certain name, and that applies the value you want to it. I can't really go into a lot more detail, it sounds as if you really need to look up some tutorials. Shaders are somewhat complicated to get into at first, but god, I love them. The fine degree of control they give over everything is amazing. Regarding your comment about Device.ImmediateContext.Rasterizer.State, I haven't used Direct3D11 yet so can't help you with that one. The API of Direct3D10 and 11 are pretty much identical, but 11 lacks some high level features I don't feel like implementing, and I don't have a directx 11 capable video card anyways. Here's my recommendation: check out XNA if you haven't already. It sounds right up your alley. It has the simpler .net-esque api you want and is a LOT quicker to get into. It still requires that you use shaders, but it provides a basic one with lighting effects and such, so you won't need to worry about learning much about them right away. I avoid XNA nowadays because I always feel it's forcing me into a particular design paradigm and I prefer having a finer degree of control, but these are personal preferences and I otherwise highly recommend it.
  3. DX11 [SlimDX] D3D11 From D3D9

    1) The most important difference to know is that Direct3D 10 and 11 lack the fixed function pipeline. That means that many things that were previously done for you have to be done in shaders. You've encountered the first example of this: you have to pass the matrices to your shaders. 2) Another difference is that states are now set in bunches. So for example, you set all of the rasterizer states at once with Device.Rasterizer.State. Lighting is another fixed function pipeline feature that you need to implement in shaders 3) Look up InputElement. I'm working with Direc3D 10 for the first time, and I love it. However, you're going to find SlimDX documentation and samples for it limited. Fortunately, it's not so bad because the SlimDX api is deliberately close to the native API, so it's trivial to look at c++ code.
  4. SlimDX, DirectX 10 sprite woes.

    Thanks, I can't believe I didn't think to try that. Interestingly enough, the sprite is visible if I use Matrix.OrthoLH instead of OrthoOffCenterLH. Why, I'm not sure. And even though the sprite is visible, the behavior doesn't match what I read in tutorials (specifically the sprite section of Beginning DirectX 10 Game Programming). For example, with the projection matrix set to OrthoLH(800, 600, -1, 1), the viewport set to (0,0,800,600, 0,1) and the transformation matrix set to (Matrix.Scaling(100, 100, 1) * Matrix.Translation(400, 300, 0)), the sprite should appear in the middle of the screen, but appears at the extreme upper right. The size of the sprite seems correct, while the position is not. Time for further experimentation. edit: using Matrix.OrthoOffCenterLH(0, 800, -600, 0, -10, 10); produces working results. The origin is the upper left, and the sprite moves down by decreasing Y in the world transformation, and moves left by increasing X. This works fine, but doesn't match the behavior I expected from my readings. Oh well, it works.
  5. SlimDX, DirectX 10 sprite woes.

    Bumped for going onto the second page without even getting a view...
  6. I'm fairly familiar with graphics programming, but am trying out directx 10 for the first time and can't figure this one out. I just can't get a sprite to be visible. I've compared my code to countless tutorials and snippets. I've fiddled with the projection and world matrices to no end. Using the debug runtimes gives the warning "[1032] D3D10: WARNING: ID3D10Buffer::SetPrivateData: Existing private data of same name with different size found! [ STATE_SETTING WARNING #55: SETPRIVATEDATA_CHANGINGPARAMS ]" when the sprite object is created, but from what google has shown me this warning seems to be pretty common when the sprite is created and rendering still works. I have the feeling I'm missing something really obvious. If anyone can spot what I'm missing I'd greatly appreciate it. PS: Yes I understand the evil that is Application.DoEvents. [code] using System; using System.Drawing; using System.Windows.Forms; using SlimDX; using SlimDX.Direct3D10; using SlimDX.DXGI; using Device = SlimDX.Direct3D10.Device; namespace SpriteTest { class Program { static void Main(string[] args) { var form = new Form(); form.ClientSize = new Size(800, 600); form.Show(); var swapChainDescription = new SwapChainDescription() { BufferCount = 1, ModeDescription = new ModeDescription(800, 600, new Rational(60, 1), Format.R8G8B8A8_UNorm), IsWindowed = true, OutputHandle = form.Handle, SampleDescription = new SampleDescription(1, 0), SwapEffect = SwapEffect.Discard, Usage = Usage.RenderTargetOutput }; Device device; SwapChain swapChain; Device.CreateWithSwapChain(null, DriverType.Hardware, DeviceCreationFlags.None, swapChainDescription, out device, out swapChain); var backBuffer = SlimDX.Direct3D10.Texture2D.FromSwapChain<SlimDX.Direct3D10.Texture2D>(swapChain, 0); var renderTarget = new RenderTargetView(device, backBuffer); backBuffer.Dispose(); device.OutputMerger.SetTargets(renderTarget); device.Rasterizer.SetViewports(new Viewport(0, 0, 800, 600, 0, 1)); var textureView = ShaderResourceView.FromFile(device, "testtexture.jpg"); var sprite = new Sprite(device, 100); sprite.ProjectionTransform = Matrix.OrthoOffCenterLH(0, 800, 600, 0, 0, 100); var spriteInstance = new SpriteInstance(textureView, Vector2.Zero, new Vector2(1, 1)); spriteInstance.TextureIndex = 0; spriteInstance.Color = new Color4(1, 1, 1, 1); spriteInstance.Transform = (Matrix.Scaling(100, 100, 1) * Matrix.Translation(100, 100, 10)); var spriteInstances = new SpriteInstance[1]; spriteInstances[0] = spriteInstance; while (form.Created) { device.ClearRenderTargetView(renderTarget, Color.Red); sprite.Begin(SpriteFlags.GroupByTexture); sprite.DrawBuffered(spriteInstances); sprite.Flush(); sprite.End(); swapChain.Present(0, PresentFlags.None); Application.DoEvents(); } sprite.Dispose(); textureView.Dispose(); renderTarget.Dispose(); swapChain.Dispose(); device.Dispose(); } } } [/code]
  7. C++ C# interop

    [quote name='csisy' timestamp='1298044969' post='4775931'] Hi Is there any SIMPLE way to use my c++ engine in c# (winforms)? I don't wanna rewrite my engine. Instead of lots of c++ work, i rewrite it in c#... So I'm looking for the simplest solution. Now, i use lib, but if it is necessery, i can use dll, like this: class __declspec(dllexport) Sprite : public GameComponent Thanks [/quote] No, there isn't a simple way to do it. If you're working with windows alone, c++/clr is probably the easiest way to go. If you're working with linux, you need to wrap it in a c glue library and create bindings to it in c#. Both of these are time consuming, but that's the price you pay when trying to interop radically different languages. There are utilities to create a glue library, though I'm a bit behind the times and couldn't recommend a current one (I haven't used anything but c# in a looooong time). Last time I did this. SWIG was the way to go, but it was still tedious and error prone.
  8. C# physics engines for mono?

    Check out Physics2D.net. I don't know for a fact that it works under mono, but from what I remember it doesn't do anything magical that mono wouldn't be able to handle.
  9. Huge 'Warbots Online' Update / Lots of new stuff..

    Very, very sexy work. One bit of constructive criticism though: the siege machine looks way too much like the jawa sand crawlers from star wars.
  10. Beautifull as always! The only constructive criticism I can get is that in some of the distance shots, the contrast between the low detail terrain, and the sharp, detailed environment objects like buildings and wind turbines is quite jarring. In those shots the objects don't look like a natural part of the scene, they stick out too much (if that makes any sense at all).
  11. Online Dating

    I've occasionally thought of trying online dating. Why? Because I'm very mellow and overly nice, which despite what most women say, is not what most women want. Instead I seem to give off an aura that only draw crazy and/or annoying bitches. Usually women who've been mistreated by men in the past, and who see me as safe. I sympathise with women in that position, but they're always terrible for playing mind games and being extremely insecure about themselves and our relationship. Those are both MASSIVE turn offs for me. So why haven't I tried online dating? I'm TERRIBLE at small talk, so have a hard time going out with someone I just recently met. And a great fear that the service will be populated by the kind of women I just described (which probably isn't true).
  12. QQ: Why do so many people play the race card?

    Quote:Original post by Dex Jackson Quote:Original post by Hodgman Wikipedia informs me: Quote:Since fried chicken could keep for several days, longer than other preparations, and traveled well in hot weather before refrigeration was commonplace, it gained further favor in the periods of American history when segregation closed off most restaurants to the black population. It's a lot simpler than that. A LOT SIMPLER. You wanna know what it is? My understanding from talking to american friends is that in some areas.... they really do eat a lot of fried chicken. But that in those same areas, the white people do too (hint: deep south). I like that notion that the stereotype applying only to blacks originated in segregation days, due to deep fried foods ease of preparation and storage. Sounds reasonable, and it wouldn't be the first stereotype I've encountered that had a hint of truth to it.
  13. QQ: Why do so many people play the race card?

    Quote:Original post by Sneftel FWIW, I don't think you're racist... just hilariously ignorant. This is very true, I've known plenty of people who I didn't consider truly racist because I consider racism to have an element of hate. But I have met people with some pretty ignorant misconceptions The "all black people eat fried chicken" kind of racism, versus the "I'm afraid of you and/or won't give you a job because you're black" kind of racism.
  14. QQ: Why do so many people play the race card?

    It depends on how much racial tension there is in the area you live. Where I live, race issues come up very infrequently. If I lived in say, Alabama, I might have a different response. edit - I just read your post, Dex Jackson, and I don't consider that "playing the racist card". You were expressing racist attitudes, and he rightfully responded as such. To me, playing the racist card would be if I refused to hire someone of a minority simply because they weren't qualified, and was then accused of racism.
  15. Duke Nukem For-never

    This registers pretty low on my care-o-meter. It's just nostalgia that made people look forward to it. I fully expected that if it got released, it was probably going to be yet another generic shooter, that happened to have strippers. And while having strippers in a game was scandalous in the 90s, it's no more scandalous than what I see in any number of games I play today. Duke nukum had a lot that set it apart back then, but what would have set it apart today?