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 - zbych

Pages: [1] 2
Projects / Craft The Path 2
« on: October 02, 2015, 08:43:54 pm »
I have recently published the sequel of my game: "Craft The Path 2".
It has improved block hit detection (this version uses "ray cast", don't ask how i have done it in 1st version ;) ), second major addition is first person camera - this was quite a challenge, but unfortunately I have failed in some cases: "climber" the block where you can climb up and down might not work in "some cases" in 1st person camera. I have also added new blocks TNT, coal and other things. I didn't have enough ideas to create levels that is why it has only 25 levels.

Projects / Cut The Clothes
« on: May 03, 2015, 03:30:36 pm »

Finally I managed to finish my game "Cut The Clothes". The idea for it comes from arcade (coin op) game called "Dancing Eyes". The game was released in Japan only, and the hardware of this arcade was similar to PSX One, allowing it to display 3D textured graphics - that's the short history :)
Your task is to move along the grid lines and draw closed area, when you do it the selected area (part of clothes) will disappear, the goal is to remove all "panels".
Implementing it was a small challenge, I had to take care of things like: line drawing, depth buffer inaccuracy, grid creation, graph cycle detection, detection of panels inside cycle, changing the visibility/color of panels - for this I am using dedicated shader that's why I am able to control visibility of more than hundred panels without performance lost.
You can find jPCT logo and address in "about" section.

I will be glad for positive ratings on GoolePlay. Thanks ;)

Support / Disappearing transparent geometry
« on: April 25, 2015, 09:31:44 pm »
In some cases when camera moves around object (transparent object) a part of this object disappear. As you can see on second image, a part of object is missing.
Is it possible to set some kind of flag to disable this geometry "culling" (the back-face culling is disabled for this object)?
When I disable transparency for this object it is rendered ok.

Support / Drawing Lines
« on: October 26, 2014, 09:15:51 pm »
I was searching how to draw lines in jPCT but didn't found any good solution that's why I want to present my code and ask: what are possible problems with this solution? I am suspecting that when object/triangle leave camera sight the lines might disappear. Will it cause other problems and how to prevent them?

