Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - lawless_c

Pages: 1 2 3 [4] 5 6 7
46
Support / shaders and OnResume()
« on: July 24, 2015, 01:13:15 am »
I've been having a problem for a while now with glsl shaders and OnResume().
Upon leaving my app to check something else i found the shaders would lose certain important data such as a colour value , what i would end up with
are shaders that instead of fading to the colour i wanted simply faded to black.

Simple fix i found was to use setUniform instead of setStaticUniform in my renderhooks.

Just thought i would let you all know as i was only able mention of similar problems involving textures and onresume but not shaders.

47
yup that was it, removed the titlebar and all my touches became perfectly accurate.

48
Support / Ray picking (im doing something wrong but im not sure what)
« on: June 23, 2015, 03:00:53 pm »
I'm trying to do ray picking, partially on my own as i don't intend to use "minCalDistance" or Object3d's directly

However it only seems to partially work. I can hit objects i tap but the collision does not occur exactly at the point i picked. but seems to be offset vertically.

Code: [Select]
public static SimpleVector[] touch(MotionEvent e,FrameBuffer fb) {

     int x = (int)e.getX();
     int y = (int)e.getY();

             SimpleVector raydirection = Interact2D.reproject2D3DWS(camera, fb, x, y).normalize();
              SimpleVector cameraposition= new SimpleVector(camera.getPosition());

             return sphereIntersect(cameraPosition, ray,object_positions,objectradius);

}






My sphere intersection function



Code: [Select]
public static SimpleVector[] sphereIntersect(SimpleVector rayOrigin,SimpleVector rayDirection, SimpleVector sphereOrigin, float sphereRadius )
 {

        sphereOrigin.sub(rayOrigin);

        double c = (double) sphereOrigin.length();
        double v = (double) sphereOrigin.calcDot(rayDirection);
        double d = sphereRadius * sphereRadius - (c * c - v * v);

        if (d < 0.0) {
            return new SimpleVector[0];
        }
     
        float distance = (float) (v - Math.sqrt(d));
        rayDirection.scalarMul(distance);
        SimpleVector r1 = new SimpleVector(rayDirection.calcAdd(rayOrigin));

        return new SimpleVector[]{r1};
   }


Perhaps it's an issue with how android handles screen coordinates?

49
Support / Are object3d s centered?
« on: June 10, 2015, 03:17:54 pm »
Just wanted to know if i create a sphere using this method

ExtendedPrimitives.createEllipsoid(new SimpleVector(plsize,plsize,plsize), 128, 1f, 1f);

Will the  the sphere be at the origin/center or offset from it in some way?

50
Support / Re: What do you use for audio/music
« on: June 10, 2015, 12:46:28 pm »
Same  8)

51
Support / What do you use for audio/music
« on: June 09, 2015, 12:55:48 am »
I realize this might be slightly unrelated but i wanted to know in particular what libraries/frameworks do devs using jpct-ae rely on for playing back sounds , music, perhaps even managing playlists.

52
Support / ArcBall in JPCT?
« on: May 26, 2015, 03:59:25 pm »
anyone used ArcBall before with jpct? it looks like it could be very handy for rotating about things on touchscreen.

I'm attempting to implement it now with jpct and wanted to know if anyone else has already had success with this?

http://www.java-tips.org/other-api-tips-100035/112-jogl/1714-arcball-rotation-nehe-tutorial-jogl-port.html


http://en.wikibooks.org/wiki/OpenGL_Programming/Modern_OpenGL_Tutorial_Arcball

53
Support / Annoying logcat spam, anyone else encountered this.
« on: December 16, 2014, 01:51:36 am »
Has anyone encountered logcat spam like this? I'm happens many times a second so im guessing it's something i'm doing wrong repeatedly with object3d 's but im not quite sure what.

It's not crashing the game and everything is still fast. But it's a nuisance, and might indicate im doing something wrong. I could probably filter it but i would prefer to see if i can simply stop it from happening.




54
Support / Re: Object3d switching/swapping in renderhook.
« on: November 24, 2014, 01:30:17 pm »
hmm ok, i'll iterating though at switching the references istead.

55
Support / Re: Object3d switching/swapping in renderhook.
« on: November 24, 2014, 01:01:04 pm »
I could try the visibility/switching trick.

If an objects visibility is set to completely transparent though will JPCT still go through all the calculations of trying to render the objects mesh?


56
Support / Object3d switching/swapping in renderhook.
« on: November 21, 2014, 06:32:03 pm »
Is there a standard way for quickly swapping out objects?

I'm thinking of making an addition to my game so that objects get swapped for very simple billboards at large distances.

If i can i get two benefits:

incredible distant objects can be made easily selectable.

Rendering very large quantities of objects will have less of an impact of rendering speed(I'm not really worried by this though as it hasn't been an issue so far).

57
Support / Re: Which comes first: setvertexcontroller or build?
« on: November 10, 2014, 03:02:28 pm »
vertices are the lines not the faces
Neither...they are the end points of the lines.

oh right, sorry.

58
Support / Re: Which comes first: setvertexcontroller or build?
« on: November 10, 2014, 11:55:13 am »

59
Support / Re: How to perform attachments effect by jpct-ae?
« on: November 07, 2014, 06:40:18 pm »
The sphere could a shader done around a spherical object http://http.developer.nvidia.com/GPUGems2/gpugems2_chapter16.html

edit: i dont think it would need to be as complex as the one in the link though as you aren't trying to simulate light scattering.
if you can use the shaders you may be able to set it so fragments at right angles to the camera are less transparent than those facing it.

60
Support / signed distance field fonts
« on: October 09, 2014, 01:38:25 am »
Thought this might be of interest to you guys , ive been working on a simple package for doing signed distance field fonts on Android.

https://github.com/lawlessc/distance-field-glyphs

It's shader based on what Paul Houx did here with Lib Cinder https://forum.libcinder.org/topic/signed-distance-field-font-rendering to implement valves paper.

And i have also written it so it uses SDFFonts in the his generator outputs them.
https://forum.libcinder.org/topic/signed-distance-field-font-rendering

It's incomplete at the moment but i hope to add more to it as i go along, and if other people want to make additions to it or fork it into something better thats even better. I think it may be useful for display some small amounts of text on screen(ideally without distortion at many resolutions) , at the moment the text can look a bit rough.

Pages: 1 2 3 [4] 5 6 7