Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Who's good with shaders? (Oculus Rift support)

Author
Message
xCept
23
Years of Service
User Offline
Joined: 15th Dec 2002
Location:
Posted: 4th May 2013 08:49 Edited at: 4th May 2013 08:59
I have spent several days trying to wrap my head around shaders in DBPro, but have concluded I'm not very good at it and haven't gotten anywhere.

What I'm trying to do is migrate the barrel distortion shader provided by Oculus to create the side-by-side stereoscopic effect as required to view 3D in the headset. The end result should ideally look like:



(Just getting the basic side-by-side down without distortion would be a good start too).

I've found a DirectX 9 (shader model 2) conversion from the original DX10+ which should be easier to translate to what DBP supports.



I also found an OcculusRift.fx file that may be even easier to migrate.



Any help would be much appreciated, as I think it'd be very cool to develop Rift-capable apps in DBP. Of course, getting proper 3D display is only a small piece of the puzzle and adding actual head tracking is probably the bigger undertaking. DBP already has some support for an older headtracking device and stereoscopics so maybe that wouldn't be all that hard, I don't know. In either case just being able to view DBP apps in 3D with the Rift headset would be very cool.

The actual SDK documentation from Oculus that describes the formula in detail starting on page 16 is at https://developer.oculusvr.com/documents/Oculus_SDK_Overview_0.2.1.pdf
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 6th May 2013 12:16
I have stereoscopic 3D support in my WIP 3D Bang Bang 2, it's really easy to implement. (Even with all the shaders I have been using)


I know I know nothing about shaders, but it looks like TexMap0; and TexMap1; are the images for the left and right camera. You'll need to create two cameras, (one for the left eye, and one for the right) apply the above fx file as a camera shader, then paste the resulting images to the screen before calling Sync Camera 1.

Check out the bloomcam shader, as you'll follow the process used in there to setup both eye cameras.

I live for video games! (And beers, and football, and cars!)
See what I live for here: [url]http:\\www.TeamDefiant.co.uk[/url]

Login to post a reply

Server time is: 2026-07-07 00:49:19
Your offset time is: 2026-07-07 00:49:19