Advice - Compound Eye

Anything and everything that's related to OGRE or the wider graphics field that doesn't fit into the other forums.
Post Reply
crvogt
Bronze Sponsor
Bronze Sponsor
Posts: 12
Joined: Mon Dec 21, 2020 11:03 am
x 1

Advice - Compound Eye

Post by crvogt »

Hi all,

Looking for advice on whether or not this would be viable. I'd like the camera view to be that of an insect/compound eye, in the "hollywood" sense. Ie. a bunch of small images (sub-lens?) of the scene packed into a single view. I've Googled around some but this doesn't seem to have been posted about.

My theory currently is that I'd have to either a) rework the camera rendering or b) render a bunch of view-points and patch them together into a single view. I'd like each sub-lens to actual depict the view from that position, rather than just shift one view to give the appearance of different sub-lens positions.

I'd be interested to know if there's another option or if people think this is feasible :/

Thanks!
User avatar
Zonder
Ogre Magi
Posts: 1168
Joined: Mon Aug 04, 2008 7:51 pm
Location: Manchester - England
x 73

Re: Advice - Compound Eye

Post by Zonder »

Don't you just need to use multi view rendering? essentially like stereo rendering but for far more points! :)
There are 10 types of people in the world: Those who understand binary, and those who don't...
crvogt
Bronze Sponsor
Bronze Sponsor
Posts: 12
Joined: Mon Dec 21, 2020 11:03 am
x 1

Re: Advice - Compound Eye

Post by crvogt »

Zonder wrote: Thu Dec 31, 2020 8:51 pm Don't you just need to use multi view rendering? essentially like stereo rendering but for far more points! :)
Lol, that sounds like the ticket! I wrote that before jumping into the tutorials (still a bit hung up in them) and wanted to put the question out there while I delved through the material. Will this not effectively overburden the system? My only reference for this is the camera object in Gazebo, derived from Ogre1.9, though it sounds like multi-view will act as a single camera.
crvogt
Bronze Sponsor
Bronze Sponsor
Posts: 12
Joined: Mon Dec 21, 2020 11:03 am
x 1

Re: Advice - Compound Eye

Post by crvogt »

Zonder wrote: Thu Dec 31, 2020 8:51 pm Don't you just need to use multi view rendering? essentially like stereo rendering but for far more points! :)
Would this require making a N viewports and N scenemanagers effectively? Struggling a little to find the documentation on this. I noticed it mentions it in the the Camera class, but how to do it in practice continue to elude me.
paroj
OGRE Team Member
OGRE Team Member
Posts: 1993
Joined: Sun Mar 30, 2014 2:51 pm
x 1073
Contact:

Re: Advice - Compound Eye

Post by paroj »

crvogt wrote: Wed Jan 06, 2021 7:36 pm
Zonder wrote: Thu Dec 31, 2020 8:51 pm Don't you just need to use multi view rendering? essentially like stereo rendering but for far more points! :)
Would this require making a N viewports and N scenemanagers effectively? Struggling a little to find the documentation on this. I noticed it mentions it in the the Camera class, but how to do it in practice continue to elude me.
you would need N viewports, but you can use the same camera for all of them. See:
https://github.com/OGRECave/ogre/blob/6 ... .cpp#L4621
which gives:
https://ogrecave.github.io/ogre/vtests1 ... iViewports

altough for sub-lenses, you would need to use N cameras as mathematcally a camera only corresponds to a single lens.
crvogt
Bronze Sponsor
Bronze Sponsor
Posts: 12
Joined: Mon Dec 21, 2020 11:03 am
x 1

Re: Advice - Compound Eye

Post by crvogt »

paroj wrote: Thu Jan 07, 2021 12:05 am
crvogt wrote: Wed Jan 06, 2021 7:36 pm
Zonder wrote: Thu Dec 31, 2020 8:51 pm Don't you just need to use multi view rendering? essentially like stereo rendering but for far more points! :)
Would this require making a N viewports and N scenemanagers effectively? Struggling a little to find the documentation on this. I noticed it mentions it in the the Camera class, but how to do it in practice continue to elude me.
you would need N viewports, but you can use the same camera for all of them. See:
https://github.com/OGRECave/ogre/blob/6 ... .cpp#L4621
which gives:
https://ogrecave.github.io/ogre/vtests1 ... iViewports

altough for sub-lenses, you would need to use N cameras as mathematcally a camera only corresponds to a single lens.
Awesome, thank you! That's working out very well.

Unsurprisingly it's running a little slow with hundreds of cameras, so any hints on speedup are welcome.

Next is getting scripts working! I've managed to run the compositor scripts for things like "Glass" and "Old TV", but DOF and Vignetting (a la viewtopic.php?f=11&t=68394&p=448388&hil ... ng#p448388) continue to elude me. Probably just need to revisit https://ogrecave.github.io/ogre/api/1.1 ... ripts.html
paroj
OGRE Team Member
OGRE Team Member
Posts: 1993
Joined: Sun Mar 30, 2014 2:51 pm
x 1073
Contact:

Re: Advice - Compound Eye

Post by paroj »

crvogt wrote: Mon Jan 11, 2021 9:22 pm Unsurprisingly it's running a little slow with hundreds of cameras, so any hints on speedup are welcome.
take a look at the "Shader System" sample and check "Instanced Viewports". I am not sure that scales beyond 4 viewports though and editing that requires in-depth ogre and shader knowledge.
Post Reply