www.jpct.net
jPCT-AE - a 3d engine for Android => Support => Topic started by: kkl on November 12, 2014, 10:35:42 am
-
Hi Egon,
Does setStaticUniform upload its value to GPU every frame? If yes, is it possible if we can make it upload only once and reuse afterwards, like texture?
-
No, it doesn't. That's what it's meant for. However, if you are using it, you have to take care of context changes (pause/resume and similar stuff) and set it again in that case.
-
Do you mean we have to use setStaticUniform on context change? Does setStaticUniform upload to GPU directly or it will upload again automatically during rendering after I use the method on context change?
-
It uploads during the first render pass. And yes, you have to re-apply the setters after a context change. That's why i actually don't use it anymore myself.
-
Thanks egon. I guess i'll have to set it on every context change
-
Hi egon,
How about vertex attributes? Is it doable if we have it static and only upload to GPU once?
-
No, those are different. The only 'upload' here is a pointer to a buffer and each attribute from that buffer will be injected into the vertex shader for the corresponding vertex. That's the basic idea of a vertex shader. You can't prevent it and it wouldn't make any sense, because it would leave the vertex shader without data.