Advertisement Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

127 Neutral

About JoshG

  • Rank
  1. Hmm, thats an interesting thought, though I don't think the front buffer has a surface associated with it... so what value of 'surface' would I use?
  2. Hi All, I am currently attempting to create an application that duplicates the contents of one window and displays it in another window at a smaller resolution. What I currently have is the following: (in pseudo code) captureSwapChain = WindowToCaptureSwapChain captureSurface = SystemMemory_Surface displayTexture = DeviceMemory_Texture captureSwapChain.GetFrontBufferData(captureSurface); LoadSurfaceFromSurface(displayTexture.GetSurfaceLevel(0), captureSurface); RenderSprite(displayTexture, size); Now, the above technique works, and does what I need. But it requires a Device Memory -> System memory -> Device Memory copy. Ideally, I would like to optimise the technique into just a DeviceMemory -> DeviceMemory technique but I can't seem to find the correct API to get this to happen. NOTE: I do not have any control over the applications that I am duplicating. I just want to duplicate their visuals. Does anyone have any other ideas? Cheers Josh
  3. Yeah, the stencil buffer option would work, Your hint on what to set the projected position to is spot on, I had set it to 1, but the w component was not 1. I ended up doing the following: ProjectedPosition = ProjectedPosition.xyww; which places it on the very far plane... But it sometimes slips through the far plane, so I imagine I can just adjust the z value of that projected position by a tiny bit to make sure it is always in front. Thanks guys
  4. Fair enough, Is there a straight forward way of getting the Far distance? ie. I know you can get the camera position from the ViewInverse matrix's 3rd row. Is there a similar way to get the far distance? I assume it would be in the Projection matrix somewhere... Thanks again
  5. Hi All, I'm in the process of writing a skybox shader at the moment and want make the geometry always appear to be the farthest it could possibly be away from the camera without being clipped. The idea would then be that the depth test function would test for an equal value and only paint if the value is equal to that currently in the buffer (ie. nothing has been drawn on that pixel yet). I do realise this would not work with objects that do not write to the depth buffer. Currently I am drawing the skybox as the first thing in the scene with depth writing off (so it draws a background). Then the rest of the scene draws over it. But idealy, I would like to turn this behaviour around and draw the skybox after the main scene geometry. I assume I would be able to do this by projecting the geometry of my object onto the far plane. I would probably do this by adjusting the Z value of the POSITION output of the shader... but the question is, what value should I set it to? Any suggestions and comments are welcome
  6. Thanks Kauna! I needed a sanity check on that code it's been driving me nuts for a while now. The problem I was having with it was when rendering a plane, only part of one side of the cube was ever being shown, and I could not get it to display anything other than the Negative X face... I was beginning to think I would need multiple samplers in order to do this, but I think I've figured out that the UV coordinates I've been using are wrong... We'll see! Its a shame there isn't an easy way to "debug" shaders! hehe Also, what do you mean about saving on the setup of components? Thanks for your response!
  7. Hi all, I've been playing around with the FX Composer 2.0 program lately and have found myself attempting to make some pixel shaders, though I'm finding it difficult to understand cube maps enough to get them to work the way I expect them to. The way I understand it is that a cubemap is made up of a cube with textures on each face. Then when sampling, I simply tell the shader the direction I wish to get the texel of with respect to the origin. Seems simple enough... Ok, so say I get 6 textures and put them together to make a cube map. I would now like to sample each of those 6 textures in the cube map within the pixel shader. So far, I'm attempting to bring out only one face of the cube map and use it to texture a plane. I've been trying to do this by using old style U,V coordinates to specify the "X/Y" on a particular face, then I use the overall direction of the vector to select the face I want to sample... The code I've been using looks like this: texture cubetex < string type = "CUBE"; string name = ""; >; samplerCUBE sampler = sampler_state { Texture = (cubetex); MAGFILTER = LINEAR; MINFILTER = ANISOTROPIC; MIPFILTER = LINEAR; }; void PS(in vertexOutput IN, out float4 OUT : COLOR) { float3 cubeProj = float3( (IN.UV.x), (IN.UV.y), 1.0 ); float4 blend = texCUBE(sampler, cubeProj); OUT.rgb =; } Note: I realise the above isn't complete, but it highlights what i'm trying to do... Can someone please tell me what i'm doing wrong? And/Or if this is even possible?
  8. JoshG

    Game loader design

    Hey! I've wondered about how to do this too. Why bother with the .exe and the .dll though, you'll have to do a delete anyway if the launcher gets updated, so you may as well keep them in the one exe
  9. JoshG

    [C++, Lua] Entity Logic

    Heya Silvo, I went through the same thing last year. My current method is for each entity, I hold a reference to a lua table. that table uses a metatable based upon the type of entity it, upgrade etc. (The metatable is being assigned using luabind) When I load a script for the entity, I change the lua environment to the entity's table, this way all the functions for the entity are loaded into it's own personal table. That way they don't interfer with global functions etc, and I can still access any global variables that I might need. Hope this helps a little, It's a little confusing if you havn't used luabind before... --Josh
  10. JoshG


    ROFL! Thats It, I'm subscribing! :P Hehe, cool idea, 3D Environment forums... I like where you're going
  11. Well, assuming it wasn't a large job ahead, I'd be going for a SWITCH statement! wooO! something like this would do the trick: enum{ BLOCK_ENEMY = 'x', BLOCK_WALL = 'W' }; char blocktype = fgetc(); switch(blockType){ case BLOCK_ENEMY: break; case BLOCK_WALL: break; //You know, your normal switch statement ;) }
  12. Yeah, did some backtraceing, found the issue, I had to #define BOOST_THREAD_BUILD_LIB inside my own version of the library as it did not automatically realise that it was building a library And I had to #define BOOST_THREAD_NO_LIB in the application linking to it. Thanks for the replies all, appreciate your interest petrie! --Josh
  13. Yeah, I'm trying to do the "Latter" I DON'T want to use boost's automatic linking I've created the following file: BoostThread.h #define BOOST_THREAD_NO_LIB #include "boost/thread.hpp" typedef boost::thread BoostThread; typedef boost::thread_group ThreadGroup; typedef boost::recursive_mutex RecursiveMutex; typedef RecursiveMutex::scoped_lock ScopedLock; typedef boost::condition Condition; and that is what I'm using to include any reference to boost::threads... But as showed before it still gives out that linking error to the file i don't want it to link to... I can't even find the mechanism its using to do the automatic linking to disable it! I've also tried: #define BOOST_THREADS_NO_LIB just incase that might work, but no luck either ---------------------------------- In response to the other replies above, Sorry i didn't make it clear before, I wish to SUPPRESS the automatic linking of the boost library, so i can provide the functions in my own way. And thanks for the link BuBu, that made me realise that the site that google is reporting "" is the site that is down, "" seems to be fine
  14. Hi Team! I'm using Boost::threads, I've created a staticly linked lib project in VC7.1, and now i am looking to link it into my main application, but the application fails to link completely because of some form of annoying automatic linking mechanism. I get this error: fatal error LNK1104: cannot open file 'libboost_thread-vc71-mt-sgd-1_33_1.lib' Any ideas how i can link this using my library (I don't like they way boost does it's linking, I need to use my own MSVC project for the linking) Thanks All! --Josh P.S. I realise should have the information i need, but it is currently down at the moment, and I'm trying to get this done asap. Any hints would be appreciated, even if you arn't 100% sure about the details! thanks! [Edited by - JoshG on October 18, 2006 7:52:58 AM]
  15. Best tutes around are at: Has a tone of tutes showing you how different transformations work, Then once you're happy with the OGL code and playing with some of the transformations, the "OGL Redbook" is the next place to go looking, this has descriptions of every core OGL function, so you know what you can experiment with, then it's a matter of reading Gamasutra and Gamedev articles (under resources) and looking for effects you are interested in! Have fun! -- Josh
  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!