Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

362 Neutral

About D_Tr

  • Rank

Personal Information

  • Interests
  1. D_Tr

    Reading Binary: L-to-R or R-to-L?

    I cannot remember having seen a binary number written starting with the most significant bit on the right. We are used to reading numbers starting from left with the most significant digit, so I find it more convenient to read binary numbers the same way. As for the machine, it has no concept of left and right. The only thing the machine "knows" is which wire carries a bit with a given significance. The wires in an integrated circuit carrying a number might even be layed out in a messy way in some cases.
  2. Floating point hardware is just inevitable in todays GPUs which offer such a great degree of programmability. The transistor budget is there and it is seems imposible to me to make robust physics simulations or generally sophisticated shaders with integer hardware, without important limitations. To overcome these limitations, one would find himself inventing hacks trying to approach floating point behaviour, and would end up with slower and less robust code. Suddenly floating point hardware would seem like a no brainer...
  3. D_Tr

    Moores Law

    It seems that everything will continue normally for at least 8 years, since 5 nm is on Intel's roadmap. It's hard to imagine anything much smaller than 5 nm being possible with technologies whose core component is photolithography... IBM has been doing research on stacking multiple die and interconnecting them vertically by thousands of interconnects per square millimeter, with special cooling micro-channels taking care of the generated heat. With such an approach it might be possible to keep increasing the computational capability and probably also drive costs down by not replacing the manufacturing equipment as often. Meanwhile, there is research in nanoelectronics, namely in methods to include trillions of transistors in a single chip. This paper (http://www.ee.washington.edu/faculty/hauck/publications/NanoSurvey.pdf) suggests that these trillions of devices will probably have to have a regular layout on the chip and that a large number of defective devices per chip will be the norm, so a method will be necessary to avoid using these defective devices. Bacterius mentioned architectural and algorithmic improvements. True, a good choice of algorithm may make a program execute thousands of times faster, and the choice of the correct architecture might speed a programm up x times, but currently we have the luxury of BOTH architectural/algorithmic improvements and a nice 2x speedup every 20-24 months. If manufacturing technology had stopped evolving in 2007, we still wouldn't be able to play Crysis 1 on a cheap gaming PC!
  4. Quick intuition-based solution (which may be wrong): If you had a circle with radius a, then for a point (x, y) on the circle, the normal vector would be just (x, y) right? (divided by the length of (x, y) to get unit vector). If you compress the circle in the y direction by a factor b/a to get your elipse, i guess that the normal vector would become (x, y*(a/b)). Correct? >.< ( Rationale: I am saying this because in order for the normal vector to the circle to stay normal to the ellipse as the circle is compressed, you need to stretch the vector in the y direction as the circle is compressed in the y direction)
  5. I added a link to my previous post to a page that describes the instruction and the corresponding intrinsic. The intrinsic according to the linked-to page is this: __m128i _mm_slli_si128 ( __m128i a, int imm) The immediate value represents the number of bytes you want to shift the register by. I think intrinsics are the same accross all major compilers. EDIT: You can also have a look at the movelhps instruction. It can save you an move instruction since it takes 2 register operands unlike psllqd and you do not need to copy the register before performing the instruction. As I have thought it in assembly it should look like this: movaps xmm0, [X] mulps xmm0, [Y] movlhps xmm1, xmm0 addps xmm0, xmm1 movaps xmm1, xmm0 pslldq xmm1, 4 addps xmm0, xmm1 Still, it is 7 instructions long...
  6. Your heavy use of shufps is probably slowing you down a lot, especially if you have an Intel CPU older than Penryn. (Penryn introduced the "Super Shuffle Engine" which made shuffles faster). I think you can replace the shuffles with shifts and get better results. Try the pslldq instruction. You can shift the register left by 4 bytes and add it to its non-shifted self and then shift the result left by 8 bytes and add it to its non shifted version. This way you get the sum of the 4 elements on the leftmost 32 bits.
  7. D_Tr

    Your most memorable childhood game?

    I haven't played hundreds of games like other more seasoned gamers have and I still find it very hard to write just one game. But so be it! Little Big Adventure 2 is a game that I have strong emotions about. I was last year elementary school when I played it (11 years old). I had played a demo of the game and after a few days went to a retail store to buy it.. I was VERY disappointed when the guy at the store told me that the full game would be heavier than the demo and would not run well with 8 megs of RAM. Fortunately I went ahead and bought it and it actually ran fine! A truly unique game set in a strange and colorful world filled with adventure! The game's music is also great. Plenty of youtube videos if you want to take a look!
  8. D_Tr

    Understanding 'Classes'

    Yes, you are close and it will all become clear when you write some programs on your own. Another advantage is that the data can (and in most cases should be) hidden (using 'private' or 'protected') so you can change the internals of the class without affecting the code that is using the class. A beginner book should explain all this, btw. Maybe it is not a book for beginners and assumes familiarity with the concepts of Object Oriented Programming...
  9. D_Tr

    Understanding 'Classes'

    The Point example should give you some clear hints on other classes you might want to write in the future. For example if you want to work with matrices you will want to make a Matrix class. You will realize that it is far easier, more intuitive and more error-proof to work with objects of type "Matrix" than working directly with 2-dimensional arrays. A "Player" class would be another simple example. It is preferable to have your data grouped in an object and manipulate it as a whole than having a sea of variables like a string for the name, an int for the health, an array for the inventory etc... Generally, you will want to create a new class every time you decide that you need a new, custom data-type. For more complex stuff classes are even more desirable. Did this help?
  10. D_Tr

    Equation of a Square?

    Am I the first to have noticed that the thread is from 2007? Because normally someone would have mentioned this!
  11. D_Tr

    STL, yay or nay?

    One thing is for sure: your first (and second and third) game engine won't be bottlenecked by the STL in any way. Plus, you also get to save time in order to devote more time into the actual game engine code.
  12. D_Tr

    Am I on the "Fast-track" for development?

    I am surely not a "grizzled veteran", but what I have to say is that when you become ready, you won't have to ask, you will know it! For the moment just keep studying and practising!
  13. Hi, I have an assignment and a subproblem of one of the problems is about solving a differential equation using the Laplace transform. The problem is it is nonlinear and so when applying the transform, I end up with both F(s) and the integral of F(s) in the same equation, so I cannot isolate F(s). I have already solved it using another technique (this was the objective of the previous subproblem). My question is: Is this possible at all? Could this be an oversight on their part? You can see the form of the equation below. Only Y and t are variables. dY/dt + (a/(b+a*t) + c)*Y = d / (b+a*t) You can see that in the second term we have Y in the numerator and t in the denominator, making the equation nonlinear... I decomposed the fraction into partial fractions in order to get only t in the denominator and apply the Laplace transform property that L(f(t)/t) = integral from s to infinity F(s)ds, but so I get another integral-differential equation... Thanks in advance.
  14. D_Tr

    RGB to hex

    You shouldn't use strings for this because the performance will be atrocious at best, like Burnt_Fyr said, and there is a much simpler way too. You have a function that accepts an int. You didn't give details but most probably the int is implicitly split in 4 8-bit fields that each represent the value of one color component (one byte may be unused or used for the alpha (transparency) component). What you want to do is take 3 8-bit values one for each Red Green and Blue and pack them together in the int right? This can be done using simple boolean operations. For example see what the following C code does: int r, g, b; r = 0; g = 255; b = 140; int packed = 0; packed = packed | ((b << 0) & 0x000000FF) | ((g << 8) & 0x0000FF00) | ((r << 16) & 0x00FF0000); Now we have an int with the following format: 00000000rrrrrrrrggggggggbbbbbbbb, which can be passed to the function you mentioned. Of course b << 0 is reduntant but I wanted to make the pattern clear. This could also be achieved using unions or bitfields in C and C++ but my personal preference would be the first way, because I don't want to even bother trying to find possible undefined behaviour/portability issues with bitfields/unions, and it is an one-liner anyways.
  15. D_Tr

    So who is still around these days?

    Hey I remember you! Welcome back dude! ThoorVyk Is another guy that was very active but I have't seen a post from him during tha last 2 yaers or so.
  • Advertisement

Important Information

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

GameDev.net 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!