Hello,how could i load normal map in obj?

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Hello,how could i load normal map in obj?

ravenocean
I can load warefront obj file in jogl like this:


but i can not add normal mapping in obj file ,
it's keyword is "map bump" or just "bump" in mtl file.
is there some one can give me some advice?
Thank you very much!
你们好!
很高兴跟大家一起学习JOGL
Reply | Threaded
Open this post in threaded view
|

Re: Hello,how could i load normal map in obj?

gouessej
Administrator
Hi

There are several OBJ loaders in JOGL and JOGL-Utils but personally, I use Ardor3D which supports WaveFront OBJ both as an import format and an export format. Its wiki is here:
https://github.com/Renanse/Ardor3D/wiki

This is a simple example allowing to load and display the content of an OBJ file:
https://github.com/Renanse/Ardor3D/blob/master/ardor3d-examples/src/main/java/com/ardor3d/example/pipeline/SimpleObjExample.java
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Hello,how could i load normal map in obj?

Sven Gothel
Administrator
On 11/28/2013 02:20 PM, gouessej [via jogamp] wrote:

> Hi
>
> There are several OBJ loaders in JOGL and JOGL-Utils but personally, I use
> Ardor3D which supports WaveFront OBJ both as an import format and an export
> format. Its wiki is here:
> https://github.com/Renanse/Ardor3D/wiki
>
> This is a simple example allowing to load and display the content of an OBJ file:
> https://github.com/Renanse/Ardor3D/blob/master/ardor3d-examples/src/main/java/com/ardor3d/example/pipeline/SimpleObjExample.java
>
besides .. we also have OBJ loader in jogl-demos and jogl-utils.
The latter is quite unmaintained and may not work at all.
jogl-demos AFAIK contains at least two OBJ loader w/ demos.
Consider those if you like to be more 'native' w/o a scenegraph.

However, Ardor3D's utilities are for sure more matured.

~Sven


signature.asc (911 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Hello,how could i load normal map in obj?

gouessej
Administrator
Sven Gothel wrote
besides .. we also have OBJ loader in jogl-demos and jogl-utils.
The latter is quite unmaintained and may not work at all.
jogl-demos AFAIK contains at least two OBJ loader w/ demos.
Consider those if you like to be more 'native' w/o a scenegraph.
This OBJ loader requires normals which shouldn't be mandatory and it is extremely poor:
https://github.com/sgothel/jogl-demos/blob/master/src/demos/util/ObjReader.java

This OBJ loader is in JOGL-Utils and supports more things but its MTL support is very poor, I haven't tested it:
https://github.com/sgothel/jogl-utils/blob/master/src/net/java/joglutils/model/loader/WaveFrontLoader.java

Sven Gothel wrote
However, Ardor3D's utilities are for sure more matured.
I understand your position, some developers sometimes want a very lightweight loader without having to use a whole scenegraph but implementing fully working loaders requires to manage entities typically present inside a scenegraph. Ardor3D's loaders have been heavily tested, Ardor3D WaveFront OBJ loader doesn't support only a very few keywords.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Hello,how could i load normal map in obj?

ravenocean
In reply to this post by ravenocean
hello,

  Thank you for telling me the sample.

  but i haved check the ardor3D 's obj loader,
  in ardor3D is the class of :com.ardor3d.extension.model.obj.ObjImporter,
  not support the key word "map bump"
 
  and the JME3 's obj loader is the class of :com.jme3.scene.plugins.MTLLoader ,
  seems to be supporting for normal mapping ,
  but i loaded a model and did not saw the normal mapping effect,
  so i will keep learning.
  Thank you!
 
你们好!
很高兴跟大家一起学习JOGL
Reply | Threaded
Open this post in threaded view
|

Re: Hello,how could i load normal map in obj?

gouessej
Administrator
This post was updated on .
ravenocean wrote
  but i haved check the ardor3D 's obj loader,
  in ardor3D is the class of :com.ardor3d.extension.model.obj.ObjImporter,
  not support the key word "map bump"
I can implement this feature in Ardor3D if you really need it.

Edit.: This example uses normal mapping:
https://github.com/Renanse/Ardor3D/blob/master/ardor3d-examples/src/main/java/com/ardor3d/example/pipeline/AnimationBlinnPhongExample.java
 
ravenocean wrote
  and the JME3 's obj loader is the class of :com.jme3.scene.plugins.MTLLoader ,
  seems to be supporting for normal mapping ,
  but i loaded a model and did not saw the normal mapping effect,
Maybe you have to turn something on, in the lights.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Hello,how could i load normal map in obj?

ravenocean
hello

Thank you gouessej
 
I have learned a c++ sample of normal mapping,and converted it to the jogl way,and the screenshot is :



but i am confused about the obj 's normal and normal mapping 's tangent space 's normal,because i just begin to learn opengl with learning jogl.

so ,if you would implement this feature,i am very thank you,
and i found that to output obj file from 3dmax ,will often with the blue texture image.
你们好!
很高兴跟大家一起学习JOGL
Reply | Threaded
Open this post in threaded view
|

Re: Hello,how could i load normal map in obj?

gouessej
Administrator
ravenocean wrote
hello

Thank you gouessej
You're welcome.

ravenocean wrote
I have learned a c++ sample of normal mapping,and converted it to the jogl way,and the screenshot is :



but i am confused about the obj 's normal and normal mapping 's tangent space 's normal,because i just begin to learn opengl with learning jogl.

so ,if you would implement this feature,i am very thank you,
and i found that to output obj file from 3dmax ,will often with the blue texture image.
Actually, there is nothing to add into Ardor3D, you can use the first simple example and mix it with the second one that uses the normal mapping but I realized that I can't do that directly in the existing loader because it would force the use of a shader under the hood, I have found no smart way of doing that :s

If you stick with JMonkeyEngine 3, you can ask for help on its forum, I know that some developers use normal mapping, they can help you in making your example work.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Hello,how could i load normal map in obj?

ravenocean
In reply to this post by ravenocean
That is all right,
Thank you.
你们好!
很高兴跟大家一起学习JOGL