Closed Fossor closed 11 years ago
Well done, I really like it.
Great, I absolutely love it. Did you do the physics yourself? How long did it take you?
Thanks for mentioning Rajawali by the way :thumbsup:
Oh, and please put it on the Wiki page. But be modest with the size of the image please :)
Thanks guys! MasDennis, I took physics from some 2d example, it's called "verlet integration", there are couple of demos in different languages here and there, added Z coordinate and translated it onto a plane. Took me around 3 weeks (I am really bad with Java and Android).
So you used in shader a for
loop, isnt that bad for GL ES?
else, this is very nice and very very nice LWP ;)
Depends on the device. Smart GPUs will automatically unroll loops when it compiles the shader these days. Ones that hiccups are the Tegra GPUs from my experience. (And @Davhed can attest to that as well)
So only on tegra devices for loops ar bad bad. Like Nexus 7?
alenko, hadn't used shaders :) Physics are a pure CPU here.
can u explain me? :)
alenko, yep! There is a Rajawali plane that consists of a number of vertical and horizontal segments. And there is also a separate array of objects that represents each vertex of a Rajawali plane. Physics (a number of rules, like gravity, constraints, touch events etc.) are working on this array. After each physics iteration new coordinates are translated onto a plane through its vertex buffer.
Wow nice! Is it hard to make a sphere+flag /cloth/ collision? Some tutorial would be nice on this :)
androidder, thanks! Collisions are heavy for a real time. Here is some explanation of verlet integration: http://gamedev.tutsplus.com/tutorials/implementation/simulate-fabric-and-ragdolls-with-simple-verlet-integration/
and u push this calculations into shader right?
alenko, nope :) Directly on a plane.
vertBuffer = plane.getGeometry().getVertices(); int index = 0; for (int i = 0; i < vertBuffer.capacity(); i += 3) { vertBuffer.put(i, vertices.get(index).x); vertBuffer.put(i + 1, vertices.get(index).y); vertBuffer.put(i + 2, vertices.get(index).z); index++; } plane.getGeometry().changeBufferData(plane.getGeometry().getVertexBufferInfo(), vertBuffer, 0, vertBuffer.limit());
will try to figure out ;)
plane.getGeometry().changeBufferData(plane.getGeometry().getVertexBufferInfo(), vertBuffer, 0, vertBuffer.limit()); this is setting the vertices?
Yes, this line updates vertex buffer
Hi there! This is my first Rajawali live wallpaper. Kinda rushed to publish it on Google, without too much QA. So use it at your own risk, cause bugs and lags are possible ;) https://play.google.com/store/apps/details?id=com.fossor.ragsandflags
Oh, and thank you guys for a great engine and support! You are awesome!