Stereo Anaglyphs for red-cyan glasses

Posted By: Slin

Stereo Anaglyphs for red-cyan glasses - 02/29/08 23:53

Hey,
Take on your red-cyan, red-blue or red-green glasses and play your Gamestudio projects. But be carfull not to hit the monitor when you are trying to touch your models

Okay, it is may not perfect (especially the viewplacement), but hopefully very easy to implement and already causing a great effect.

These are just the scripts since I donīt have the time to create a nice example level but it would be great if someone else would create something nice and showcase it

The code is completly free to use.

Have fun with it and show some screenshots
Nils Daumann

Download it here: http://files.filefront.com/Stereo+Anaglyphs/;9729871;/fileinfo.html

Edit: You should know that it is written in Lite-C, needs A7.07 and support for pixelshader 1.4.


Posted By: Pappenheimer

Re: Stereo Anaglyphs for red-cyan glasses - 02/29/08 23:59

Nice give! Now, I have to buy such red-green glasses first!
Posted By: Blink

Re: Stereo Anaglyphs for red-cyan glasses - 03/01/08 01:20

aaaawwwwwwwwww!!!!!!!! No fair Slin! you know we dont all have lite-c! please tell me you are going to convert it to c-script for us old wdl faithfuls? please oh please oh please oh please! i promise not to beg for codes again!!!!
Posted By: xXxGuitar511

Re: Stereo Anaglyphs for red-cyan glasses - 03/01/08 02:48

...just bought 4 pairs of Anaglyph glasses off eBay, just for this
Posted By: Hummel

Re: Stereo Anaglyphs for red-cyan glasses - 03/01/08 15:30

Thank you so much Slin!
The screen shows my simple "parallax occlusion mapping"-shader:


Posted By: Quad

Re: Stereo Anaglyphs for red-cyan glasses - 03/01/08 16:05

How lucky. Doritos giving away that red-cyan glasses with their new 3d-shaped corn-chips.

As always, great job Slin!
Posted By: Blink

Re: Stereo Anaglyphs for red-cyan glasses - 03/01/08 19:05

I implore you, oh great Grandmaster of Shaders, Slin! A6 users will sing songs and tell great stories of your legendary works....Please convert to A6. Now let me get back to the Slin fan club banner that I was working on, lol.
Posted By: Slin

Re: Stereo Anaglyphs for red-cyan glasses - 03/02/08 13:41

Pappenheimer:
Quote:

Nice give! Now, I have to buy such red-green glasses first!



I bought this pack last summer and still consider it a good investion :
http://www.3d-foto-shop.de/pd1137827271.htm?categoryId=8

Blink:
Quote:

i promise not to beg for codes again!!!!



I wouldnīt do so
Quote:

Now let me get back to the Slin fan club banner that I was working on, lol.



Please make me a special member
I will try to make it usable with A6 and ChrisBs render to texture plugin later today.

xXxDisciple:
I think such glasses are really worth the little money

Hummel:
Great screenshot

Quadraxas:
Quote:


How lucky. Doritos giving away that red-cyan glasses with their new 3d-shaped corn-chips.



Cool


Thanks for all your nice comments, but please show some screenshots
Posted By: Blink

Re: Stereo Anaglyphs for red-cyan glasses - 03/02/08 15:55

Thanks Slin, now all I have to do is learn how to use the render to texture plug in and i will be all set,lol.
Posted By: frazzle

Re: Stereo Anaglyphs for red-cyan glasses - 03/02/08 18:15

Great of you to UC this Slin !!
You're too kind

Cheers

Frazzle
Posted By: Slin

Stereo Anaglyphs Lite-C/C-Script - 03/02/08 19:24

Here you go for the C-Script version:
http://files.filefront.com/C+Script+Stereo+Anaglyphs/;9742166;/fileinfo.html

You need at least support for shadermodel 2.0 and the latest A6 Comm.
I already included the render to texture dll from ChrisB. Just remove it as well as the RenderToTexture.wdl if you own A6 Pro or A7 Comm.

Other than that it has all the disadvantages postprocessing with A6 causes if you donīt use a lot of workarounds. It is for example not possible to change the resolution without a restart.

Slin
Posted By: Blink

Re: Stereo Anaglyphs Lite-C/C-Script - 03/02/08 22:58

Oh thank you, Grand Architect of Shaders! The A6 clan thanks you. I am writing your legend theme song right now!
Posted By: Blink

