Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Everything posted by nagromo

  1. I'm writing a fractal explorer using XNA and HLSL (w/ Pixel Shader 3.0). It's working great using 32-bit floats, but I'm running into resolution issues, so I want to move to 64-bit doubles. My card (Radeon 4850) does support 64-bit doubles, and I can define doubles that are initialized to a constant value and do math using them. The problem comes when I want to mix floats with doubles. The inputs to my shader are the texture coordinates in float2 and some float and float2 constants from the application. These inputs are combined to produce the coordinate in fractal space; I need to do this calculation in double precision. Here's the original version (single-precision) that's part of the working shader: [source lang="plain"]float2 c = (texCoord - 0.5) * Zoom * float2(1, Aspect) - pan;[/source] texCoord and pan are float2, and Zoom and Aspect are float. I'm having trouble converting this over to use double-precision; even these basic tests to draw the fractal region from (0,0) to (1,1) don't work: [source lang="plain"]double2 c = texCoord; double2 c = (double2)texCoord; double2 c = double2((double)texCoord.x,(double)texCoord.y);[/source] All three of these lines give the same error: "internal error: 64-bit arg ??? component 1 not aligned" where ??? is any number from 138 to 922. Any advice on how to resolve this? Alternatively, if the vertex shader inputs could be double and the values from the application could also be double, that would remove the need for conversion, but I don't know of any way to force the input to my vertex shader to be passed as a double. (If I re-define texCoord to double, I get the same error with different numbers.)
  2. Also, it looks like in order to save partial results to a texture for smooth performance, I'd have to have a texture as R32G32_UInt and pack/unpack every pixel as it's saved/loaded by the shader. Is there a good way to find out what texture formats are supported by a card without writing all the code and testing it?
  3. Thanks. I'd already run across most of these issues as I've researched this (without realizing that it was SM5 specific). The math operations aren't an issue; I don't even need double-precision division, just scalar and vector multiplication, addition, and subtraction. Is SM5 capable of casting from float to double? I.E. if I re-wrote my application code using SlimDX (not that there is much app code), would I have trouble with my pixel shader taking in single-precision texture coordinates and casting to a double (or mutiplying the float texture coordinates by a double scalar value and getting double results)? This is just a side project I'm doing for fun; most of my coding these days is embedded C on various microcontrollers, so I'm quite out of the loop on modern graphics.
  4. AmzBee, that worked fine too When I added this code: [source lang="java"]float2 a = float2(0.1f, 0.1f); double2 b = double2(a); c = c + float2(b);[/source] I could see that my coordinates were off by (0.1f, 0.1f). However, if I instead do double2 b = double2(texCoord), I get the same error. It seems that even though the doubles appear to work, it is probably converting to float under the hood, and as Nik02 says, doubles are not supported by shader model 3.0. It looks like XNA is built on DX9, so to get a higher shader model (and double precision), I'd need to move away from XNA.
  5. nagromo

    CPU lost some pins :(

    Modern processors have dozens of power and ground pins. If the pins that broke were both power or ground and there were enough other power/ground pins nearby, it will probably work. If they were signal pins, I wouldn't expect it to damage the motherboard, although I don't know enough to say that it definitely won't.
  6. nagromo


    Quote:Original post by d000hg Realistic doesn't have to mean boring though... in real life cars look pretty fun to drive fast. Yeah, even crappy cars can be fun to drive fast; take a look at 24 Hours of Lemons or Chump Car. Both of those would make a pretty crappy video game, but they're incredibly popular in real life. [edit] However, 'realistic' racing games require more car control skills and are more difficult for casual gamers.
  7. Quote:Original post by gretty Quote:Original post by Antheus Have you had a job before? Any kind of job. Thanks for the replies :) Yes I have had jobs :P, but not related to computer programming in any way(Australia Post - postal company - & pizza hut :P) so I think in the eyes of an employer I will be seen as having no career experience. Yes, but no career experience isn't as bad as no work experience, especially as far as internships are concerned. An internship won't expect you to have past jobs that are relevant to the internship, but having (unrelated) past jobs shows that you know how to do a job and have at least some minimum level of responsibility. Employers care about more than your technical knowledge; they also care about your personal and communication skills and ability to work as part of a team. Past jobs can help show that.
  8. nagromo

    Seattle + Snow = Fun

    Quote:Original post by mutex Yeah, winter tires sound like a good idea, but on the other hand snow/ice events like these are relatively rare so buying a set of these tires isn't easily justified. I don't recall any snow/ice at all last year, for example. The cheaper alternative is to just work from home :) If you avoid one accident because of the snow tires, they've more than paid for themselves; even calling a tow-truck to pull you out of the ditch is expensive. Here in Minnesota, we have multiple storms a year that each cause hundreds of accidents; I think the extra traction is more than worth the cost. Most people can't work from home.
  9. Quote:Original post by SteveDeFacto Quote:Original post by ddn3 Sure you won't hear it above 20kHZ but your dog would go crazy and your cat would try to scratch ur eyes out...:) -ddn Actually from what I read I do not believe it needs to pulse at all! I think the reason they are using a pulse is to allow time for the motor to readjust to a new position without leaving a trail. All they really need to do is draw the image instead of trying to create individual pixels. I don't think they realize how useless the noise makes it and they are just going for the most dynamic approach. I think they're using a pulse because of the incredible amount of power required to create plasma. Each pulse is about 1ns long, and they're only doing 100 pulses per second. If they used the same average power but spread it out to continuous, the air would cool itself and never get hot enough to make plasma. If they used the same pulse power but made it continuous, they would be generating 10,000,000 times more heat in the laser, which would burn it out really quickly. Even just pushing it from 100 Hz to 20 kHz would require 200 times more cooling, which would make it much bigger (and also put more stress on the mirrors).
  10. Quote:Original post by Eelco Civilization is the obvious suggestion. Not sure which one id recommend you go with though. Civ5 has the advantage of being able to switch to oldschool 2d graphics, which runs blazingly fast on an i3 without graphics card. However, im not quite sure yet if it is in urgent need of many balance changes, or if I just need to get used to the new gameplay... The same thing happened to me with Civ4. When I first played it, it seemed really strange and broken, but then I got used to the changes from Civ3.
  11. Quote:Original post by SteveDeFacto Actually no they are using a infrared pulse laser that has a frequency of approximately 100Hz: That's the pulse repetition rate, not the laser frequency, which is infrared (over 1 THz). That buzzing sounds like a few hundred Hz, not 100 Hz. You can still hear the harmonics from the pulse edge and decay, anyways; even if you were able to get the pulse rate well over 20 kHz (which will be quite difficult), I expect you would still hear broadband noise/buzz from the decay of the plasma.
  12. Quote:Original post by BeanDog I would never buy a prefabbed desktop machine anymore, I've been burned a few too many times. I'd build it from parts on Newegg. You can build a pretty killer machine for about $1500 that way. $1500?!?! If you already have a good monitor, keyboard, mouse, and speakers, you can get a great machine for $800! Not top of the line, but enough to play Fallout 3 or most recent games at 1920x1200 and high settings. I spent less than $800 at Newegg on June 2009, and I'm quite happy with my machine.
  13. nagromo

    RPG world data

    I really recommend putting your game data in separate data files. One method that I've seen used in some simple games is storing the map in an ASCII file with one row of characters for each row of tiles in the map (I.E. '#' for walls and '.' for open space). That might be a good way to get started and get something working. Some possible ways to store the data are as custom text files, custom binary files, scripts, or XML. Almost any approach will work, although some will be easier to work with. Don't worry about getting the perfect system; just get something working as a prototype then think about how you could have done things differently to improve it.
  14. nagromo

    Say, where's good to visit in the USA?

    Personally, I prefer nature to cities for vacationing. I really enjoyed the scenery in western Montana, and Yellowstone is on my to-do list. Boundary Waters Canoe Area is simply amazing, but it's a lot of work and takes lots of preparation. The forest trails in most Minnesota state parks (such as Itasca) are quite nice, and that's much easier (although less remote) than boundary waters. The Black Hills and Rockies are also beautiful.
  15. nagromo

    Graphics Cards for GNU/Linux

    Yeah; NVidia's binary drivers work great with my laptop, even when I first installed them 4-5 years ago.
  16. One feature I really want to see in an RTS is the ability to zoom with the mouse wheel and zoom out all the way to seeing the entire map at once. Once I got used to this in SupCom, I always wish I had that feature when playing other RTSes that don't have it.
  17. nagromo

    Projectile leading a target

    You know that the projectile's path must lie in the plane defined by the line of the target's motion and the point of the projectile's origin. To approach this, I would transform it into a two-dimensional problem. You have a triangle defined by the target's position, the projectile's position, and the point of intersection of their paths. You know the distance between the target and projectile and the angle of the target's path relative to the projectile's current position. You also know the ratio between the projectile's velocity and the target's velocity. This lends itself very well to using the law of cosines. If a is the distance between the target and projectile, b is the distance between the target and point of intersection, c is the distance between the projectile and point of intersection, and theta is the angle between the vector between projectile and target and the target velocity vector, then: c=b*Pvco/abs(Tvel) b^2*(Pvco/abs(Tvel))^2=a^2+b^2-2ab*cos(theta) b is the only unknown, so you can solve this with a simple quadratic equation. You want the smallest value of b that is still positive; a solution will exist as long as the projectile is faster than the target. cos(theta) is simply the dot product of the normalized velocity vector and the normalized difference between the two positions. Once you know b, the rest of the problem is trivial: t=b/abs(Tvel) Pvel=(Tpos+Tvel*t-Ppos)/t Pdir=norm(Pvel) I just sketched this up quick on pencil and paper; I didn't actually test it.
  18. nagromo

    Intel's "new baby"?

    Quote:Original post by Sneftel Heheheh. No. Utter BS. Beyond the obvious electronic problems with decimal-valued logic, decimal computation would break or weaken a large number of existing data structures and algorithms. Besides which, why bother? The vast majority of the numbers being processed are not to be displayed in decimal form, so it doesn't matter what base they're in. Those few that are, the computer can easily convert to decimal faster than you can read them, so processing speed isn't an issue. As an interesting historical note, however, instructions for operating on binary-coded decimal (4 binary bits for one decimal digit) go back to the earliest days of 8-bit Intel CPUs. Check out the AAA and DAA instructions. They're wacky! It's still used in some embedded systems today. The most common form is BCD, "Binary Coded Decimal". Instead of each byte holding a binary value from 0-255, each nibble (4 bits) holds a binary value from 0-9 (with A-F being unused), so each byte stores a value from 0-99. With slight hardware modifications, addition and subtraction of BCD is just as efficient as binary addition and subtraction. Then, to display the value to something like a 7-segment numeric display, each 4 bits gives you the value of one digit. This is useful when dealing with very low cost, low power systems: when you have less than 1k instructions and less than 64 bytes of RAM, the math needed to convert binary to decimal is pretty difficult, so it's easier to just work in BCD. This certainly isn't new or useful to modern processors, though.
  19. nagromo

    edu(cational) versions

    It varies from application to application. For example, with Pro-E, the save format is incompatible between the educational and non-educational versions. Some FEA software has much lower limits on part complexity for the educational version.
  20. Quote:Original post by cutthepeace I've graduated as an EE with a focus on the analog and RF side and right now I can find a ton of jobs in my area of study. The catch: everyone is looking for engineers with >10 years experience and rarely will an entry-level position appear. Do you want to do software or do you want to do analog and RF? Getting a job in software will not help you find an analog/RF job later; in fact, it could hurt your chances. You will have more experience, so you will be worth more money, but you will not have experience that is relevant to an analog/RF job. If you enjoyed your focus of software/RF, don't give up on that so easily. Employers post listings for the positions that they are having trouble filling. Many companies want to find experienced analog/RF engineers, but there are not enough applicants. If you keep looking, you should find a company that will accept you despite your inexperience. Then, once you have experience, you will be able to find jobs more easily and get better pay with your in-demand specialty. I just graduated with an EE degree, and I knew I wanted to do a job involving embedded hardware design, not just software. At job fairs, I learned what each position involved and only investigated further into the positions that involved my interests. I focused on a small fraction of the companies at job fairs, and I ended up with a position that I'm happy with. I think job fairs are a great place to look for jobs. See when your college holds them and if you can still attend as a recent graduate. Also, have you done any projects related to your specialty or done any relevant internships? I designed embedded systems for my school's solar car team, and I think that helped me both to get my position and to do well once I started working.
  21. nagromo

    Corporate Supremacists Victorious

    Quote:Original post by daviangel You only knew this was bound to happen... Corporation Says It Will Run for Congress It looks like it's a real company, too. And I think that music is from Oblivion. [Edited by - nagromo on February 4, 2010 7:08:12 PM]
  22. nagromo

    Age to be introduced to programming

    I started programming when I was about 10 or 11, although I didn't do all that much at first. For most programming, the only math you need is basic algebra and logical thinking. You learn that through practice and repetition, and programming is a good way to develop those skills. Honestly, I think that someone who starts at a younger age will end up as a better programmer than someone who started as an adult.
  23. nagromo

    Managing multiple domains & billing

    I've heard anecdotes that DreamHost will just shut you down if you're using too much resources without any warning first. It makes sense to do it that way to protect the sites of other users who are sharing a server with you. I don't have any proof; just what I've heard on forums over the past few years. As for recurring billing, I think you should let them know that you're including x years of keeping the site online in your price and they'll have to pay more when the time is up.
  24. nagromo

    Shader Evolver: Source or Decompile

    'Decompiling' won't give you the original source code. The most common form is disassembling, which gives you assembly code. If the original code was written in something like Java or C#, you might be able to find a better decompiler, but if it was in something like C++, you probably won't get something straightforward enough to be more useful than the disassembly.
  25. Quote:Original post by terra0nova ... If you are drawing a lot of things on top of the background, try rendering the scene first with depth 0, and then drawing the background as a quad with depth 1 and the depth test enabled. This way, any pixels where there was something on top of the background will fail the depth test and will not need to be drawn, which could improve performance if not much of the background is visible. If your foreground objects have transparency, this will cause incorrect rendering wherever the foreground has transparency. Also, OP: What does it mean when the background has transparency? What do you want to show up behind it? The previous frame? A black buffer? Random garbage? If you want the previous frame, be aware that some video card drivers will use single, double, or triple buffering regardless of what your application asks for. That means that there'll be a variable delay.
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!