mohamed adel

Members
  • Content count

    254
  • Joined

  • Last visited

Community Reputation

174 Neutral

About mohamed adel

  • Rank
    Member
  1. The GDI is very slow to use in an animation. you should use any other library. you may like to take a look at the Intel Grphics performance primitives. http://www.intel.com/cd/software/products/asmo-na/eng/perflib/index.htm
  2. I had this problem before, and It was a power problem. Check the voltages of your system -from the BIOS program or any tool that comes with the motherboard- to see if they are they in the accepted range or not.The accepted range is 10% plus or minus the Ideal voltage. For example the 5v input should be in the range of 4.5 to 5.5 volts. If this isn't a hardware problem,then I think it is a driver problem.
  3. Quote:This is pretty much moot, since throwing an exception in .Net is *extremely* expensive and should only be used in "exceptional" circumstances. Exceptions in .NET are expensive, but not "Extremely" expensive. Exceptions in C++ are supposed to be used in exceptional cricumstances too, that is why they were called exceptions. For example don't use them to control application's flow. But this doesn't mean that they cannot be used at all. Typically, An exception should be used for a situation that occurs less than one in a thousand. But the cost of throwing the exception is different from the cost of objects destruction associated with unwinding the stack, which happens when leaving a function's scope due to the throwing of an exception. This where the GC can boost the performance.
  4. MDX - Precise quad sizes?

    Quote:Original post by Demirug I would assume a rounding problem with your vertex cords. Have you tried working with pre transformed vertices? In the case of 2D with perfect texel to pixel mapping this is normally the better way. Excerpt from Tom Miller's blogs: "When a Direct3D device is created, the runtime will change the Floating point unit to suit its needs (by default switch to single precision, the default for the CLR is double precision). This is done because it has better performance than double precision (naturally). When creating the device you should use the CreateFlags.FpuPreserve flag to keep the CLR's double precision." Are you working with a single or double precission?
  5. Quote:Original post by Zodiak Thus there will be absolutely no issues of any kind with C#, MDX, and .NET as a whole. And taking into account that C# already has no performance issues (buy a normal PC, then you'll agree with me) in games (well, in software too, obviously), imagine what would it be like in 2-3 years. Again, THERE ARE NO PERFORMANCE ISSUES IN C#, believe me, I've done some very 'heavy' demos - on Radeon 9800 everything worked like a charm. So please please quit this ****shit about C# being slow etc. etc. - IT IS NOT. It *WAS*, but not know and obviously not in the future. And C++ is slower than ASM etc. etc. Modern PC's are capable enough to handle C# or whatever, no performance is not *that* crucial. But C# is not slow... BTW, you all better install .NET Framework 2.0 Beta. Had no problems with it. C# performance issues and the MDX appear in the BIG projects not in a demo.here you are some of the reasons why performance is slower in a big project: most of the MDX objects have finalizers. these are the performance issues with finalizers: 1-a finalizable object must be placed on a RegisteredForFinalization queue. In some sense, this is a bit like having an extra pointer-sized field in your object that the system initializes for you. However, our current implementation uses a slower allocator for every finalizable object, and this impact can be measured if you allocate small objects at a high rate. this also causes an extra pointer in your cache, which is 4bytes in 32 bit system and 8 bytes in a 64 bit system.If you are alocating many finalizable objects,This can get you out of the cache on small cache processors, and make you read from the memory which is 10-50 times slower. 2-Each GC must do a weak pointer scan of this queue, to find out whether any finalizable objects are now collectible. All such objects are then moved to a ReadyToFinalize queue. The cost here is small. 3-All objects in the ReadyToFinalize queue, and all objects reachable from them, are then marked. This means that an entire graph of objects which would normally die in one generation can be promoted to the next generation, based on a single finalizable root to this graph. Note that the size of this graph is potentially huge. the rest of the impacts of finalizables on performance are 11 pages long so I stated the most important things.there are also securtiy issues and much stuff.But SOME not ALL of the finalizer issues will be solved in .NET 2.0. 4-Dealing with garbage collection in a small project is easy.you are creating objects and the garbage collector is deleting them. BUT in a big project, the greater the number of objects, the higher the periority of the GC thread and this will consume your processing power.In a big project you have to call dispose() your self in some situations and do some stuff. here you are a practical example:when migrating microsoft site and the other sites related to microsft(as msdn) from asp to ASP.NET, they found that 70% of the processing power was consumed in GC. the .NET performance team discussed and debuged this problem, and they recomended the site developers to dispose all their unwanted objects before trasfering from one server to another.after doing this, only 1% of the processing power was spent in GC, but as you can see, it is not as in small applications where you throw every thing on the GC. I don't have enough time or space to write other performance issues related to C#,but I think this is enough for now.
  6. use vertex shader to animate the mesh and extrude the shadow volume. This will give you two benfits: 1-Very fast shadow volume calculation. vertex shader is the fastest shadow extrusion method. 2-It solves the problem of animation.passing a skinned mesh to a shadow volume extrusion method can cause some error in shadow volume calculation at the joints of your object (depending on the method you are using for skinning and the method for shadow volume building). Ati had an old paper about this. All you have to do when calculating the shadow volume for a skinned mesh is applying the same skining vertex shader caculations and then applying your shadow extrusion algorithm for each vertex in the vertex shader code.
  7. most games that are built using C# now are using C# only for creating the window and such stuff, not for any thing else. from a performance point of view, I think C++ games have higher performance than C# games, even when usnig managed directx. if the days of C++ were over, microsoft wouldn't make a new version of the compiler and IDE and the language extensions.
  8. [.net] C# + mySQL

    Create a DSN and use this dsn in your connection string.if you downloaded an ODBC data provider, then use an ODBC connection objects, and get your data using ODBC objects in the same way you use other ADO.NET objects. downloading a data provider doesn't mean that new classes and namespaces are added.
  9. Low FPS on directX

    Quote:Original post by Anonymous Poster Hi there, I see alot of people are moving towards getting a higher framerate. This might not always be a nice thing since waiting for the VSYNC gives the CPU the chance to do other things while rendering. I might be wrong... please can anyone else shed some light unto this. The only use for the VSYNC is preventing the tearing effect.you don't need this to give the CPU chance to do other things for the following reasons: 1-The other things are the physics and AI calculations and other such stuff. these should run definite times per frame to synchronize them with the drawing of objects on the screen.So if you are disabling the VSYNC or enabling it the physics and AI calculations are run x times per frame,where x depends on what you are doing. 2-The game as a whole is divided between the CPU and the GPU (or at least this is what you should try to acheive.drawing objects on the screen is not only done by the CPU, but alot of the task is done by the GPU. 3-The driver caches your drawing commands (and some times caches frames), sends them to the GPU and waits for them to be executed.in this time the CPU is doing other calculations. 4-you can acheive balancing between tasks in other better ways as using a thread for each task and synchronizing events between threads and handling thread periorities. why drawing only 60 frames if I am capable of drawing more including other nessecary non graphical tasks?
  10. what do you mean by "design time behaviour doesn't work"? are you working on a web or a windows application?and how are you adding controls to the grid control?please give some more information.
  11. [.net] C# + mySQL

    Quote:Original post by ernow In order to fill a DataSet you'll need an (ODBC)DataAdapter. Use the Fill method to 'fill' the dataset. The DataAdapter uses a Command object which in its turn uses a Connection object (and there's your database) Do read the manual... Cheers In order to use the ODBC DataAdapter and ODBCConnection objects , you need to install mySql ODBC DataProvider first. some problems happen when using with some versions of mySql data providers with .NET. the .NET sends requests to the provider in a unicode by default.some providers uses ascii requsts only.the provider should report that it uses only ascii requests, and the .net framework should use ascii request instead.BUT some providers don't reprot that they use ASCII requsts and this causes the problem. This problem takes a lot of forms depending on your provider version and your mySQL version. I used mySQL ODBC data provider version 3.51,and it made errors whith VS itself (auto generation of connection string and such stuff). But when writing the code myself, it worked properly.
  12. Spherical Harmonics Lighting

    Spherical harmonics is not a lighting techinque but a method to change an integration over a spherical surface to a sum of add multiply operations that are rotationally invariant and can be done quickly using today's hardware. you use spherical harmonics to encode your lighting model.you can use PRT, monte carlo ray tracing or any thing else. by the way, how many coefficients are you using? the problem with spherical harmonics is that it needs a great number of coefficients to prevent those dark spots and make the movement of light smooth, and this is where the wavelets beat spherical harmonics.
  13. Tracking down Dispose() bugs

    when are you calling dispose() and why? are you sure that your vertex buffer object is not already Disposed?
  14. Use a merge module. merge modules are used to deploy controls and components that do not exist as a stand alone application and can not be deployed directly.both the .NET frameword and managed directx have merge modules. you can search for them on the web and add them to your setup project.
  15. Datastructure concept: XML or database?

    This is the first time to me to hear that XML files are static! you can use a XSD file to define the schema of your xml. so you can change the xsd file dynamically if you want to create a dynamic template, or you can create an xsd file for each template you want. storing the SQL queries in a text file is not very good solution (from a security point of view). if you planning to use sql server, then writing the sql queries in a stored procedure would save you newtrok bandwidth, because instead for writing a long query, you will only call a stored procedure whose name is a single word.Stroed procedures are supported in Mysql5 IIRC, but it is still beta. have you thought of using an xml webservice to do what you are trying to do?