Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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

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

1 Answer 1

up vote 4 down vote accepted

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

share|improve this answer
2  
A couple example games of good quality that use anaglyphic 3D to check out: 3-D WorldRunner (with Nobuo Uematsu music) and Minecraft. –  DampeS8N May 30 '13 at 18:59
1  
3-D World Runner was one of the one's I was thinking of, just couldn't remember the name ;) –  XGundam05 May 30 '13 at 19:01
    
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) –  DampeS8N May 30 '13 at 19:15
1  
Thanks for the answer, that is exactly what I have been looking for! :) –  Mikolaj Marcisz May 30 '13 at 19:41

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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