0
\$\begingroup\$

I have always wanted to put on the "3d glasses" and instead of watching a 3d movie, go to my pc and play a game in real 3D. Has anyone ever tried creating a Real 3D game? Are there any shaders that would allow creating Anaglyph 3D effect in real time? How do they work? (If they exist)

http://en.wikipedia.org/wiki/Anaglyph_3D

enter image description here

\$\endgroup\$
  • \$\begingroup\$ Which shader language are you working in? Also note, many games are compatible with nVidia's 3D rendering mode (including WoW). \$\endgroup\$ – XNargaHuntress May 30 '13 at 17:48
  • \$\begingroup\$ We are using the HLSL. I mostly wanted to know, if anyone has ever created a game that has used such shader. \$\endgroup\$ – Mikolaj Marcisz May 30 '13 at 18:07
  • \$\begingroup\$ I'd be shocked if there isn't some version of ioQuake3 floating around with this feature. \$\endgroup\$ – Sean Middleditch May 30 '13 at 20:56
  • \$\begingroup\$ Do you know any AAA production titles, that use this system? \$\endgroup\$ – Mikolaj Marcisz May 30 '13 at 20:59
4
\$\begingroup\$

Your game will need to render two viewpoints, one for the left image and one for the right image. From there, a quick search revealed the following shader created by objo on Codeplex:

sampler2D input1 : register(S0); // right image input
sampler2D input2 : register(S1); // left image input

float4 main(float2 uv : TEXCOORD) : COLOR
{ 
    float4 Color1; 
    Color1 = tex2D( input1 , uv.xy); 

    float4 Color2; 
    Color2 = tex2D( input2 , uv.xy); 

    Color1.r = Color2.r; 
    Color1.g = Color1.g; 
    Color1.b = Color1.b; 
    Color1.a = max(Color1.a,Color2.a);

    return Color1;
}

While created for WPF applications, you might be able to use the above as-is or with a little bit of tweaking.

There have been many games from the NES on up that have rendered an anaglyphic or other method of 3d effect.

The above code is licensed under the CPOL

Link to Codeplex article: Anaglyph ShaderEffect in WPF

| improve this answer | |
\$\endgroup\$
  • 3
    \$\begingroup\$ A couple example games of good quality that use anaglyphic 3D to check out: 3-D WorldRunner (with Nobuo Uematsu music) and Minecraft. \$\endgroup\$ – DampeS8N May 30 '13 at 18:59
  • 1
    \$\begingroup\$ 3-D World Runner was one of the one's I was thinking of, just couldn't remember the name ;) \$\endgroup\$ – XNargaHuntress May 30 '13 at 19:01
  • \$\begingroup\$ Square really should have left the name "Jumpin' Jack" in the west. Such a great game that didn't do great because of a generic name. (and an understandable reputation as a ripoff of space harrier) \$\endgroup\$ – DampeS8N May 30 '13 at 19:15
  • 1
    \$\begingroup\$ Thanks for the answer, that is exactly what I have been looking for! :) \$\endgroup\$ – Mikolaj Marcisz May 30 '13 at 19:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.