I have started to pay more attention to
reducing the amount of stuttering movement
of models when a processor intensive shader
is used in a scene.
This occured after a recent WebGL conversion
https://scenes.virtuastripper.net/ET_FractalGarden165.zip
zip size = 5.72 Kb
The stuttered movemnt of the models was so bad
I had to re-edit both the shader and the .SCN
( as below) to make it watchable. To do this..
In the .SCN file:1. Removed the shader's substrate texture altogether
and replaced that source with a nested quad at the
framebuffer to mount the shader.
framebuffer {
id: myquad01
size: 960, 540
quad {
size: 960, 540 //1920, 1080
hotspot: 0.0, 0.0
pos: 0, 0, 0
shader: fragment, Shaders/Undulating ColumnsMod01.fsh
}
}
2. Reduced the amount of processing required by using
a smaller sized quad (half the size of the original
1920 x 1080 mounting texture). you can go smaller but
the edges of graphics may start to break up.
3. At the sprite node used that same size to declare
the output of the shader as a 'sprite'. This also
allowed me to invert the shader output which I could
not have done if I had applied the shader directly on
a texture in the sprite node.
sprite {
hotspot: 0.5, 0.5
pos: 0, 0, 0
source: myquad01
size: 960, 540
scale: 1.0, -1.0// inverts the previous shader
}
4. Used Z placement of the 3D camera to best fit the shader
'sprite' for the screen rather than re-scaling the 'sprite'
In the shader:Reduced precision from mediump to lowp
#ifdef GL_ES
precision lowp float;
#endif
By making the above changes, the stuttering became way less
noticeable. The only drawback to removing my 'good old' Beige.png
shader substrate is that slight artifacts are created now whenever
the clipnamesprite or logo become active.