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.


Topics - lawless_c

Pages: [1] 2 3
1
Projects / A Game project i was working on for a few years
« on: April 16, 2021, 01:46:46 am »
Hi
Thought I would share this with all of you.

https://github.com/lawlessc/starseige

This is a personal game project of mine for Android I was working on sporadically for few years.

I am kind of tired of it now so I thought I would make it public for others to see, so I've shared it here and on Reddit.

Maybe some of you can use lessons from it. My biggest lesson was to go in actual plan and an idea of what I actually wanted.

2
Support / NPOTexture from bitmap
« on: February 11, 2019, 11:23:03 pm »
is it possible to create a non power of two texture from a bitmap?

I have been trying for a few days now, but NPOTexture only has one constructor, which only allows for the creation of colour textures.

And the Texture object itself replaces my NPO Bitmaps with a square black bitmap to use as a texture instead.

3
Projects / Conways Game of Life in JPCT
« on: October 21, 2018, 10:58:59 pm »
Thought this might interest people here.

https://github.com/lawlessc/GameOfLife  :)

It's an implementation of Conways Game of Life that i'm working on, i've done the computation in the shaders itself using the textures to store the state of the world, it runs very fast  if i do say so myself  8)

For anyone interested:
https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life



4
Projects / Ireland from space live wallpaper
« on: October 24, 2016, 01:52:57 pm »
Made this live wallpaper here:


https://play.google.com/store/apps/details?id=com.lawless.satellite.ireland&hl=en_GB

If anyone here would like to try it here are some codes  :) , some feed back would be great so i can be sure it
works on devices i could only emulate.  For the moment it doesn't work on tablets.

7WWMEFMH8R75R1LQGZMJH61
EY79EDFPJTNQQ6P5HYLMBNQ
JSKSR7WYTNZSHQ3KYBKZ8CU
RE2Z9C4BPMGSF3N0L0CGXZK
781T6KTPLUR9GYH3TQW3LES
H4S168EZPCKAP01PH4RBFK1
B53NMF7NXVPFD9AR4H8N20N
3TVYACQRNNBKQ49FD9GZDTC
L7E78PDFQCQ6UGLGU7GBHC7
DR0C7ERF3N26PXC70CY9NH8
J6531LXTMYARF9EHCK0QM91
PAYEJ2PZ5MDAEX0JLEGK1A5
JHGLH14SA6R5EC3HVS8QP7K
E7N4SA6F8HGV15WSXGDV7SV
7EHMC2VT4C53HGFM7ZC2GRE
58G2HC0TTZX2LU7WK68TCW1
S52D6J9AJ4WEAZ3HZDAM42S
2LQGGLVWJ9U4J0SVRNTJ6AC
J6GVU02DQQP6RRC10SM8702
9D9B2BW5EQADR8XCEMFLDH3
H2L7XW6M2SAULEXJ64JCNKD
1K6NVXLQ8UQGJL8SVWZH4D9
L54E1XK9RMACMPVUT1Y2N7X
B86K1LAPYEBSB57U23LALJR

5
Support / Correctly killing an application
« on: October 05, 2016, 01:23:48 pm »
Is there anything JPCT specific that needs to be done when closing/killing an application.

I'm trying out doing a livewallpaper but i'm finding if the wallpaper activity has already been launched once for example in preview mode then the next time i try to launch preview mode or set it as a wallpaper the application seems to hang and i'm left with just a black background.

However if i reset my phone the wallpaper will then switch on correctly.

6
Support / rotations in jpct
« on: October 03, 2016, 01:07:35 am »
How do functions like rotations in JPCT work for example rotateAxis? does it use Radians or a regular angle?
and does it rotate in a clockwise or anti clockwise direction?

7
Support / sharing textures accross multiple object3d's
« on: June 30, 2016, 05:45:49 pm »
Are there any delays or locks in sending a framebuffer image to texture?

I'm trying to reuse the same texture across two object3d's , the texture is shared to both via Two texture info's

When i run this however , textureA isn't applied to objectB as it should be. Is it possible there is delay in the first render that locks  the texture? I found that if i reversed the order
i ran into the same issue but with the other object3d.


    fb.setRenderTarget(TextureA);
    objectA.setVisibility(true);
    fb.clear();
    displayWorld.renderScene(fb);
    displayWorld.draw(fb);
    fb.display();
    objectA.setVisibility(false);

    fb.setRenderTarget(TextureB);
    objectB.setVisibility(true);
    fb.clear();
    displayWorld.renderScene(fb);
    displayWorld.draw(fb);
    fb.display();
    objectB.setVisibility(false);

8
Support / Texture switching
« on: June 03, 2016, 06:24:54 pm »
Is it possible to swap texture name assignments and texture info's while running a game?



eg assign like this

TextureManager m;
Texture tex1;
Texture tex2;


m.addTexture( "textureA ", tex1) ;
m.addTexture( "textureB", tex2) ;


//Then swap them ?


m.addTexture( "textureA", tex2) ;
m.addTexture( "textureB", tex1) ;


Maybe with a 3rd texture as temporary holder.