Re: Stereo Anaglyphs Lite-C/C-Script - 03/03/08 04:47

a slight problem...for some reason, r2t isnt opening. i have the current dx9c dll, so thats not it. and sylex and renderview dll's open fine. i added all of the line of scripts and include where they are supposed to go, but r2t still doesnt open. what can i do?
Posted By: Slin

Re: Stereo Anaglyphs Lite-C/C-Script - 03/03/08 12:43

What exactly do you need Sylex for?
Posted By: Blink

Re: Stereo Anaglyphs Lite-C/C-Script - 03/03/08 14:41

i dont really use it. its in all of my folders because i was trying to use the shaders that come with it. it opens when i run a level. i would like to just use render2texture, but it wont open.
Posted By: Why_Do_I_Die

Re: Stereo Anaglyphs Lite-C/C-Script - 03/04/08 01:27

has anyone tried this ? If so, how does it it look?
Posted By: RedPhoenix

Re: Stereo Anaglyphs Lite-C/C-Script - 03/04/08 15:12

Yeah I ve made a few tests with the shaders, (since my glasses have arrived ).

It's really impressive. I can't decide, yet whether amber/blue or red/cyan is better in showing the effect. red/cyan shows a better effect on the object itself, as in amber/blue on my examples often appear dubbeling artifacts as the filters don't work absolutly correctly. But if you have a panel on screen (which is of course exactly on screen layer) and the amber/blue effect set to your scene, it gives you a totally crazy expression, as you can really see the distance beween the panel on screen and the objects behind!
Posted By: BlueBeast

Re: Stereo Anaglyphs Lite-C/C-Script - 03/07/08 10:09

all I can say is...

3D STRIP KITTENS!
Posted By: xXxGuitar511

Re: Stereo Anaglyphs Lite-C/C-Script - 03/07/08 18:15

lmao, I had forgotten about that game. Is it still around?

They could make any more sales with a "3D" option. Along with the new shaders and functions, they'd do pretty well....
Posted By: BlueBeast

Re: Stereo Anaglyphs Lite-C/C-Script - 03/08/08 01:33

The SK site is down and the phone disconnected... the domain is good another 2 years so why would they stop selling I wonder? Strange... but not the topic of this thread I guess...

Being a non-programmer, how easy is it to add this to an existing game? Does some action have to be applied to all models? what about block geometry? Or is this more of a 'camera effect'?
Posted By: ello

Re: Stereo Anaglyphs Lite-C/C-Script - 03/11/08 19:09

hm.. i got me a cyan/red nosebicycle but it does not work here. i guess it has to do with the colors. if i close the red eye its nearly filtering all out so i only see the cyan rendered side. but when i look thru the red eye only, i see both views. so looking thru both eyes gives me not the desired effect... are those values normed or did you just tweak them until they worked for you?

edit: or is it a problem with working on a notebook (screen problem)
Posted By: BlueBeast

Re: Stereo Anaglyphs Lite-C/C-Script - 03/11/08 20:11

Ello, How well does the glasses work with the pictures posted in this thread?
Posted By: xXxGuitar511

Re: Stereo Anaglyphs Lite-C/C-Script - 03/11/08 23:55

I finally got mine in. I tried the example, not bad, but I still think it needs more tweeking to properly align the images. The red/cyan shifts way too far apart at times.
Posted By: BlueBeast

Re: Stereo Anaglyphs Lite-C/C-Script - 03/12/08 04:09

First and foremost, here's where you can get free 3d glasses... just send a self addressed stamped envelope:

3D info and free glasses

Second, and also important, there are red/cyan and red/blue and other colors.

using red/blue with a red/cyan image may not work right, and the same with red/cyan glasses with a red/blue image. Make sure the right glasses are used.

I learned something new today, and when I read it, it makes sense and I hadnt thought about it much before. If anyone has ideas of a game/application to use 3D, there's a special consideration to keep in mind.

The red/cyan type of 3D effect best works with, say, movies that are black and white or have a very low color satuation. This is due to the blending of colors of various shades of red and blues that can mess up the 3D effect.

That's why they use the polarized lenses at theatres mostly and those big screen movie houses... so you can have 3D -AND- full color.

-----------------------------------------------------------------------

Unfortunately, polarized images can't be reproduced on a computer screen because it's a 'physical' effect caused by a special screen using tiny 'reflectors' on the screen, directing each projectors image to one angle.

