ParaToxic Posted April 15, 2012 Share Posted April 15, 2012 I had an idea a few minutes ago.When you are programming in C++ it is (I heard) 100 times slower than in the same in assembler. So does it make sense to make a 3D engin in assembler (not all) ? Imagine your application could render not 1 mio triangles at 60 FPS but with 600 or 6000 FPS ??!! Quote Link to comment Share on other sites More sharing options...
Brent Taylor Posted April 15, 2012 Share Posted April 15, 2012 Whoever told you this is in denial. It wasn't even close to "100 times slower" when the first C compiler was released. On the whole, few programmers are going to produce assembly code more optimzed than your average compiler. Even then, it's rare to shave off more than a few pico seconds in any particular function. Quote There are three types of people in this world. People who make things happen. People who watch things happen. People who ask, "What happened?" Let's make things happen. Link to comment Share on other sites More sharing options...
cassius Posted April 16, 2012 Share Posted April 16, 2012 it takes long enough to write a game engine in c++.I tried to learn assembly years ago on a Commodore 64. Took me a whole evening to print my name on the screen.It was needed then for 2d games but surely not now. Quote amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++ Link to comment Share on other sites More sharing options...
LordHippo Posted April 16, 2012 Share Posted April 16, 2012 Many developers are using assembly in their game engines' code. But it's not "100 times" faster or anything near that. But it's a must to get some parts of the engine done. Quote Ali Salehi | Programmer Intel Core i3 2100 @ 3.0GHz | GeForce GTS 450 | 4GB DDR3 RAM | Windows 7 Ultimate x64 LE 2.50 | Visual Studio 2010 | RenderMonkey 1.82 | gDEBugger 5.8 | FX Composer 2.5 | UU3D 3 | xNormal 3.17 Link to comment Share on other sites More sharing options...
Naughty Alien Posted April 16, 2012 Share Posted April 16, 2012 ..you dont want that.. Quote Link to comment Share on other sites More sharing options...
smashthewindow Posted April 16, 2012 Share Posted April 16, 2012 If you know what you're doing, sure go ahead, use inline ASM. (It would probably make it unreadable to other programmers though.) I have a bit of reverse-engineering background, so I use IDA/OllyDbg frequently to investigate calls & gain understanding of what's happening. (But I never use inline ASM to actually code stuff.) Quote Blog & Portfolio Current project: moon.chase.star Link to comment Share on other sites More sharing options...
Pixel Perfect Posted April 16, 2012 Share Posted April 16, 2012 There is some benefit in using inlined assember code where the application really requires as Lord Hippo points out but you really need to know what you are doing as Brent indicated. Also, assembler is directly tied to your CPU family so you would need seperate code for each CPU family you intend running it on. Quote Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++ Link to comment Share on other sites More sharing options...
DaDonik Posted April 16, 2012 Share Posted April 16, 2012 ASM is ok if you are writing an engine, but for a game...i guess you would be the only one using it. Even the microchips in todays consumer electronics are written in C, just because it's much faster to write and easier to understand. Quote (Win7 64bit) && (i7 3770K @ 3,5ghz) && (16gb DDR3 @ 1600mhz) && (Geforce660TI) Link to comment Share on other sites More sharing options...
ParaToxic Posted April 16, 2012 Author Share Posted April 16, 2012 Ok the "100 times faster" was unreasonably but it think it is usefull to use ASM for stuff like vertex/matrix/vector calculation.Some functions in CPU "extras" like 3DNow! use that too. Quote Link to comment Share on other sites More sharing options...
Pixel Perfect Posted April 16, 2012 Share Posted April 16, 2012 The best advise I can give is don't worry about such things just now. Most people will struggle to even complete the coding of their game engine and game using a high level language. If you are worrying about which bits should be optimised using assembler at this early stage then you are either a genius or have possibly lost sight of the bigger picture Write good quality high level code and If sections of your code need optimising you can do that later once all the other obstacles have been overcome. 1 Quote Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++ Link to comment Share on other sites More sharing options...
Roland Posted April 16, 2012 Share Posted April 16, 2012 Well said Pixel Perfect. Couldn't agree more. Quote Roland Strålberg Website: https://rstralberg.com Link to comment Share on other sites More sharing options...
ParaToxic Posted April 16, 2012 Author Share Posted April 16, 2012 Hihi I agree your post.Just afraid about my FPS of a scene with some vegtation models...... Quote Link to comment Share on other sites More sharing options...
Brent Taylor Posted April 16, 2012 Share Posted April 16, 2012 Ok the "100 times faster" was unreasonably but it think it is usefull to use ASM for stuff like vertex/matrix/vector calculation.Some functions in CPU "extras" like 3DNow! use that too. Do keep in mind, you can have your compiler take full advantage of any feature your processor supports. Though, in most cases, compilers default to featuresets that are common amoung most chipsets of it's type (AMD and Intel for example). Quote There are three types of people in this world. People who make things happen. People who watch things happen. People who ask, "What happened?" Let's make things happen. Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.