spherical display advice needed (fisheye rendering)

We can forget the radial/circle blur now. The resolution is too low to begin with, the difference isn’t noticeable.
Maybe for a large planetarium globe with several HD projectors shining inside it this would make sense.

As for rendering the fisheye to an offscreen buffer, then applying it as texture to a custom circle with modified geometry/UVs for geometric correction, that’s very needed for this to look right.
Shaders are almost always best option, but I sadly don’t have the time nor knowledge. However, it seems to me like rendering to an offscreen buffer then applying it to a visible object via NodePath.setTexture(buffer.getTexture()) isn’t really slow. At least for me.

But I’m doing something wrong, my circle is gray.
I used the code from the sample program “render-to-texture” (rotating teapots inside TVs) and added it to the existing code, but something isn’t right:

from panda3d.core import *
import direct.directbase.DirectStart

# Load a simple scene.
env = loader.loadModel("environment")
env.reparentTo(render)
env.setP(90)

# render in offscreen buffer to a offscreen Fisheye NodePath, then apply that as a texture to a visible custom Fisheye NodePath

# make the cube map buffer.
size = 512
rig = base.camera.attachNewNode("rig")
buffer = base.win.makeCubeMap("test", size, rig)
assert buffer

# we now get buffer thats going to hold the texture of our new scene
altBuffer = base.win.makeTextureBuffer("hello", 256, 256)
# now we have to setup a new scene graph to make this scene
altRender = NodePath("new render")
# this takes care of setting up ther camera properly
altCam = base.makeCamera(altBuffer)
altCam.reparentTo(altRender)
altCam.setPos(0, 0, 1)

# make fisheye NodePath
numVertices = 1000

fm = FisheyeMaker('card')
fm.setNumVertices(numVertices)
fm.setSquareInscribed(1, 1.1)
fm.setReflection(True)
card = altRender.attachNewNode(fm.generate())
card.setTexture(buffer.getTexture())
card.setP(90)
altCam.lookAt(card)

# Disable the scene render on the normal 'render' graph.
#base.win.getDisplayRegion(1).setActive(False)


finalCard = loader.loadModel('fisheye')
finalCard.reparentTo(aspect2d)
finalCard.setTexture(altBuffer.getTexture())
finalCard.setP(90)

base.run()

The UVs of my final FIsheye (render-to-texture of the original Fisheye)
I can edit this any time I want in my 3d editor and re-export the egg.

“finalCard” egg model file is attached to this post.

What am I doing wrong?
fisheye.egg (435 KB)

It’s in the camera set-up. Though For rendering a quad, it’s more convenient to use makeCamera2d than makeCamera. This code does work:

from panda3d.core import *
import direct.directbase.DirectStart

# Load a simple scene.
env = loader.loadModel("environment")
env.reparentTo(render)
env.setP(90)

# render in offscreen buffer to a offscreen Fisheye NodePath, then apply that as a texture to a visible custom Fisheye NodePath

# make the cube map buffer.
size = 512
rig = base.camera.attachNewNode("rig")
buffer = base.win.makeCubeMap("test", size, rig)
assert buffer

# we now get buffer thats going to hold the texture of our new scene
altBuffer = base.win.makeTextureBuffer("hello", 256, 256)
# now we have to setup a new scene graph to make this scene
altRender = NodePath("new render")
# this takes care of setting up ther camera properly
altCam = base.makeCamera2d(altBuffer)
altCam.reparentTo(altRender)

# make fisheye NodePath
numVertices = 1000

fm = FisheyeMaker('card')
fm.setNumVertices(numVertices)
fm.setSquareInscribed(1, 1.1)
fm.setReflection(True)
card = altRender.attachNewNode(fm.generate())
card.setTexture(buffer.getTexture())
altCam.lookAt(card)

# Disable the scene render on the normal 'render' graph.
base.win.getDisplayRegion(1).setActive(False)

finalCard = loader.loadModel('fisheye')
finalCard.reparentTo(aspect2d)
finalCard.setTexture(altBuffer.getTexture())
finalCard.setP(90)

# For debugging buffer contents
#base.bufferViewer.toggleEnable()

base.run()

Might want to increase the resolution from 256.

Alright. I think that’s all. Just need to make some stands for holding the projector and lens in correct position and can see how it looks in real life.

Thanks for giving me interesting information