The red/cyan effect, obviously, can be reproduced, and it sure can be fun to play with. Just keep in mind the problem with using colors like red/cyan with colorful scenes.

----------------------------------------------------------------

Personally, I like dark dungeon gothic type stuff, and with a low color saturated or a black and white scene, something fantasticly cool could be made with 3D.

But if you're looking for a full color game or scene, it will be difficult to make it great looking unless you can carefully control what colors are used in the scene.... and good luck not having any reds or blues in a 'full color' scene

-----------------------------------------------------------------------

I know exactly '0' about shaders, and even less about post processing. I know we discussed 3D a couple years ago using2-3 cameras and frame switching etc etc, but I don't think anyone did anything with it. And i have no clue how much processing power is required to make such effects work (and i suspect not many do)

My opinion is also that if anyone works with trying to make a 3D effect, they should gear it to doing a real time application with it. Call me a visionary, or an idiot, but I think a 3D 'anything' would be a hit and if I can find an inspiring programmer, I'm definitely looking to make something in 3D.

I'm totally inspired !

- Jason
Posted By: ello

Re: Stereo Anaglyphs Lite-C/C-Script - 03/12/08 09:54

Quote:

Ello, How well does the glasses work with the pictures posted in this thread?




no, there is the same shifting which xXx mentioned
Posted By: xXxGuitar511

Re: Stereo Anaglyphs Lite-C/C-Script - 03/12/08 13:38

...I'm still trying different things to get past it. The biggest problem is keeping the red/cyan close; if they shift too far, it will just blur...

Right now I've got both views about 8 quants away from each other. both views pointing to a focal point (about 500 quants from the view). It's really not working that well...

I've been studying many Anaglyph images, and the one thing I'm trying to achive is: The focal point should be at the screen position. the red and blue channels should split away from each other as the distance grows further.

Example...

...Notice how the colors shift way as the distance increases.


I'll keep messing with it.
Posted By: ello

Re: Stereo Anaglyphs Lite-C/C-Script - 03/12/08 17:26

Quote:

..the red and blue channels should split away from each other as the distance grows further.

Example...

...Notice how the colors shift way as the distance increases.




gonna check this image when i am home. for now.. the shader contributed does exactly the opposite as it shifts the channels more if the objects are near by
Posted By: BlueBeast

Re: Stereo Anaglyphs Lite-C/C-Script - 03/12/08 21:12

I'm looking at anaglyph pictures on the internet, and tho I'm not 100% certain, it does appear that closer objects get less shift, and further objects get more shift...

