Thanks rdb! Thanks to your code it is complete:
from pandac.PandaModules import loadPrcFileData
loadPrcFileData("", "win-size 640 640")
loadPrcFileData("", "show-frame-rate-meter t")
from direct.showbase.ShowBase import ShowBase
from panda3d.core import NodePath, CardMaker, SamplerState
class LowRezGame(ShowBase):
def __init__(self):
ShowBase.__init__(self)
smallbuffer = base.win.makeTextureBuffer("Small Buffer", 64, 64)
smallbuffer.setSort(-100)
smalltexture = smallbuffer.getTexture()
smalltexture.set_magfilter(SamplerState.FT_nearest)
smallscene = NodePath("Small Scene")
smallscene = self.loader.loadModel("environment")
smallcamera = base.makeCamera(smallbuffer)
smallcamera.reparentTo(smallscene)
smalltexture.set_wrap_u(SamplerState.WM_clamp)
smalltexture.set_wrap_v(SamplerState.WM_clamp)
card = CardMaker("card")
card.set_frame_fullscreen_quad()
card.set_uv_range(smalltexture)
card_path = render2d.attach_new_node(card.generate())
card_path.set_texture(smalltexture)
app = LowRezGame()
app.run()
set_wrap_u/set_wrap_v doesn’t seem to make a noticeable difference though (at least in a static scene in 1.9.1).
Here’s a version of the scene without set_magfilter(SamplerState.FT_nearest) applied:
By the way, I wanted to achieve this to have a render suitable for the lowrezjam 64x64 resolution game jam on itch.io. I will probably not use it but I’ll share this thread on their forum.