Jump to content

  • Log In with Google      Sign In   
  • Create Account

Martin Perry

Member Since 23 Feb 2012
Online Last Active Today, 12:03 PM

Topics I've Started

Bullet - objects falling through

01 August 2014 - 11:27 AM

I have created pulsing bars, similar to music equalizers. Now, I set them no gravity and controll them with setLinearVecolity. It behaves correctly and I see same result as if I set position directly.


Problem is, that if I want to have those bars collided with some other geometry, it is no working correctly. I am throwing balls on top of those bars. They bounce and are pushed by bars, but after some time, bars and balls go through each other and stuck inside each other. I must admit, that there ciould be some big changes in applied velocity from frame to frame, including negative one to move bars in oposite dirrection.



I have also tried controll bars with applyCentralForce, but it behaves weird. For example: First iteration works, I got correct position. In second one, there is 0 difference in height, so no force should be applied. I set force to be 0. But in the next iteration, even with no force applied in previous one, position of object has changed. There is no gravity and no other external force. There are no other objects in scene as well (I disabled falling balls).


Any ideas ?


Thank you

Stop objects and clear all forces

14 July 2014 - 09:47 AM

I have objects that are sliding on a tilt plane (under teh angle of 30°). When they reach the end of the plane, I would like to clear all forces and let objects fall directly down with only gravity affecting them.


Currently, all my objects continue to move in a direction of plane´s tilt and are "slowly" pushed down by gravity (the speed of push down depends on objects speed and mass).


How to achieve such a behaviour ? And is it even possible ?



2D game and projection

13 July 2014 - 11:47 AM

I am doing 2D platformer game with single screen. For now, I am using classic ortho projection mapped to box with [0,0] - [w, h] of the screen and cetered to put world coordinates point (0,0) to bottom left corner of my screen.


Now I have problem witch changing resolution, my game looks different on every one if I calculate world coordinates to match pixels. So obviously not a way to go.


What is a correct way? I want to have constant world coordinates on every device and always put everything onto the screen (considering same AR.. for different AR I just will see more sky, but I need to have constant width).

OpenGL and SVG rendering in C++

15 June 2014 - 12:34 PM

Hi ai am looking for some way how to render SVG graphics.


I have come up with two possible solutions:


1) Convert it to set of triangles and fill them with colors


2) Render to texture SVG and then only display it


For either one of them, I am not able to find any solution written in C++ and being multiplaform (Windows, Linux, Mac, iOS, Android).  Do you know something that can be used ?

Or I can write something on my own, but I am not very familiar with SVG, so I dont know how complex it is (I have written collada loader once and it was pain in the ass.. so wacko.png )

Fragment shader variables count (iPhone4)

07 May 2014 - 05:51 AM

I have high number of variables (30 uniforms (mostly vec4), about 20 variables (vec3, float, vec4) within shader) within fragment shader. It runs just fine on iPhone5S, but I have serious problem on iPhone4. GPU time is 1s / frame and 98% of the time is shader run time.

According to Apple API


OpenGL ES limits the number of each variable type you can use in a vertex or fragment shader. The OpenGL ES specification doesn’t require implementations to provide a software fallback when these limits are exceeded; instead, the shader simply fails to compile or link. When developing your app you must ensure that no errors occur during shader compilation, as shown in Listing 10-1.




But from this I quite dont understand. Do they provide SW fallback or not? Because I have no errors during compilation or linking of shader and yet performance is poor. I have comment almost everything out and just leave 2 texture lookups and directional light computation. I changed other functions to return just vec4(0,0,0,0).