The other thing is that it doesnt seem to get wider and wider the further an object is. At some point, the big rock 100 meters away will have about the same shift as the tall building 1 kilometer away (remember, youre eyes are only about 2 inches/5 cm apart.

It's when an object is physically closer, and much closer that the 3D effect is at it's best.

I don't know how this post porocessing shader works, but in my un-expert opinion, I think there should be a falloff point, about 2 meters/6 feet where the shifting remains the same for all objects further away, or tapers off very slowly.



I mean, a lot of 3D movies deliberatly exaggerate the effect for the 'fun factor' because the objects that will make you duck away from the screen are really close to you anyway.


Check out this page... it's about how to take/make 3D anaglyph pictures and using a free program to make a 3D image.

Free Anaglyph Program/ tuorial

the best 3D effects are done with 2 cameras anyway... is this effect just imposing the same camera view and adding red/cyan versions? I'm not saying it wont work, and it may be th easiest way too.. just curious.


Ok guys, i'm doing all the homework... make a great 3D effect! lol

- Jason
Posted By: Slin

Re: Stereo Anaglyphs Lite-C/C-Script - 03/12/08 21:45

The used matrices arenīt really normed and are based on trying by the authors from this page: http://www.3dtv.at/Knowhow/AnaglyphComparison_en.aspx
I also included the other matrizes from that page, just remove the commentmarkers in front of them and uncomment the currently used one. If you have really a lot of trouble to get anything working you should may try the matrices for real anaglyphs which should work without a problem as long as your display shows the colors right. When creating a 3D photograph you usually create the images from just a few centimeters shifted position without changing the angle. Though you can definatly improve the experience through playing around with the angle (I wanted this as easy as possible to use and got rid of it). When the pictures are combined and you look at them through some glasses, the layer without a offset will seem to be ad the screens position and then depending on which color is on which site, things will go into the display or come out of it.
The bigger the offset is, the deeper the scene will seem to be. But it will be hard to see 3D if the offset is bigger then the offset between your eyes (I often read 6cm for this). You should also play around with the views arc parameters.

When using color filters you will usually throw the red channel completely away.
The alternative which is often used is as BlueBeast already said are polarised glasses. But you wonīt get it to work on a computer monitor easily. You have to use two beamers for this with different "filters" in front of their lense so the light will be different for both pictures. You also need a special projection surface which dosnīt manipulate the light (it has to mirror it very nicely) and then each glass in front of your eyes will let pass only the "fitting" light.

For computergames there are also shutter glasses which will always close one eye and change the image.

Some other nice practices for 3D is to learn crossview and parallelview (just search for it ) this will also make it a bit eaysier to look at anaglyphs with a quite big offset.

Since the cyan filter will often have also some red passing there can appear some ghosting, but you should usualy still see it in 3D if it isnīt too bad.

Just some experiences I made in the last weeks
Posted By: xXxGuitar511

Re: Stereo Anaglyphs Lite-C/C-Script - 03/13/08 01:51

Your color filtering was just fine. In fact, great find!

I'm simply tweaking the views...

I found the best result to be separating the views about 2 quants, and then slightly crossing over the views (at a very distant focal point). I'll try and get some screen shots up.



EDIT: I think I found a good setting:

Pic01
Pic02
Pic03
Pic04
Pic05
Pic06
Posted By: BlueBeast

Re: Stereo Anaglyphs Lite-C/C-Script - 03/13/08 03:52

Are you guys just doing rendered images? or are you using a real time walkthrough type level?

Is there potential for use for a 3D game?
Posted By: xXxGuitar511

Re: Stereo Anaglyphs Lite-C/C-Script - 03/13/08 04:08

...These are realtime. I'll post a video on youtube, but it'll probably come out WAY too dark (FRAPS makes my dark game darker)...


EDIT: Got it; It's horrible quality though: YouTube
Posted By: BlueBeast

Re: Stereo Anaglyphs Lite-C/C-Script - 03/13/08 09:14

Yes.... it is horrible quality indeed lol...

However, I got to see the effects that I was looking for.

So what's the deal so far?

Are you using Lite C or C Script?

How's the tweaking going?

Is it realistic/practical from a framerate standpoint to think this could be used in a game?

Can this be added to an existing GS game?

Tell! Tell!

- Jason


Posted By: RedPhoenix

Re: Stereo Anaglyphs Lite-C/C-Script - 03/13/08 15:26

Well I think it can be used in realtime, at least on my system it's working quite well so far. But I think the amber/blue filtering method is even better than red/cyan. If the picture gets too dark or colours appear wrong you can postprocess your scene before the 3d-shader with a simpel colourfiltering shader, to lighten it, or change the colour quality in order to prevent the effects, created by the 3d method. It's working for me, and I myself like the results belonging quality and performance very much. Fast movements make it a bit harder to follow the 3d (for me at least , as I often focus on one of my eyes stronger than on the other one), but that's a matter of training I guess.

The amber/blue method seems to have a patent... Does anybody know whether this means restrictions in using this effect commercially? License?
Posted By: BlueBeast

Re: Stereo Anaglyphs Lite-C/C-Script - 03/14/08 00:08

"Color Code"

This is the only thing I could find about patented anything...

apparently its the process called color code thats patented.
They use amber/blue lenses, but the picture presentation is different.

Aparently pictures look normal without glasses, but look 3D with them on.
The biggest thing is that it's not anaglyph 'technology' It's a whole different process.

I'm no patent expert, but I would find it hard to believe that using amber/blue anaglyphs would be different than red/cyan.

Call me a rebel, but if I wanted to make a project with amber/blue instead of red/cyan... I wouldnt worry about it

I don't think theres a patent on just using amber/blue... the smart person would have patented the whole making 3D with anaglyphs in the first place


- Jason
Posted By: BlueBeast

Re: Stereo Anaglyphs Lite-C/C-Script - 03/15/08 17:56

LOL.... everyone is being so secretive about this!
I think we have some people brainstorming some game ideas!

Asking questions is like pulling teeth and noone wants to talk.

I'll have to bump this thread in a few weeks to see if anyone will give answers then
Posted By: Slin

Re: Stereo Anaglyphs Lite-C/C-Script - 05/31/08 17:58

I just found this thread again...

Quote:

LOL.... everyone is being so secretive about this!

This is a contribution! Do you know what the contribution is? It is the code for actually doing anaglyphs. I posted the link in my first post.
Posted By: Drew

Re: Stereo Anaglyphs Lite-C/C-Script - 11/25/08 05:20

Here are some shots from a demo i'm messing around with...the last image isn't 3D, just for reference.

Thank you for this functionality!


Posted By: Hitsch

Re: Stereo Anaglyphs Lite-C/C-Script - 03/28/09 10:26

I know this is an old thread, but I've had people asking me if this is possible to do in 3DGS.

So here's my test scene with red/cyan. I also noticed that the 3D effect is more impressive when the scene is actually moving.
And that if I convert the screenshot to Jpeg, the scene gets about have as deep as it is now. So compression is a bad idea.



I also noticed that it depends on the screen and especially on the color 'temperature' setting.
So it would be great if the user could adjust the darkness of the red and blue amount until one eye can only see one or the other, and not a faint ghost image of the other.

Great contribution though, really love it...
Posted By: sebbi91

Re: Stereo Anaglyphs Lite-C/C-Script - 05/02/09 14:02

first of all:sorry for my English!
I ve a little question!

the effect works very nice but i use 2 cams(views)!
iam using a Splitscreen like in AUM30.

My question how get i work this code for 2 views?

I tried 2 months to modify the code for 2 views but i cant get it working!
Please could anyone help me?
It would be very nice if you post the modified script!

I hope you can help me!

mfg BasTi
Posted By: sebbi91

Re: Stereo Anaglyphs Lite-C/C-Script - 05/06/09 12:28

No ideas?

Posted By: sebbi91

Re: Stereo Anaglyphs Lite-C/C-Script - 05/09/09 18:16

common guys i'm sure one of you can help me!
i cant get it working cry

PLS help!
I am waiting since 7 days.
Posted By: sebbi91

Re: Stereo Anaglyphs Lite-C/C-Script - 05/21/09 10:35

its like talking with a wall -.-
Posted By: xXxGuitar511

Re: Stereo Anaglyphs Lite-C/C-Script - 05/23/09 04:14

...We (I) Don't really know what your asking for? The script already sets up two views automatically (camera + additional). They are both positioned on the same place in the screen. The shader combines the two views and renders into the camera view...
Posted By: Enduriel

Re: Stereo Anaglyphs Lite-C/C-Script - 05/30/09 15:00

He wants to use the code for games with "split" screens, like 2 player games on the same screen.
Posted By: KiwiBoy

Re: Stereo Anaglyphs Lite-C/C-Script - 05/30/09 21:27

Well if your using 2 views and you want analglyphs then assign red to one and blue to the other, it might do what you want but thats not what analglyphs is designed for, it is only designed for 1 screen.

Instead, why not invetigete the possibility of stereo cameras or more to display a genuine 3d view.
I speculating a camera offset by each ear by about another head width could give a semi 3D view whilst others nearer the object but to the side send thier views to.
Merging may be offset just slightly to give a fuzziness perhaps, dunno, just speculating.
Posted By: EpsiloN

Re: Stereo Anaglyphs Lite-C/C-Script - 12/22/10 22:49

Could someone upload the C-Script A6 version again tongue ? Please...
Posted By: painkiller

Re: Stereo Anaglyphs Lite-C/C-Script - 12/22/10 23:05

look for it on slindev, there is a link
Posted By: Blink

Re: Stereo Anaglyphs Lite-C/C-Script - 12/22/10 23:30

it works really well.
Posted By: gamers

Re: Stereo Anaglyphs Lite-C/C-Script - 01/08/12 19:15

Hi, Could anyone upload this lite-c version again ???
Posted By: Slin

Re: Stereo Anaglyphs Lite-C/C-Script - 01/08/12 19:39

Try this: http://files.slindev.com/codes/StereoAnaglyphs.zip
Posted By: gamers

Re: Stereo Anaglyphs Lite-C/C-Script - 01/09/12 13:50

Originally Posted By: Slin


thanks for your interest laugh
Posted By: Ice2642

Re: Stereo Anaglyphs Lite-C/C-Script - 09/17/14 17:30

hello,

Were I can found a FX anaglyphs post processing effect to use with lite-c?

the links in this topic I had not success.

Thank you.

Best Regards,
© 2024 lite-C Forums