Main Menu
Menu

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.

Show posts Menu

Messages - bfreuden

#1
Support / Re: Changing PNG texture brightness
June 15, 2014, 10:30:16 AM
You're welcome! Thanks again for your help and for your work on jPCT.
#2
Support / Re: Changing PNG texture brightness
June 03, 2014, 07:21:08 PM
Hi,
You might think I'm obtuse :( but I really have the impression the HelloWorld-AE project also adds another texture (the aquarium) to the one created from the icon (the gear). Here is the code:

// Create a texture out of the icon...:-)
Texture texture = new Texture(BitmapHelper.rescale(BitmapHelper.convert(getResources().getDrawable(R.drawable.icon)), 64, 64));
TextureManager.getInstance().addTexture("texture", texture);

try {
Texture texture2=new Texture(getResources().getAssets().open("alpha.png"), true);
TextureManager.getInstance().addTexture("texture2", texture2);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
TextureInfo ti=new TextureInfo(TextureManager.getInstance().getTextureID("texture"));
ti.add(TextureManager.getInstance().getTextureID("texture2"), TextureInfo.MODE_DECAL);

And changing the ambiant light or the light values have no effect on the texture lighting in the HelloWorld-AE project (as downloaded from http://www.jpct.de/download/net/jpct-ae.zip).
Best regards,
#3
Support / Re: Changing PNG texture brightness
June 02, 2014, 11:04:34 PM
Hi,
You're right! Thank you very much!
Shall I post a (minor) bug since this is a copy/paste of the HelloWorld-AE (cube) example delivered in the jpct-ae.zip file?



In case others might find it useful, here is the code working correctly:

Texture texture =  new Texture(getResources().getAssets().open("Turret_01.bmp"), true);
TextureManager.getInstance().addTexture("texture", texture);
TextureInfo ti=new TextureInfo(TextureManager.getInstance().getTextureID("texture"));
turret.setTexture(ti);



Best regards,
#4
Support / Re: Changing PNG texture brightness
June 01, 2014, 11:04:27 PM
Hi,

Thanks a lot for your answer!
Here is the code of my OnSurfaceChanged method (I removed try/catch and streams close() for the sake of readability).
It is widely based on the HelloWorld-AE project (having the same "problem" btw):



This is easy to reproduce using the HelloWorld-AE project:

  • Comment the /cube.calcTextureWrapSpherical();/ and /cube.setTexture(ti);/ lines
  • Observe the lighting
  • Change the sun intensity /sun.setIntensity(2, 2, 2);/
  • Observe the change of the lighting 
  • =>This change can no longer be observed if you uncomment the first two lines (well... at least on my device and on my emulator)

Thanks in advance for your help,


#5
Support / Re: Changing PNG texture brightness
June 01, 2014, 01:54:00 PM
Thanks for the fast reply!
Unfortunately it didn't do the trick. I have modified my lighting modification function according to your suggestion:



And this is the result depending on whether I add a texture or not to my object:



I actually wonder if the default shader handles this. However as I am an OpenGL+jPCT-AE+Android newbie, I also wonder if I missed something obvious :)
Thanks again in advance for any tip!


#6
Support / Changing PNG texture brightness
May 31, 2014, 03:54:23 PM
Hi,

I am writing both my first Android and first OpenGL ES application and I am happy because I have the feeling it would have been much more complex without jPCT-AE :)
I am here because I have a problem changing the brightness of a png texture.

I have successfully managed to modify the jPCT-AE HelloWorld project in order to load an obj+mtl+png combo, and to add a SeekBar that modifies the intensity of the Light object (sun) and the color of the background (back).
It works great when I don't add the texture to my object: I can see the object becoming brighter or darker (good!).
However if I add the texture to my object (object.setTexture(ti)), it is no longer affected by the brightness: its appearance does not change at all, only the background color changes.

Do you know why it is so, and how I can solve my problem?
Thanks in advance,

Bruno.