Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 14 Feb 2007
Online Last Active Today, 05:15 AM

#5169612 MSAA in Deferred shading

Posted by Hodgman on 27 July 2014 - 04:10 PM

Instead of using a Texture2d, declare yor input textures as Texture2dMS. The Load function then lets you specify which sample number you want (0,1,2,3...) along with the texel u,v coordinate.

#5169462 Hiring people to create a game for you

Posted by Hodgman on 27 July 2014 - 05:59 AM

Read this: http://www.lostgarden.com/2005/08/why-you-should-share-your-game-designs.html

Don't worry about ideas and designs. Nobody is going to steal them.

Why do people say this? Remember facebook?
Facebook wasn't founded on original ideas. It started out as a "hot or not" clone, and grew into a clone of every other social network at the time.
Minecraft is another amazing example -- it's an unashamed clone, that happened to sell better than the original.

People say it, because if you give the same idea to 100 teams, you'll have 100 completely different implementations and 100 marketin strategies.
Only a small number will be successful, despite them all growing out I the same idea.

Being able to sell something is the most important.
Being able to make something is next in importance.
Beig able to imagine things turns out to be the least...

Personally, we'd rather imagine that the opposite is true, but that's not how the world works.

Everyone has ideas for games. That's millions upon millions of ideas. Some are probably ever pretty great... But they're worthless unless you can bring them to life.
It turns out that value only lies inside implementations, and even then, only in the sale of implementations.
There's so many original ideas out there that most implementors already have a backlog of ideas they'd like to make, so they don't need to steal your ideas. What they need, is to steal your money so that they can implement their own ideas!
Think about it - say a game takes 50 people a year and $10M to make. During that time if everyone on the team came up with just one game idea, you've now got 50 years worth of ideas sitting there -- which is 2,500 man-years worth of potential work, or half a billion dollars worth of costs. Obviously most of these ideas have to be thrown away (or published on the net), even if they're amazing.

#5169438 I've decided unity

Posted by Hodgman on 27 July 2014 - 02:06 AM

Using JavaScript inside Unity is slightly different to using it under web dev.

Very different smile.png!

Yeah they call it "JavaScript", but you're actually writing Boo code! They've written a whole bunch of macros to make it seem like you're writing JavaScript code.

#5169437 Hiring people to create a game for you

Posted by Hodgman on 27 July 2014 - 02:03 AM

How I will know the programmer or the graphics artist won't just steal my design document and create the game on their own?
If they had the capability to create their own game, then why are they working for you instead of running their own team? If they want to replace you, they'll need all of your money, not your ideas cool.png

#5169435 What is a uber shader?

Posted by Hodgman on 27 July 2014 - 01:53 AM

Yeah in my experience, both of those different concepts get referred to as uber-shaders -- a complex shader with lots of runtime branches, or a complex shader-source-file that uses compile-time branching to generate many permutations / similar programs.

Also, back in the previous generation (D3D9 era), many GPUs allowed shaders to have 32 uniform boolean values. Doing a runtime branch on one of these was called "static branching", and branching on anything else was "dynamic branching". They both occur at runtime, but "static branching" was cheaper.
So there's actually 3 kinds:
1) compile-time selection of options, using different shaders at runtime.
2) runtime selection of options by branching on uniform Boolean values.
3) runtime selection of options by branching on other data (uniform floats, texels from a gbuffer, etc).

I don't think modern GPUs treat options #2/#3 differently any more though!

#5169259 How much would it be to hire someone to do 3D graphics?

Posted by Hodgman on 26 July 2014 - 02:09 AM

Complete back-of-napkin math:
Say each room takes a week, exporting each screen takes an hour, and you find a very cheap artist willing to charge $20/hr --
15 rooms x 5 days x 8 hours x $20 = $12,000.
500 screens x 1 hour x $20 = $10,000.
Total: $22k, over 27.5 weeks.

You'd have to write up some task briefs, describing in detail the exact results you want, then ask some artists for time/cost estimates.
You could easily halve or quadruple the above figure by fiddling with the estimated times and costs. Keep in mind, I'm probably severely underestimating though!

In my experience with outsourcing, artists cost between $20 - $80 per hour, depending on experience and the client....

#5169211 MSAA in Deferred shading

Posted by Hodgman on 25 July 2014 - 07:10 PM

Yeah with deferred and MSAA, traditionally you'd either end up using the average value of the samples, or just picking the first sample and ignoring the rest.
The first results in horrible arts facts instead of AA, and the second does nothing!

Once you can selectively read each and every sample, you can compute lghting per-sample instead of per-pixel.

The downside is that, e.g. With MSAA-4x, per sample lighting will be 4x more expensive than per pixel lighting... So it's also important to use a technique that lets you selectively switch between the two techniques per pixel -- only doing per sample lighting in areas where it's required.

#5169091 Patenting an Algorithm?

Posted by Hodgman on 25 July 2014 - 06:36 AM

The length of patents currently are not excessive (20 years).

