• Advertisement


  • Content count

  • Joined

  • Last visited

Community Reputation

122 Neutral

About wanzi

  • Rank
  1. Ok, just found a solution, because expression (_1 + _2)(p1, p2) returns a value(string), ret<string> needs to be in front of the expression: string s = ret<string>(_1 + _2)(p1, p2); Why the compiler can't deduce the return type? And why the (_1 < _2)(p1, p2) works? Is that because the return type is unknown, so int is assumed?
  2. For the following code, why (*) doesn't work? using namespace std; using namespace boost::lambda; string p1("Hello"); string p2("World"); string s = (_1 + _2)(p1, p2); // can't compile(*) bool b = (_1 < _2)(p1, p2); // compile, and b == true
  3. Thanks for the quick reply~~~~ For anyone interested in "Two-Phase Name Lookup", I just found a codeproject article http://www.codeproject.com/cpp/TwoPhaseLookup.asp
  4. Ok, I've got the following code template<typename T> class Test { public: void Foo() { typedef std::vector<T>::iterator vec_itor; // 1 } typedef std::vector<T> vec_type; // 2 typedef std::vector<T>::iterator vec_itor; // 3!!(Problem) }; The compiler gives error for 3, saying "std::vector<T>::iterator : dependent name is not a type". If I comment out 3, it runs properly. What puzzels me is that wht 1 and 2 work, but 3 doesn't. Aren't 1 and 3 basically the same??
  5. Hi every one. Recently i start (re)designing my (crappy) physics engine, and wanna add polymorphism(virtual functions) in to make it more flexible. Since virtual functions will probablely introduce some overhead, in some speed critical parts, i'm gonna replace them with function pointers, which i think have the same underlying implementation as normal function call, and should be the fastest i can get. But after reading from somewhere, that isn't always the case.[oh] Another problem is that FP has very bad support and ugly syntax for member functions, which motivates me to find an alternative. After googling, I came across this article, it claims "invoking a single-target delegate is as fast as a normal function call", and has much better syntax ans support for member functions. It really sounds promising. Basically, what i wanna ask are: 1)Is Function pointer call always as fast as normal function call? 2)Will replacing branching(if...elseif...) with FP array be faster? 3) Are Delegates really that fast? 4)Can i widely adopt Deleagtes, and replace all the FP(if possible)? [Edited by - wanzi on October 15, 2005 9:01:02 PM]
  6. Hmmm, I recommend to use Light Space Perspective Shadow Maps(lipsm), cuz to do PSM well, lots of horrible hacks are reuqired. In addition lipsm provides src code on its website. NonClickable: http://www.cg.tuwien.ac.at/research/vr/lispsm/ BTW, What's the syntax of making links in this forum?
  7. Quote:Original post by Thr33d It claims to be a magnitude faster than SH. What's the word? doubtful, i think what they mean is for all frequency shadows, wavelets are faster(cuz' in high frequency case, it uses relatively lower number of coefficents, while for low frequency case, SH are faster).
  8. Just my $.02f. Skinnable will be a plus. Scrollable text box.(good for debug console) And you might wanna consider some high level gui(like open dialog).(Hmm, that might be a bad idea, cuz' it's somewhat too platform specific) And for the perf stat: fps:1784(beginning) 890(resize to 1024*768) Athlon64 3200+ GF6600GT AGP8 Since the fps is not linear, Change fps(frame per second) to spf(second per frame?) may be better.
  9. Yup, just normal aliasing, but due to the geometric characteristic of ur scene(i.e. some objects are quite small), it makes them somewhat sparkling when camera moves I think i'm using the latest version(that one i can use keyboard to add some fancy lights), but no fps info.
  10. Cool, it runs pretty well on my GF6600GT, althogh the aliasing is quite UGLY. And, how you guys find the fps? I can't find anything that can turn on the perf info stuff~~~
  11. This question may have been asked for many times, but I just wanna know when the Forum Search will be up again? cuz' It's so hard to find the old posts, and the google doesn't help....
  12. Hi Everyone, not sure if it has been asked, ok, here's my question: Does any driver support EXT_framebuffer_object? Thank you in advance
  13. Lightmaps & Moving Objects

    Quote:Original post by mikeman Thanks for the suggestion guys, I'll look into them. I've also thought another way, which should be pretty fast, but I haven't implement it yet, so I don't know. Since each light has a finite range, I can assign a 3D grid of sample points to each light, say 16x16x16, and determine offline whether a sample point is in shadow or not. Then, for any object that is inside the light range, pick the closest point, and if it's flagged "shadowed", then make the object shadowed too for that light. Maybe I could even do an interpolation between the closest points. The good thing about this is I don't have to do any raytracing in realtime, but I don't know how much memory it will need, although I really need just 1 bit for each sample point. At this point, I don't really care for realistic static shadows, I just don't want a character to look weird when it's inside a shadowed area and it looks bright. Hmmm, what you said sounds like 3D lightmapping, you can find it on Humus website IIRC, while the lightmap he used is a lot more dense, and he used the actual lighting value ratherthan un/shadowed.
  14. (-1)^(A/B) == (-1^A)/(-1^B) ??

    Thanks for the fast reply But I still think it may be right, as some of the following equations/conclusions are derived from it. I guess it has sth to do with -1? It starts with this: e^(i*PI*A/B) -> -1^(A/B) [eular indentity] -> (-1^A)/(-1^B)[that's where i'm confused] -> Becasus A & B are always even -> 1 Or it maight be just a big mistake.
  15. (-1)^(A/B) == (-1^A)/(-1^B) I read this from an article the other day, but still can't figure out why. Is that correct, or just a mistake in the book? And if it's right, what's the name for this indentity? Thnaks in advance
  • Advertisement