Author Topic: clearAll option of setRenderTarget doesn't work?  (Read 1515 times)

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12205
    • View Profile
    • http://www.jpct.net
Re: clearAll option of setRenderTarget doesn't work?
« Reply #15 on: November 13, 2020, 06:46:08 am »
I don't see why that should be the case, to be honest. Can you provide a test case for this?

Offline MichaelJPCT

  • long
  • ***
  • Posts: 242
    • View Profile
Re: clearAll option of setRenderTarget doesn't work?
« Reply #16 on: November 13, 2020, 07:36:05 pm »
ha, i found the reason.
blitting must have enabled depth test, while the following RTT operation requires depth test off.
i can fix it now.

Offline MichaelJPCT

  • long
  • ***
  • Posts: 242
    • View Profile
Re: clearAll option of setRenderTarget doesn't work?
« Reply #17 on: November 15, 2020, 07:34:11 pm »
Hi Egon,
i have another question: if a RTT target texture is rendered with depth test off, can the DepthBuffer of this texture be deleted? saving vram is the main concern.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12205
    • View Profile
    • http://www.jpct.net
Re: clearAll option of setRenderTarget doesn't work?
« Reply #18 on: November 16, 2020, 11:06:10 am »
i have another question: if a RTT target texture is rendered with depth test off, can the DepthBuffer of this texture be deleted? saving vram is the main concern.
Maybe...but setting the DepthBuffer to null wouldn't help. The renderer would create a new, internal one on the next the render call. Currently, there's no way to suppress this. If you are using multiple textures of that kind, you could share the buffers between them so that only one is (not) used.

Offline MichaelJPCT

  • long
  • ***
  • Posts: 242
    • View Profile
Re: clearAll option of setRenderTarget doesn't work?
« Reply #19 on: November 16, 2020, 12:34:49 pm »
thanks.
i.have multiple rtt textures , but their sizes (some) are different. your way can still save some ram though.
if the pointed vram space is only 1x1 in size, that would be great.