In terms of IT/computer-tech, consider the state of 1994 vs 2004.
Imagine creating your own game engine in 1994 and being told that, no, sorry, you can't use it, because someone else has been granted a monopoly in that arena until 2004.
Would your Wolfenstein 3D era product now be at viable 20 years later?
No, your own investment is ruined, because someone else was granted a legal monopoly over your own creation. You didn't even copy them, but you both invented the same thing at the same time and thy were the "first to file".

20 years to profit from your work sounds ok when you're talking about inventing the steam engine, but it's an eternity in terms of modern inventions, software, and specifically games.
Our products take 1 year to make, and make their profits in about a 3 month period before disappearing into the bargain bin and obscurity.

Not only do we need the patent offices to actually reject 99.9% of applicants by applying the originally intended tests (review by experts in the field as genuinely novel discoveries), we need those same experts to agree on actually reasonable time periods. My above example is of course a worst-case exaggeration, but the point stands -20 years on software is rediculous.

If the current system is doing far, far, far more harm than good, and isn't actually required, and isn't fulfilling it's original purpose, then why can't "complete abolishion" be a suggestion for a solution/alternative.
The discussion for solutions doesn't have to just be "suggest other patent systems" -- "no patent system" is also a valid suggestion.
The bourdon of proof lies upon those who argue that these rediculous artificial monopolies on thought, backed by state-sponsored violence, are a good thing™.

#5169036 Implementing custom memory allocators

Posted by Hodgman on 24 July 2014 - 09:52 PM

Some quick-glance comments:

It might not play nicely with polymorphic arrays, but then again, I don't know if regular new[]/delete[] work correctly in this case either!
class Base { virtual ~Base(){}; }; class Derived : public Base { int foo[42]; };
Base* ptr = create_array<Derived>(1);
destroy_array(ptr);//uh oh, might use the wrong header_size
With linear_allocator, it's impossible to destruct any created objects (without asserting inside deallocate).

Should the pool_allocator assert that the requested size is smaller or equal to m_type_size?

IMHO, the constant use of the preprocessor makes the code harder to read:
#ifdef _DEBUG
    assert(condition && "message");
I would instead make your own assertion macro:
# ifdef _DEBUG
#  define NEMESIS_ASSERT( condition, message ) assert(condition && message)
# else
#  define NEMESIS_ASSERT( condition, message )
# endif

#5169004 Terraforming by aliens

Posted by Hodgman on 24 July 2014 - 05:20 PM

From wikipedia:

The term "terraforming" is sometimes used more generally as a synonym for planetary engineering, although some consider this more general usage an error.

So I'd either just use "terraforming" (disregarding the etymology and just using it to mean reshaping a planet), or if you wanted to be pedantic, use "planetary engineering" biggrin.png
Or alternatively, also from wikipedia:

H. G. Wells alludes to what today might be called "xeno-terraforming" - alien life altering Earth for their own benefit - in his 1898 novel The War of the Worlds.

#5168993 Requirements to create game

Posted by Hodgman on 24 July 2014 - 04:22 PM

First things first - what programming languages do you know, and what IDE's have you used before?

#5168992 Hosting a game server

Posted by Hodgman on 24 July 2014 - 04:21 PM

For nix servers, you'd typically use something like putty to connect to a command line interface over SSH.

For windows servers, you could do something similar or remote-desktop in to them.

For any server, an FTP client is a decent way to transfer files (assuming the server is running an FTP server).

#5168838 This singleton keeps crashing.

Posted by Hodgman on 24 July 2014 - 04:06 AM

This is a strange design for a Singleton... is this a CRTP base class, where the user is in control of allocation/lifetime?

class MyThingy : public Singleton<MyThingy> {};
MyThingy globalStorage; // in main/etc
MyThingy* test Singleton<MyThingy>::GetSingleton();//anywhere

Regarding your code:

  • *(int*)(T*)1
  • Reinterpret the integer 1 as an T*, reinterpret the T* as an int*, read the integer at that address.
  • Read the integer located at the memory address 0x00000001.

I assume the bytes at that address are not within the valid address space of your process, so you'd get an access violation error!


As above, you probably want:
ptrdiff_t offset = ptrdiff_t( ((char*)(T*)0) - ((char*)static_cast<Singleton<T>*>((T*)0)) );
ms_Singleton = (T*)((char*)this + offset);


or just:

ms_Singleton = static_cast<T*>(this);

#5168813 Looking for advice to construct class structure for efficiency

Posted by Hodgman on 24 July 2014 - 12:34 AM

I don't like either of those options -- a model is too high level to know about a ID3D11DeviceContext, and the Device is too low-level to know about complex things like models.


I would choose option #2, but instead of the Device knowing how to draw "models", break that down into it's simplest parts -- vertex streams, a stream layout, a shader program, lists of texture bindings, lists of cbuffer bindings, and a "DrawPrimitives" operation. I'd have the device know how to draw something use all of those objects internally, and then I'd have the "Model" class have these as members (i.e. be composed out of these simpler objects).

#5168774 Pipeline Configuration for Post-Processing Shaders

Posted by Hodgman on 23 July 2014 - 07:07 PM

You still need a vertex shader - the geometry is a quad or triangle that covers your entire screen!

To work without any geometry at all, you'd use a compute shader instead of a pixel shader, an Dispatch instead of Draw.