Code: [Select]
public class SimpleLineManager {

public class LineSegmentContainer {
public int segmentLen;
public FloatBuffer segmentBuffer;
public SimpleVector segmentColor;

static final int COORDS_PER_VERTEX = 3;
private final int VERTEX_STRIDE = COORDS_PER_VERTEX * 4; // 4 bytes per member

private ArrayList<LineSegmentContainer> _lineSegments;
private GLSLShader _lineShader;
private Object3D _root;
private IRenderHook _renderHook = new IRenderHook() {
public void setTransparency(float arg0) {}
public void setCurrentShader(GLSLShader arg0) {}
public void setCurrentObject3D(Object3D arg0) {}
public boolean repeatRendering() {
return false;
public void onDispose() {}
public void beforeRendering(int arg0) {
public void afterRendering(int arg0) {}

public SimpleLineManager(GLSLShader lineShader) {
_lineSegments = new ArrayList<SimpleLineManager.LineSegmentContainer>();
_lineShader = lineShader;

float[] vertices = { 0,0,0, -0.0001f,0,0, 0.0001f,0,0};
float[] uvs = { 0,0, 1,1, 1,0};
int[] indices = {0,1,2};

_root = new Object3D(vertices, uvs, indices, 0);

public void addToWorld(World w) {

private void drawLines() {
int verticesHandle = GLES20.glGetAttribLocation(_lineShader.getProgram(), "position");
int lineColorHandle = GLES20.glGetUniformLocation(_lineShader.getProgram(), "lineColor");
for(LineSegmentContainer ls : _lineSegments) {
GLES20.glUniform3f(lineColorHandle, ls.segmentColor.x, ls.segmentColor.y, ls.segmentColor.z);
GLES20.glVertexAttribPointer(verticesHandle, COORDS_PER_VERTEX, GLES20.GL_FLOAT, false, VERTEX_STRIDE, ls.segmentBuffer);
GLES20.glDrawArrays(GLES20.GL_LINE_STRIP, 0, ls.segmentLen);

public void addLineSegment(float[] coords, SimpleVector color) {
ByteBuffer bb = ByteBuffer.allocateDirect(coords.length * 4);
FloatBuffer vertexBuffer = bb.asFloatBuffer();
LineSegmentContainer lsc = new LineSegmentContainer();
lsc.segmentBuffer = vertexBuffer;
lsc.segmentColor = color;
lsc.segmentLen = coords.length/3;

public Object3D getRoot() {
return _root;

vertex shader
Code: [Select]
precision mediump float;

uniform mat4 modelViewProjectionMatrix;
attribute vec4 position;
//attribute vec3 normal;
varying vec4 varVertexColor;

void main(void) {
gl_Position = modelViewProjectionMatrix * position;

fragment shader
Code: [Select]
precision mediump float;

uniform vec3 lineColor;
uniform float alpha;

void main (void)
vec4 base = vec4(,alpha);//varVertexColor ;
gl_FragColor = base;

Projects / Craft The Path
« on: September 01, 2014, 08:55:26 pm »
Hi everyone.

I want to present my newest game: Craft The Path. The goal of game is to build a way (by appropriate adding or removing blocks) for the creeper, so he can walk to exit. It isn't so easy because you have limited number of blocks and pickaxe hits.
Some technical info: the game is using modified version of "flat shader" -  I call it "fake ambient occlusion", the collision of touch point and box is done by calculating line-sphere intersection, and path for creeper is created using A* (a star) algorithm.
I wanted to add to this game wallpaper (together with wallpaper editor) but there is problem with TextureManager - when the wallpaper and game are in one application then they will share TextureManager in that case the wallpaper service and game activity mess up with each others textures (I am loading resources in dedicated threads).
Link to game:

Projects / Craft World 3D Live Wallpaper
« on: March 31, 2014, 01:20:51 pm »
My another small production, with motif of Minecraft. This time I have created Minecraft world in spherical coordinates. This construction is very simple, that is why it cannot have things like caves, and another drawback - the cubes closer to poles are deformed. I have decided not to use shaders because I don't want the flat shaded surfaces (the flat shader consume more memory) and after few tests it looks like rendering the scene using GL 1 was bit faster than GL 2.
I was thinking about game using this kind of generated world, but so far I don't have reasonable ideas.

Projects / Music Ride 2
« on: December 28, 2013, 07:27:58 pm »
I would like to present second version of my game "Music Ride 2".
Compared to previous version this is much improved completly new race generation algorithm (track has turns now), much interesting game modes, possibility to shot etc.
For those who didn't know first version: Music Ride 2 is a rhytmic-racing game. Based on selected by user song it generates racing track, and our task is to collect rhythm gems, the idea of this game is very similar to PC game Audiosurf.

Support / How to force object creation?
« on: December 10, 2013, 10:02:33 am »
When I create my scene some objects are not created immediately, they are created when camera get closer to them (or camera is pointing on them not sure).
I want to avoid it, I want to force to create VBOs for all objects on scene. Is any possiblity to do that (beside moving camera to different locations)?

Projects / Pumpkin 3D Live Wallpaper
« on: October 18, 2013, 03:02:20 pm »
Hello everyone.
I decided to create small production which should put your phone in Halloween mood.
The wallpaper has two animation modes, in first the pumkin will play short scene after touch, in second mode sliding your finger across the screen rotates the pumpkin.

Projects / Voxel Craft Live Wallpaper
« on: August 13, 2013, 05:05:54 pm »
This small piece code was created using routine from my last game - it builds 3D objects from images. Wallpaper has builtin small editor so you can create your own objects.

Projects / Craft Breaker
« on: July 05, 2013, 04:26:32 pm »
Hi everyone

I would like to introduce my newest production - "Craft Breaker". It is a combination of classic Arkanoid-type game with 3D graphics in the style of Minecraft and with added multiplayer option - which makes this game also similar to another famous production - Pong, with the difference that you can play up to 4 players simultaneously.
You control bat using the accelerometer, swiping your finger across the screen changes the camera view, and if you get bored with single player game, you can invite friends to play multiplayer (co-op or battle) using Bluetooth or WiFi (in case of WiFi you have to be connected to the WiFi network).

Thanks again to Egon for changes in jPCT.
The game is using internally a kind of voxel engine to display blocks (one object for one brick was inefficient), the objects are dynamically recreated when the brick is destroyed. It is my first attempt to create multiplayer game, for communication I have used Kryonet (TCP) and my own bluetooth client/server with Kryonet serialization.

Support / Mesh optimization
« on: May 16, 2013, 09:26:37 pm »
Is there any way to disable mesh optimization, or can you add something like a switch to enable/disable it?
It might help me in 2 things:
1) speedup object creation
2) add flat shading
I wanted to create "flat shading" and I wanted to use undocumented method Mesh.addVertexAttributes(), however when I build object some vertices together with my attributes were removed from mesh (or it looks like they were removed) :(
Can you help me with this Egon please?

Projects / Craft Your Landscape - live wallpaper in Minecraft Style
« on: April 14, 2013, 09:47:48 pm »
My latest production - live wallpaper with landscape similar to Minecraft. I was forced to change the apperance of Creepers (they have ears, it is called Noncreeper now) but in it's original version it might violate some copyright.
Anyway I was trying to make flat shading int jPCT but I have failed - the landscape look nice but on few "fillers" and models you can see smooth-Gouraoud shading.

This wallpaper has a lot of bad ratings, because peoples don't know how to set live wallpaper, or they are thinking that this is a game  :D

Projects / Live wallpaper: 3D Night City Clock
« on: March 17, 2013, 12:35:23 am »
I want to present my another small production: 3D Night City Clock. It is nothing special... but the final effect with bloom shader looks great (at least on my SGS II).
Thanks to Egon for fast fix in jPCT. I am not sure if my solution is fastest but the bottleneck is in the Gaussian blur shader.

Support / Discarded geometry while rendering to texture
« on: March 04, 2013, 11:03:00 am »

I wanted to add bloom effect to scene, however sometimes when camera is moving, some of the objects are not rendered when I make first rendering to texture.
As you can see on this screen, the bloom effect of few buildings is rendered on the roof of closest buildings - the buildings closest to camera were discarded in first render pass. Can I do something about this?

Pages: [1] 2