9
Support / Dummy/child object3d
« on: May 13, 2016, 04:43:25 pm »
Just wanted to know, can i use child dummy object3d's   for attaching things to my entities
for example Turrets or particle emmiters that need to appear as if they are stuck to the surface of another model and rotate/move with it.

10
Support / How to set a blit shader?
« on: March 09, 2016, 02:08:06 am »
How and where should a shader be set for blitting?

I'm using a shader with fb.setBlittingShader but it get's ignored?

I'm trying to do this on an android device.

I'm trying to do a filtering effect kind of like this but it seems to just be ignored.

http://www.jpct.net/forum2/index.php?topic=4355.0

11
Support / Set a texture info to a blitter
« on: February 06, 2016, 01:02:10 am »
Is there any way to set a texture info to fb.blit?

I was looking at this thread here http://www.jpct.net/forum2/index.php/topic,4355.msg30380.html#msg30380

And thinking it would be great if i could also access a textureUnit1..3 as well as textureUnit0.

12
Support / Objects multiple worlds?
« on: October 12, 2015, 06:06:29 pm »
Is it possible to add the same instances of an Object3d to many worlds?

Would there be disposal or other issues?

I'm thinking of creating a another World object in which objects are added and the results are used to create a glowing effect.

If i could get these objects in the other world instance to use a different shader that would be even better. Maybe if i used the render-hook to switch them.
I could then use some combination of additive blending to overlay the result on the frame-buffer.

13
Support / Screen size/shape & view area?
« on: August 15, 2015, 08:45:17 pm »
Just wanted to know does the size of a screen affect the area the Camera sees?

For example , if i have world which contains multiple objects will a large screen running the same code as a device with a smaller screen simply show me a larger image?
or would a larger screen show everything exactly the same but larger?


I ask because im working on Some UI elements which exist in the world space(instead of being added to the framebuffer) and i wanted to know how difficult it would be to keep them im roughly similar positions accross devices.

14
Support / Unusual reproducible bug with shaders glsl
« on: July 28, 2015, 01:58:32 am »
I've managed to produce a bug using glsl which will function for the Object3d it is applied to but cause errors elsewhere in the program.


For context i was using a lighting shader i found elsewhere
http://www.lighthouse3d.com/tutorials/glsl-tutorial/directional-lights-per-pixel/

I modified it to work with glsl in jpct.
While using the version i created i made a call at the start of the fragment shader to

Code: [Select]
uniform [b]vec4[/b] specularColors[8];
Obviously i was going outside the Jpct spec you have here: http://www.jpct.net/jpct-ae/doc/com/threed/jpct/GLSLShader.html
Which says it should be a vec3.

If you use it the shader still works seemingly perfectly, and the object3d looks how i want it to.
However i've found it breaks another part the  program.

I was using Andre Silva's particle system https://www.youtube.com/watch?v=cn-iS4YnqnE which worked perfectly until i tried using the new seemingly unrelated shader.
It would successfully generate the first particle sprite but then crash as it attempts to generate a second particle from the same texture.

Producing this vague error  ": - ERROR: before: glError 1282"


Somehow using a vec4 instead of a vec3 causes this.



If it helps here are the shaders

The vertex shader


Code: [Select]
precision mediump float;

uniform mat4 modelViewMatrix;
uniform mat4 modelViewProjectionMatrix;
attribute vec4 position;
attribute vec3 normal;

varying float fogthickness;
varying vec3 norm;
varying vec4 eye;


void main() {

     vec3 n = normalize(modelViewMatrix * vec4(normal, 0.0)).xyz;

     norm = n;
     eye= -modelViewMatrix[3];

     fogthickness = 1.0-     dot(normalize(eye.xyz),n );

     gl_Position =  modelViewProjectionMatrix *position; //* vec4(position,1.0);
}








The fragment shader which causes the bug.

Code: [Select]


precision mediump float;

uniform vec3 atmosphereColour;


uniform vec4 specularColors[8];


uniform vec3 lightPositions[8];

varying vec3 norm;
varying vec4 eye;
varying float fogthickness;


void main() {




    vec4 spec = vec4(0.0);

        // normalize both input vectors
        vec3 n = normalize(norm);
        vec3 e = normalize(vec3(eye));
        vec3 ligthDirection = normalize(lightPositions[0]);

        float intensity = max(dot( n,ligthDirection), 0.0);
        float shininess= 1.0;


        // if the vertex is lit compute the specular color
        if (intensity > 0.0) {
            // compute the half vector
            vec3 h = normalize(ligthDirection + e);
            // compute the specular term into spec
            float intSpec = max(dot(h,n), 0.0);
            spec = specularColors[0] * pow(intSpec,shininess);
        }
      vec4  colorout = max(intensity *  vec4(atmosphereColour,1) + spec, vec4(0.0));



    gl_FragColor = vec4( colorout.xyz , fogthickness);
}





I have a hypothesis that it's because the shader will compile perfectly but when it's run only receives vec3 specularColor from Jpct itself when it expects a vec4.

15
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.

Pages: [1] 2 3