The Lounge is rated PG. If you're about to post something you wouldn't want your
kid sister to read then don't post it. No flame wars, no abusive conduct, no programming
questions and please don't post ads.
Shaders are more like custom mathmatical routines than traditional general purpose program code. A GPU is not intended to execute programs, but it's exellent at applaying the shaders to large sets of input data.
There is a thing called "shader permutation explosion"
basically, in most sample I found (I'm still learning hey!) shader writer tend very few "if" statement (not sure what's the problem about it, seems to be there since the start..) and instead compile 1 version of the shader for each combination of flag.
This was made easy with the effect framework.
Unfortunately the effect framework is not part of Windows 8 SDK (but you can still download it) but it WON'T WORK in Metro app (use D3DCompile).
Another solution is to use a new thing called "dynamic linking", it's also WON'T WORK in Metro app (use D3DCompile too).
Lastly the approach (recomended by Frank Luna in a PDF) seem to have one include meta shader and multiple real shader which just contains constant definition and the common include code.
However, I decided to screw that and simply use flag that I will set at runtime and have if statement act upon them. It will be much easier to understand for me.
Maybe later I can do some performance test and follow Frank Luna approach if need be.
Now that you understand my general state of mind (hopefully, it was rather long), I want to pass a lot of flags!
so I thought passing them as bit flag will save space!
And I just discover then, to my dismay, that bit flag are not supported on the default compilation target of new shaders (level 4 9_3) and needs DirectX support!
Argh! just for a bit flag!
Just wile typing I realized that wasting 32 BYTEs instead of 32 BITs is no big deal if I do it once, might go this way instead...
(heck I jut wasted lots of space for most likely unused light, dunno how to define variable size buffer in the shader, so I declared max size of each light array!)
(it's all in shamble, no commit in the repository at the moment...)
"Why would anyone prefer to wield a weapon that takes both hands at once, when they could use a lighter (and obviously superior) weapon that allows you to wield multiple ones at a time, and thus supports multi-paradigm carnage?"
I understand from reading the Wiki article that no he (Mario Capecchi) but his mother was sent to Dachau concentration camp and he was staying with a peasant family until the money his mother provided for his care was exhausted and they couldn't provide care for him and he ended up on the streets at four and a half years old.
And as that quote from a professor at a Business School shows, this is what Maker’s Mark should have done. Product differentiate so as to price discriminate. You get the extra money from those willing to pay more and still keep the revenues from the price sensitive. As most large corporates do but as all too many family run companies do not.
The last paragraph is non-sense, I am sure just as many corporations make poor decisions about product pricing / marketing as family owned businesses. There is no business model that is complete without some type of problems.
Common sense is admitting there is cause and effect and that you can exert some control over what you understand.
A friend sent me these and thought a few might be applicable.
Mediocre Laws Of The Day
Law of Gravity - Any tool, nut, bolt, screw, when dropped, will roll to the least accessible corner.
Law of Probability- The probability of being watched is directly proportional to the stupidity of your act.
Supermarket Law - As soon as you get in the smallest line, the cashier will have to call for help.
Variation Law -If you change lines (or traffic lanes), the one you were in will always move faster than the one you are in now.
Law of the Bath - When the body is fully immersed in water, the telephone rings.
Law of Close Encounters - The probability of meeting someone you know increases dramatically when you are with someone you don't want to be seen with.
Law of the Result - When you try to prove to someone that a machine won't work, it will.
Law of Biomechanics - The severity of the itch is inversely proportional to the reach.
The Coffee Law - As soon as you sit down to a cup of hot coffee, your boss will ask you to do something which will last until the coffee is cold.
Murphy's Law of Lockers - If there are only 2 people in a locker room, they will have adjacent lockers.
Law of Physical Surfaces - The chances of an open-faced jam sandwich landing face down on a floor, are directly correlated to the newness and cost of the carpet or rug.
Law of Logical Argument-Anything is possible if you don't know what you are talking about.
Brown's Law of Physical Appearance - If the clothes fit, they're ugly.
Oliver's Law of Public Speaking- A closed mouth gathers no feet.
Wilson's Law of Commercial Marketing Strategy -As soon as you find a product that you really like, they will stop making it.
Panic, Chaos, Destruction. My work here is done.
Drink. Get drunk. Fall over - P O'H
OK, I will win to day or my name isn't Ethel Crudacre! - DDEthel Crudacre
I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer
Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett