TexturePaint icon indicating copy to clipboard operation
TexturePaint copied to clipboard

Why is this doing?

Open jacwilso opened this issue 5 years ago • 1 comments

https://github.com/IRCSS/TexturePaint/blob/0b600351cb6c32daaefef496279c1943fea76d7a/Assets/Scripts/TexturePaint.cs#L92

I'm confused about what is actually happening here, you add the command buffer on start then remove it after the 2nd frame. Why?

jacwilso avatar Jan 08 '21 06:01 jacwilso

Since the UV layout doesnt change across time, the islands need to be marked only once. I dont remember why it is 2 and not 1 there, seems like like this would mark the islands twice instead of once (which is wasted performance, other than that has no effect).

Alternatively you can write a function that calls drawprocedural and dispatchCompute, and call them once on start or something instead of packing it in a command buffer and removing it after it has been executed once.

So short answer, the construct is there to call a series of GPU commands only once, seems like it is doing it twice, I am not sure why I did that at the time, maybe there was a reason like something not having been initialized on frame one or something. You can change that to one and if everything works as intended, then that is just a mistake

IRCSS avatar Jan 08 '21 14:01 IRCSS