Author Topic: Simple object with specular etc?  (Read 1207 times)

Offline jaccunio

  • byte
  • *
  • Posts: 4
    • View Profile
Simple object with specular etc?
« on: January 07, 2012, 03:25:51 pm »
I started playing with jpct-ae yesterday - so far I'm impressed.
Now I'm trying to achieve some nicely looking materials:
I'm loading 3ds file exported from 3ds max (a kettle for example) and even tough I set setSpecularLighting to true, it doesn't look very good.
I suppose that a shader would do the job, but I've no experience with writing shaders. Are there any basic shaders available to use with with jpct-ae?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11776
    • View Profile
    • http://www.jpct.net
Re: Simple object with specular etc?
« Reply #1 on: January 07, 2012, 05:47:49 pm »
"Doesn't look very good" is a bit vague...a screen shot might help. Anyway, to answer your question: Yes, a shader might help but you need an ES 2.0 capable device for this (and it doesn't work in the emulator). With current devices, this isn't an issue though. Currently, there's no real shader library or something like that. You'll find a parallax mapping shader in the HelloShader-example and some other stuff in the forum. What might also help are the default shaders that can be found in the jar. They are used to mimic the fixed function pipeline's behaviour when using the ES 2.0 render pipeline. Maybe you can tweak one of those to suit your needs. If not, any OpenGL ES shader tutorial (the ones for iPhones will do too) should help too. 

Offline jaccunio

  • byte
  • *
  • Posts: 4
    • View Profile
Re: Simple object with specular etc?
« Reply #2 on: January 07, 2012, 06:13:10 pm »
Thanks for the answer. I'm looking into shaders now.
Btw, is something like this http://youtu.be/qWVJKfOhFTA?t=4m29s (except for shadows) possible to achieve in jpct-ae?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11776
    • View Profile
    • http://www.jpct.net
Re: Simple object with specular etc?
« Reply #3 on: January 07, 2012, 08:53:12 pm »
Yes. You can do almost everything with shaders. However, performance of mobile devices is still very limited especially when using complex fragment shaders.