Author Topic: setEnvmapped and envmap texture change problem on compiled objects  (Read 2378 times)

Offline Wojtek

  • int
  • **
  • Posts: 62
    • View Profile
Hello,

I have found problem with envmap textures on compiled objects.
Basically if object is compiled it is not possible to change envmap texture using PolygonManager.setPolygonTexture() method.

Steps to recreate:
1. set Config.glForceEnvMapToSecondStage = true;
2. create sphere using Primitives class
3. call calcTextureWrapSpherical(), build(), setEnvmapped(true)
4. assign two textures (some texture and envmap one)
5. call compile()
6. try to change textures to different ones

Expected results:
Both textures are changed and displayed correctly

Actual results:
Only first texture has been changed. It is not possible to change envmapped texture. If shared is used, it also does not get new texture


Optional steps using ObjectsEditor:
1. Download editor from: http://www.wojtech.virthost.pl/oe/oe_envmap.zip and run it using run.bat or run.sh
2. Create sphere from primitives
3. select expo_bamboo.png as Texture1 and set it's TextureMode to Multiply
4. select _env.png as EnvmapTexture and set it's TextureMode to Add [Both textures are visible]
5. change EnvmapTexture to _env2.png [Texture has been updated]
6. click Compiled checkbox [Object has been compiled correctly, textures are working ok]
7. change Texture1 and EnvmapTexture to other values

Actual result:
Texture1 has been changed
EnvmapTexture has not been changed

Thanks,
Wojtek

PS. One additional update: Calling setEnvmapped() has also no effect on compiled object.
« Last Edit: August 21, 2011, 10:51:11 pm by Wojtek »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11770
    • View Profile
    • http://www.jpct.net
Re: setEnvmapped and envmap texture change problem on compiled objects
« Reply #1 on: August 22, 2011, 06:56:44 am »
I'm not sure ATM if this is a bug or by design...i'll look into it.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11770
    • View Profile
    • http://www.jpct.net
Re: setEnvmapped and envmap texture change problem on compiled objects
« Reply #2 on: August 22, 2011, 09:15:21 pm »
Try this jar: http://www.jpct.net/download/beta/jpct.jar

It should fix the problem. Please let me know if that helps.

And i don't get the PS...

Offline Wojtek

  • int
  • **
  • Posts: 62
    • View Profile
Re: setEnvmapped and envmap texture change problem on compiled objects
« Reply #3 on: August 23, 2011, 12:54:00 am »
It is much better :)

Thanks,
Wojtek