The technology is IMO going the right way, as GPUs begin to be general computing processors (note that half of my renderer now is written in OpenCL and in C++ on CPU) - so yes, the tech is going the right way - generall computing processors are good, of course that means that in future whole OpenGL, D3D and possibly (hopefully) others (even those using ray tracing) will be written in C/C++ on GPUs (like OpenCL is for example).
OpenGL & Transparency
#21
Posted 27 March 2012 - 11:06 AM
The technology is IMO going the right way, as GPUs begin to be general computing processors (note that half of my renderer now is written in OpenCL and in C++ on CPU) - so yes, the tech is going the right way - generall computing processors are good, of course that means that in future whole OpenGL, D3D and possibly (hopefully) others (even those using ray tracing) will be written in C/C++ on GPUs (like OpenCL is for example).
If you don't know how to speed up application, go "roarrrrrr!", hit the compiler with the club and use -O3 :D
#22
Posted 27 March 2012 - 12:45 PM
Anyway, back to that transparency problem. How do you trully do transparency on the GPU? On that is 100% correct, even when zooming, rotating and panning?
#23
Posted 27 March 2012 - 05:30 PM
There is a solution to do full transparency through depth peeling (you actually render scene N times, where N equals number of "transparent layers", each time discarding pixels with depth lesser and equal than the actual value in depth buffer in previous layer).
This solution is good and do order independent transparency without any problem, but! Imagine the second posted screen by TheNut - you'd need to render the scene 4 times into 4 different buffers (thats overkill) - so this solution is practically useless for games (as it needs huge amount of fillrate and memory).
So I don't think this one will help.
Hacky way (note, needs ninja for the word "hacky" here
In my current game in-development there is quite a bit need for specific transparency solution - so I tried several solutions and wasn't happy with any (couldn't do the cool stuff with any). Note that I'm extensively using deferred shading in it. I could use ray-tracer, but it has other stuff to do (it actually does just reflections and VPN spawning - raytracing that is quite heavy itself, doing refractions = transparency would made it a lot slower) ... I'm also running out of ideas, but what prooved really useful was doing just a single depth-peel pass with half the resolution (to save fillrate, still looks good, even for glass) -> It is still very heavy, but I think that with a little fine-tuning I'll be able to put it to good use. Of course, this limits everything (two glasses, one before second, will look wrong) -> but it has more advantages:
1.) GI and ray-traced stuff is visible in and on transparent objects
2.) Doesn't need to do any (re)sorting, you render all time front-to-back
3.) It is more effective than it seems to be
4.) When more quality needed (or Radeon 7990
So it really depends on what you actually need! Just summarize what u need for your project and try to come up with solution.
If you don't know how to speed up application, go "roarrrrrr!", hit the compiler with the club and use -O3 :D
#24
Posted 27 March 2012 - 07:30 PM
I do not have a specific need, but for example, if I was adding to my game a glass maze, with hundreds of walls of different hights and colors and png-tranparency materials? Then what? that would be just about impossible to make such game in OpenGL? and have to use real-time raytracer or something?
#25
Posted 27 March 2012 - 08:56 PM
Programmers have a similar relationship to hardware designers as artists have to programmers.
So, the artist may be frustrated that the programmer can't give him more polygons, more textures, etc. but the programmer knows her code must run in real-time, within a certain memory limit etc. And she may be frustrated that the hardware designer can't give her more memory, faster shaders, etc. but the HW guy knows his chip must run without taking too much power or getting too hot, must behave consistently, must not cost too much to manufacture, can't break the speed of light, etc. And the HW guy might be frustrated that the scientists can't design a smaller / faster / more reliable / less power-hungry transistor, that the fabs can't manufacture ICs more quickly / cheaply, and so on and so forth...
Enough rant.
And as for transparency - there are many ways to handle it with more or less degree of correctness, such as per-object sorting, depth peeling (already mentioned), A-buffer (linked list of surfaces per pixel, sorted and composited - can be done with compute shaders on GPUs today), adaptive transparency (computes a approximate depth-to-opacity mapping for each pixel), and inferred lighting. All these approaches have trade-offs - the main one being that the more accurate methods are very slow - probably too slow for a real game application unless you have a very simple world - and the more approximate methods are faster. So, pick your poison based on what best fits your use-case!
#26
Posted 27 March 2012 - 10:08 PM
Everything the big guys do is not because they don't know how, or don't have the mean to do it, it's about the money, making sure that our technolody today is dinosaur in a year and have to buy the letest, year after year. That's what I'm angry about.
Say, I build a 1x1 sandbox for you this year, next year, I'll make you a 1x2, then the year after a 2x2, so I keep getting money from you. But if I were to make you the best that can be built, a 50x50, you would not buy again for another 10 years, until I I have the technology to make a 100x100.
oh, they already made a 1,000 cores processor...
http://www.physorg.c...cores-chip.html
and we're not going to see this technology anytime soon are we?
Money is the root of all evil
#27
Posted 27 March 2012 - 10:27 PM
Sure, they may have already designed a processor that isn't going to hit the market for 5 years, or 10 years, but I think it's a mistake to assume they're cynically holding it back to drag out our dependence on them, or something. More likely, they're holding it back because it wouldn't be profitable to bring it to market now. They have to make at least as much money as they're spending, so the company can continue to operate and not go bankrupt, etc. If you think that's evil, then that's your right, but I think that's a very naive viewpoint. What are they supposed to do - sell it at a loss, rack up massive debt and then go out of business in a couple years?
(And FYI, from the article it sounds like on that 1,000-core processor, the cores are just special-purpose video decoding units or something, not general-purpose CPUs. Bit of a different thing. There are GPUs on the market today with over 1,000 ALUs on them, which is a closer comparison.)
#28
Posted 28 March 2012 - 12:49 AM
Also I'd like to note that it everything is for money in the first, second and last place. Of course here comes a good thing - as long as there is another company doing the same thing, there is progress (simple sample, fictional):
1.) I release CPU for $400 with 100GFlops
2.) I design better CPU with 1000GFlops, I'm going to release 10 years from now
3.) I profit for 3 months
4.) My "very beloved" friend comes, releasing CPU for $400, but with 200 GFlops
5.) I don't profit in 3 months -> so I release a new CPU (based on owned and designed one) that has 300 GFlops
6.) And goes on...
7.) And on...
...
n.) I release CPU designed in step 2 actually 1.5 year from beginning
n+1.) Have to design even better CPU now
As you can see, concurrency makes progress - e.g. as long as there will be another company, the stuff will develop with huge speed, when the concurrency doesn't exist, it's bad, very bad (be honest - how much improvement have we seen in Windows since version 95 ... don't count the prettier icons, security (as this one just needed improvement due to "exterior effects" = spreding the internet) and even more interrupting messages? ... of course one can use Linux like me
Same applies for everything! Be it game development, api development, hardware, cars industry, phone industry, ... or even toilet industry.
If you don't know how to speed up application, go "roarrrrrr!", hit the compiler with the club and use -O3 :D
#29
Posted 28 March 2012 - 02:13 AM
I guess we are all right, depending on the view perspective
#30
Posted 28 March 2012 - 03:21 AM
Sure it's nice to have 1000 cores, but having 6 or 8 cores isn't that bad. I have loads of fun with my hexacore and I have 4 other boxes to tap into with distributed computing + GPGPU. This is all research stuff, but it's my fun and that's what counts
#31
Posted 28 March 2012 - 03:31 AM
Now, they should work on a StarTrek "replicator" so we can have those 1000 cores CPU yesterday for $10
#32
Posted 28 March 2012 - 08:08 AM
Massive concurrency and parallelism is the bleeding edge of research. The problem is that most algorithms, and perhaps how we have become used to thinking about programming in the last 50 years simply don't fit the 1000 core architecture.
Already, when we run our code on merely 2 cores and a handful of threads, it is almost completely unavoidable to shoot ourselves in the feet, arms, heads and shoulders. Every time in a different order.
Actually keeping 1000 cores busy will be a very hard problem. Likely it will require new languages, or at least something else than the C, C++, C# we have now.
Purely functional languages could be useful, since they can evaluate parts of expressions independently on it's own core. Immutable data structures could enable memory to be safely shared between cores. The problem is, these are features found in languages like Haskell, where excessive memory use and garbage collection makes high performance, tight constraints code close to impossible.
On the hardware side, there are already lots-of-cores processors available, like this one:
http://www.intellasy...id=60&Itemid=75
It's designed to run FORTH on 40 cores, each one a complete computer with rom, ram, and io. Now, designing code for running on each code has to be done manually. I'm not sure if the cores can be reprogrammed dynamically, but I don't think so.
#33
Posted 28 March 2012 - 08:18 AM
Back in about 1990-1995 we had real time raytracing, it ran on a transputer farm running Tao OS.
http://www.uruk.org/emu/Taos.html
http://en.wikipedia.org/wiki/Tao_Group
But it never took off, the main product from all our work was a JVM that ran 147 times faster than Sun's
Then we lost parallelism for a long time, before it started to come back in the form of GPU's
The real problem was that you had to be GOOD, I mean REALLY GOOD to write fast code in Occam. GPU's are much easier to code for as the parallel nature of them is kind of hidden from the programmer.
Now for the replicator to work, we need to understand the relationship between energy and mass. We know the high level relationship (Albert said E = mC^2), but we don't know the relationship at the quantum level.
So if you want to get your wishes, donate money to science and let them find the Higgs
@geon
That's really interesting, I already have code that converts Forth into glsl, I wonder if I can go the other way .....
#34
Posted 28 March 2012 - 10:04 AM
Quote
Quote
Using haskell is cool. Coding useful stuff in it that actually isn't that slow (just about 2 or 3 times than in C) makes one feels like boss
If you don't know how to speed up application, go "roarrrrrr!", hit the compiler with the club and use -O3 :D
#35
Posted 28 March 2012 - 12:49 PM
Vilem Otte, on 28 March 2012 - 10:04 AM, said:
Perhaps memory "broadcast" where several cores read the bus at the same time? Sounds like it would cause horrible locking issues, though.
Vilem Otte, on 28 March 2012 - 10:04 AM, said:
Right! Haskell is pretty nice when you get in the right mindset for it. I wrote a simple Othello/Reversi min/max AI in it and it worked ok. About as fast as my C implementation I'd say. (I never benchmarked them, nor was the C version fast to begin with.)
It really requires you to rethink a lot of algoritm's and data structures though. I couldn't use mutable arrays like in C, so I came up with a representation of the board as a map of a tuple (the board coordinate) to an "enum" (don't know the actual name for it in Haskell).
I remember reading a paper from Naughty Dog (or perhaps Epic?), discussing the features of the next generation of programming languages for games. The author suggested a mix of paradigms with purely functional features for the math, etc.
#36
Posted 28 March 2012 - 02:49 PM
For example simple definitions of enemies in C-like scripting as:
struct enemy_t
{
skinned_model enemy_mdl;
float life;
}
void enemy_t::onhit(float dmg)
{
life -= dmg
if(life < 0)
{
life = 0.0f
enemy_mdl.setanim(NULL);
enemy_mdl.setragdoll();
}
}
could be reduced to:
data Enemy = Enemy (Model mdl) (Float life) Enemy_onHit (Enemy mdl life) dmg | life - dmg < 0 = (Enemy (ragdoll mdl) 0) | otherwise = (Enemy mdl (life - dmg))
If you don't know how to speed up application, go "roarrrrrr!", hit the compiler with the club and use -O3 :D
#37
Posted 28 March 2012 - 03:14 PM
Vilem Otte, on 28 March 2012 - 02:49 PM, said:
data Enemy = Enemy (Model mdl) (Float life) Enemy_onHit (Enemy mdl life) dmg | life - dmg < 0 = (Enemy (ragdoll mdl) 0) | otherwise = (Enemy mdl (life - dmg))
Hmm. Haskell for game scripting... Why not?
I'm all for functional style programming, but I'd go for a more conventional scripting language. Perhaps Lua or Python. Even Javascript (V8 ?) would work, and it's a pretty nice language that a lot of people already know.
#38
Posted 28 March 2012 - 11:37 PM
Anyway, we're getting a bit off topic now... though it might be worthy starting a new thread about this.
If you don't know how to speed up application, go "roarrrrrr!", hit the compiler with the club and use -O3 :D
#39
Posted 29 March 2012 - 08:37 AM
Quote
Automatic load balancing has been around for ages, we did in Taos.
The problem comes when the hardware does not support cross core comms in an efficient way.
If core 1 is waiting for a calculation to finish on core 2, you want that to happen as quickly and simply as possible.
2 user(s) are reading this topic
0 members, 2 guests, 0 anonymous users












