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

Pages: [1]
    I am using the shadow mapping example  provided by Egon (Thanks again!) . I experimented a little
and then tried to update light position and direction in real time. But somehow  I was not able to see any changes in the shadowmap blit and the scene too ,when I changed the position and direction of light(I am using directional light present in Thomas' sampls ) .

   I am using Thomas' Game sample and his JPCT extentions (Both are Great Help ! Thanks for open sourcing them !!! ) for creating a world with a cuboid and a plane surface which is having a spotlight.
I really know nothing about shaders, but at the same time trying/eager to have some basic shadowsmapping in my work . 
What I did -
1. On My Oncreate Method I loaded custom shaders .
Code: [Select]
ZipInputStream zis = new ZipInputStream(res.openRawResource(;
ZipEntry ze;
try {
while ((ze = zis.getNextEntry()) != null) {

ShaderProvider.setShader(ze.getName(), sb.toString());

2. On my OnSrfacechanged...
Code: [Select]
shadowHelper = new cz.chladek.jpct.extension.ShadowProjector();

Code: [Select]
shadowHelper.update(world, fb);

4.  Removed
Code: [Select]

This from my ondrawframe.

Also THis is what in the update method..............
Code: [Select]
public void update(World world, FrameBuffer fb) {
if (light != null) {
if (!setted) {
Enumeration<Object3D> objects = world.getObjects();
while (objects.hasMoreElements()) {
Object3D object = objects.nextElement();
if (!object.getName().startsWith("particle")) {
PolygonManager pm = object.getPolygonManager();
int maxID = pm.getMaxPolygonID();
for (int i = 0; i < maxID; i++)
pm.addTexture(i, textureID, TextureInfo.MODE_MODULATE);
projectionMatrix = projector.getProjectionMatrix(fb, nearPlane, farPlane);
setted = true;
Camera originalCam = world.getCamera();

fb.setRenderTarget(shadowTexture, 1, 1, 1, 1, true);
Tools.renderWithShader(world, fb, depthShader);

And Tools.renderwithshader......................
Code: [Select]
public static void renderWithShader(World world, FrameBuffer fb, GLSLShader shader) {
Enumeration<Object3D> objects = world.getObjects();
while (objects.hasMoreElements()) {
Object3D obj = (Object3D) objects.nextElement();
if (obj.getVisibility()) {
GLSLShader objShader = obj.getShader();


objects = world.getObjects();
int i = 0;
while (objects.hasMoreElements()) {
Object3D obj = (Object3D) objects.nextElement();
if (obj.getVisibility()) {
GLSLShader objShader = shaders.get(i);

  ___ Result was a blank black screen .___...I also used this
Code: [Select]
shadowHelper.blitShadowMap(fb, halfW - 64, fb.getHeight() - size - 10, size);
to blit the shadowTexture ... but it is also blank white blit .

Then I did many funny experiments with different laughable  results but none produced the desired results.

also my log o/p is full of this-
02-27 10:59:17.330: I/jPCT-AE(7147): Additional visibility list (106) created with size: 512
02-27 10:59:17.350: I/jPCT-AE(7147): Additional visibility list (107) created with size: 512

Support / [Q]Non-square textures and opengl es 2 warnings.
« on: June 22, 2014, 11:22:58 am »
  The logcat shows warnings for non square textures -
06-22 14:09:44.348: I/jPCT-AE(4438): [ 1403426384351 ] - WARNING: Texture's size is 64/128, but textures should be square for OpenGL ES2.0! This may result in a black texture!

But so far it has not occurred in any of the devices which I have tested  ;D!
But I don't want it to crop up in some random device out there !
Is there  any possibility or it is okay to use it like this ?

  I am making a blender script which exports a text file which is readable in jbrush ,which I can load in android. But I am bit confused because of wrong positioning of objects in exported scene files.
for example -- I have 2 3d objects in blender and set both of their positions to different co-ords and export them  . But when I load them in jbrush/device , and set both their  translation to (0,0,0), then I want that both objects should coincide . But they are not coinciding  >:(. I want some suggestions to correct my code for positioning  of objects please help!  :-[
 screenshots- 1st is the blender pic
                       2nd is jbrush  pic

[attachment deleted by admin]

Support / About Pixelated Texture Display.
« on: November 04, 2013, 05:04:36 pm »
    I have a pixelated texture(low res 16X16) applied to a cube . But it does not appear  pixelated  . Is there something I can do ?

Support / Swapping texture data to disk increases loading time .
« on: October 06, 2013, 08:01:48 pm »
   I wanted to reduce the loading  time . Is that possible ? I mean , once the data is in the disk , I don't want it to be re-written . Is there is a way to check that ?

Support / About scene lightmaps and scene optimisation.
« on: June 25, 2013, 11:03:37 am »
      I wanted to know, can I have 2 sets of uvs for a 3d model for multitexturing (one for normal texture other for lightmap). If this is not possible is there any other suggestion.
Also I wanted to know how much polygon count ,object count ,animation are too much for a 1ghz phone.

Support / My 3d mesh is deformed after loading.(Solved)
« on: June 22, 2013, 03:46:03 pm »
      I have a .3ds model (a simple box used as a crate ) which is deformed .It simply double in height halved in width. This never happened before. Everything is running fine ....i.e no error. I'm using jbrush for scene loading.

Support / About Flat shading.(solved)
« on: June 19, 2013, 06:58:44 pm »
     I have a 3d  model and  I want it to shade it flat but I do not know how to do that.
Can Somebody throw light on this.

Support / About setting rotation correctly in 3d with physics.(Solved)
« on: February 24, 2013, 08:44:03 am »

    I have a problem in rotating my 3d box object in proportional to the jbox2d physics engine's box rotation. The rotation and translation of the physics shape is correct and my 3d box's translation are correct.But I'm messing with the rotation of my 3d box along its axis. It keeps rotating even if the rotation of the physics object has stopped and even rotates unrealistically fast or slow any time. I have never used a physics engine  before so maybe I am doing it in the wrong way. Can anybody tell me how to make it proportional.

Support / About animating textures.
« on: November 14, 2012, 11:53:37 pm »
Is it Possible to animate Textures of 3d object so that i can show something like progress bar etc?If so  then How and can i have a code snippet or/& link for the same?

Pages: [1]