Steven Hansen

Members
  • Content count

    158
  • Joined

  • Last visited

Community Reputation

240 Neutral

About Steven Hansen

  • Rank
    Member
  1. Did I really get this girl pregnant? You tell me

    It looks as though the pictures were taken by a colleague for the purpose of bothering her - not for the purpose of showing you that she is pregnant. As such, it makes it more likely that she is earnestly pregnant. What you should do next depends greatly on your moral compass. Every time I learn that a baby is going to be born to a single parent, I am reminded that although we generally have the freedom to do what we want, the consequences can last a lifetime. If she is truly pregnant (likely), and you are the father (possible), then you are likely to have a child with whom you have very little relationship for his/her entire life. Maybe you can take steps to change that if you are careful. It is certainly amazing how a few quick moments can change a life forever. Best of luck!
  2. The brain is weird

    The purpose for the sixes, and saying them so many times was (in my opinion) trying to get your brain so focused on one thing (something different than vegetables) and moving quickly enough that when asked for a vegetable, you spit out the one you have most experience with - without the intermingling of trying to beat the system or randomly selecting from a group of vegetables. For those who got something different, you are more familiar with that particular vegetable than you are a carrot, or you followed the instructions incorrectly (spent too much time thinking about various vegetables or landed on a non-vegetable response), or your brain doesn't function the way most people's brains function. I think the exercise was supposed to be enlightening into the way the brain generally works. The brain is a tool, just like your senses and your feelings. It is useful to understand how each works, and how it is possible that each may mislead you. When in a rapidly moving situation, it is often easiest for our brain to supply answers that are generally common and mainstream. The lesson we could take from it (if anyone cares) is that if we want original and insightful replies, a high-energy fast paced brainstorming session might not be the right path. If you learn how your brain works, you can use it more effectively. It is interesting how when asked for certain information, the brain can be tricked - in common situations - into giving incorrect answers.
  3. DirectShow in Fullscreen Unreliability! HELP!

    Your description of the problem is lacking in a great number of details. What do you mean by fullscreen? Generally, using any movie API to display a movie while running a DirectX app in fullscreen will cause problems. The reason is that the video card employs a pointer exchange algorithm to swap pages quickly. Usually you are rendering to one buffer while another is being presented onscreen. Unfortunately, the movie API is oblivious to what is happening with the swapping and attempts to render the movie to whichever video buffer it has information about - the same buffer that is no longer being displayed because the video buffers were swapped. So, if when you say fullscreen you mean you are rendering inside a directx application, then you need to get the movie API and the graphics API to play nice together. There are a bunch of ways to do this... IF this is your problem. However, the explanations can be lengthy, and are pointless if your problem lies elsewhere. Please clarify. [smile]
  4. I'm going to clarify the above post a bit. [smile] You are using DirectX, so you already should know that if you are drawing screen aligned quads you need to add half the texel width/height to the corners of your uv coords. These are computed thusly: texel width = 1.0 / horizontal resolution texel height = 1.0 / vertical resolution Variations of this information allow you to align your quads and make pixel calculations based on uv row/column information. The shader version needs to be high enough to allow the calculation. Typically 2.0 is required for uv manipulation in the pixel shader. The frac command used below requires ps 2.0. Other methods probably exist. So, we twist the information into something that is more immediately helpful to avoid division in the shader. dx is just 0.5 / texel width. Send dx and dy into the shader. Stated more directly: dx = texture horizontal resolution / 2 dy = texture vertical resolution / 2 Multiply your uv coordinates in the shader by (dx, dy). You can then use frac(dx) and frac(dy) to determine whether the pixel is even or odd. Assuming correct alignment, odd = ~0.5 and even = ~0. Even if your quad isn't aligned, you can arbitrarily decide that < 0.5 is odd and >= 0.5 is even (or vice versa).
  5. How does win32 draw wallpaper?

    That was a great link. I think I'll be able to use that "Draw to the Desktop" example to do what I want in code. Thanks!
  6. MRT how to distinguish HLSL output?

    You know. That makes perfect sense. I should have thought of it! [smile] Thanks!
  7. Ok, I hope this is an easy one. Given multiple render targets, how do you write to them via the pixel shader. Typical shader is something like: float4 PS(float2 tex : TEXCOORD0) { return tex2D(someSampler, tex); } That's just one output. What if I have four different colors and want them to go to four different targets? How do I specify that? Many thanks!
  8. How does win32 draw wallpaper?

    Hmm... That active web page may solve the problem locally. I would still like to intercept the code that draws the wallpaper though. There are all kinds of interesting ideas for cool animated wallpapers. [smile] Thanks for the link.
  9. How does win32 draw wallpaper?

    Quote:Original post by b2b3 Desktop has window handle 0. You can use GetDC function to obtain handle to its device context and draw to it as usual. Of course you will need to watch for messages and repaint if necessary. Which messages are the critical ones for the wallpaper? I am also concerned about drawing over desktop icons (which would be a no-no). Quote:Original post by Shannon Barber Cram the two wall-papers together into 1 bitmap and set it as the background. This doesn't work for multi-monitor with different resoultions and dynamic layout, though it does seem to be the most popular answer generally given. Quote:Original post by Anonymous Poster Why not just use the multi-monitor api calls to find the rects for the given monitors and then plop a bottom-most window at said locations. I had considered this for a while, and it *is* part of my plan to grab the window rectangles, but simply laying windows over the desktop introduces numerous problems. First, it covers up desktop icons. Second, many programs grab the desktop window handle for layering their windows - expecting the desktop window will be typically visible - but this approach would cover up the screen. Quote:Original post by Anonymous Poster This might help, Introduction to Display Drivers, maybe the link to the CUJ article too. Thanks for the link, this will take a while to digest, and it isn't immediately clear if I'll be able to use this information to accomplish my goal, but it looks very interesting anyway. Thanks to all who have responded so far! Rating+ for the help.
  10. So - I have dual monitors, and want different wallpaper for each. I don't need any of the hokey extras that typical multi-monitor management systems sport, just 2 different wallpapers (size and settings) on 2 different monitors. The million dollar question: how can I do this in code? One idea I had was to somehow hook into the process that windows uses to draw wallpaper, but I can't find where to make that connection. At this point I'm really not interested in a 3rd party tool that does this, I want to code it myself - I just need a starting point (win32 hook, etc). Thanks!
  11. Dramatic memory leak in DrawText

    You might try searching the following forum. It is generally for industry professionals, and they don't welcome casual banter, but there is a good bit of core information there. Plus, the actual DirectX development team participates on the forum. DirectXDev
  12. Quote:Original post by jamesw The only cards that don't have D3DPTEXTURECAPS_POW2 set to true are the geforce 6/7's. Does this mean that ATI cards only support power of 2 textures? This particular flag by itself isn't that meaningful. The other flag of interest is D3DPTEXTURECAPS_NONPOW2CONDITIONAL. If the pow2 is NOT set but the nonpow2 flag IS set, then you are under typical restrictions: you can use non pow2 textures, but can't use tile/repeat/mirror/border ... only D3DTA_CLAMP. I've noticed that any other combination of flags between the two can be substantially misleading. If in doubt, try it out! [smile] To further confuse the issue, there is also the D3DPTEXTURECAPS_SQUAREONLY flag. All-in-all, it is usually safe to assume that if the card is fairly new (Geforce 4000+ or Radeon 8500+) then it will support non-square, non-pow2 - with the caveat that you use D3DTA_CLAMP.
  13. Quote:Original post by devronious My problem with creating a rendertarget that is as big as that is that when I pixel shade it it has to go thru the entire target area since it's per pixel shading. It get's real slow with large targets. So I'm thinking, there's something I don't know about this isn't there? I must be doing something wrong. The shader only runs on source pixels. You don't have to write to the entire destination if you don't want to (drawing a 1024x768 quad to the upper part of a 1024x1024 destination only processes the upper 1024x768). For post processing, I usually create two identically sized render targets of the desired size (any size will do, and mine are often 800x600 or 1024x768) and then ping pong back and forth from one texture to the next using the shaders. Generally post processing is expensive enough that it requires a pretty good video card anyway. You can always use smaller ping-pong targets, but you will lose quality - although loss of quality may not matter as much in the case of certain bloom or blur effects.
  14. The big limit with pow 2 textures is with older video cards, or if you want mirroring, border color, or texture wrapping. As long as you use clamp and a reasonable card, you can make the target whatever dimensions you like.
  15. I saw The Chronicles of Narnia - I wish I had 5...

    I liked the movie. The music was cool and the effects were awesome. Susan and Peter both took a bit of getting used to, but I thought the portrayal of their growth was nicely done (though much more extreme than the book). Thumbs up from me. Oh... and I am so glad that "no tengo 5" (I don't have 5). Who would want to be 5 again? <shudder>