Hale812
19th December 2017, 08:49
I want play 2d as SBS,how to write the code?thank you!!!!:thanks::thanks::thanks:
I guess, you have to create a corresponding topic for that.
This topic is about Anaglyph color-based stereo-channel separation.
Not about geometry based separation.
But! You can try finding the answer yourself by analyzing the Jan-Willem's code:
First he searches the extents of the image to find a coordinate of the splitting. Then, he mixes to the current coordinate a bunch of weighted pixels by scaled-down coordinates, pointing to original split; with a half-image shift for corresponding colors(like G&B coords are shifted, as they are taken from the right eye).
So you have to make the reverse work: find the extents, calculate the splitting coordinate. Then use "if" conditional statement (google the "MSDN hlsl if") basing on current coordinate for left and right images separately. (of course, instead of "if" you can use algebraic conditioning by 0/1 coef. multiplication, I am not sure which would be faster. I guess, "IF" is faster with option "not calculate alternate branches") In each image you would reference "expanded" coordinates to original image, derived from current pixel coordinates.
I guess, you have to create a corresponding topic for that.
This topic is about Anaglyph color-based stereo-channel separation.
Not about geometry based separation.
But! You can try finding the answer yourself by analyzing the Jan-Willem's code:
First he searches the extents of the image to find a coordinate of the splitting. Then, he mixes to the current coordinate a bunch of weighted pixels by scaled-down coordinates, pointing to original split; with a half-image shift for corresponding colors(like G&B coords are shifted, as they are taken from the right eye).
So you have to make the reverse work: find the extents, calculate the splitting coordinate. Then use "if" conditional statement (google the "MSDN hlsl if") basing on current coordinate for left and right images separately. (of course, instead of "if" you can use algebraic conditioning by 0/1 coef. multiplication, I am not sure which would be faster. I guess, "IF" is faster with option "not calculate alternate branches") In each image you would reference "expanded" coordinates to original image, derived from current pixel coordinates.