@@ -46,20 +46,20 @@ def __init__(self):
4646 stageToonLight .setSort (1 )
4747 sphere .setTexture (stageToonLight , myToonLightTex )
4848
49- winprops = WindowProperties (size = (512 , 512 ))
50- props = FrameBufferProperties ()
51- props .setRgbColor (1 )
52- props .setAlphaBits (1 )
53- props .setDepthBits (1 )
54- LBuffer = self .graphicsEngine .makeOutput (
55- self .pipe , "offscreen buffer" , - 2 ,
56- props , winprops ,
57- GraphicsPipe .BFRefuseWindow ,
58- self .win .getGsg (), self .win )
59-
60- Ldepthmap = Texture ()
61- LBuffer .addRenderTexture (Ldepthmap , GraphicsOutput .RTMBindOrCopy ,
62- GraphicsOutput .RTPDepthStencil )
49+ # winprops = WindowProperties(size=(512, 512))
50+ # props = FrameBufferProperties()
51+ # props.setRgbColor(1)
52+ # props.setAlphaBits(1)
53+ # props.setDepthBits(1)
54+ # LBuffer = self.graphicsEngine.makeOutput(
55+ # self.pipe, "offscreen buffer", -2,
56+ # props, winprops,
57+ # GraphicsPipe.BFRefuseWindow,
58+ # self.win.getGsg(), self.win)
59+ #
60+ # Ldepthmap = Texture()
61+ # LBuffer.addRenderTexture(Ldepthmap, GraphicsOutput.RTMBindOrCopy,
62+ # GraphicsOutput.RTPDepthStencil)
6363
6464 self .accept ("v" , self .bufferViewer .toggleEnable )
6565
@@ -69,43 +69,36 @@ def __init__(self):
6969 self .render .setLight (alnp )
7070
7171 sun = DirectionalLight ('TheSun' )
72- sun .setShadowCaster (True , 1024 , 1024 )
73- #lens = PerspectiveLens()
74- #lens.setFov(40)
75- #sun.setLens(lens)
76- #sun.attenuation = (0.0000000000000000001, 0., 0.)
72+ sun .setShadowCaster (True , 2048 , 2048 )
7773
78- sun .show_frustum ()
74+ # sun.show_frustum()
7975 sun .set_color ((1 , 1 , 1 , 1 ))
8076 sunNodePath = self .render .attachNewNode (sun )
8177 sunNodePath .setPos (0 , 200 , 600 )
8278 sunNodePath .lookAt (0 ,0 ,0 )
8379 self .render .setLight (sunNodePath )
8480
85- bmin , bmax = self .render .get_tight_bounds (sunNodePath )
8681 size = 512
87- bmin , bmax = LPoint3f (- size ,0 , - size ), LPoint3f (size , size ,size )
82+ bmin , bmax = LPoint3f (- size ,0 , - size ), LPoint3f (size , 10 * size ,size )
8883 print (bmin ,bmax )
8984 lens = sun .get_lens (0 )
9085 lens .set_film_offset ((bmin .xz + bmax .xz ) * 0.5 )
9186 lens .set_film_size (bmax .xz - bmin .xz )
9287 lens .set_near_far (bmin .y , bmax .y )
9388
94- i = LerpPosInterval (sphere ,
95- 2 ,
96- (0 ,- 100 ,600 ),(0 ,100 ,600 ))
97- i .loop ()
89+ # i = LerpPosInterval(sphere, 2, (0,-100,600),(0,100,600))
90+ # i.loop()
9891
99- # dlight2 = DirectionalLight('my dlight2')
100- # dlight2.setColor((0.05, 0.05, 0.05, 1))
101- # dlight2.setShadowCaster(True, 512, 512 )
102- # dlnp2 = self.render.attachNewNode(dlight2 )
103- # dlnp2.setHpr (0, 180 , 0)
104- # self.render.setLight(dlnp2)
92+ dlight2 = DirectionalLight ('my dlight2' )
93+ dlight2 .setColor ((0.05 , 0.05 , 0.05 , 1 ))
94+ dlnp2 = self . render . attachNewNode ( dlight2 )
95+ dlnp2 . setPos ( 0 , - 200 , - 600 )
96+ dlnp2 .lookAt (0 , 0 , 0 )
97+ self .render .setLight (dlnp2 )
10598
10699
107- loadPrcFileData ('' , 'framebuffer-multisample 1 ' )
108- loadPrcFileData ('' , 'multisamples 0 ' )
100+ loadPrcFileData ('' , 'framebuffer-multisample 0 ' )
101+ loadPrcFileData ('' , 'multisamples 1 ' )
109102loadPrcFileData ('' , 'sync-video false' )
110103loadPrcFile ("config/Config.prc" )
111104blobtoryBase = Main ()
0 commit comments