Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cubical reflection map reading in mtl creates only one material from the last specified side. #269

Open
Geomazzix opened this issue Mar 24, 2020 · 2 comments

Comments

@Geomazzix
Copy link

Geomazzix commented Mar 24, 2020

When trying to load in a cubical reflection map it returns the wrong amount of materials. In my mtl file I have this code specified:
` newmtl skybox
Ns 10.0000
Ni 1.5000
d 1.0000
Tf 1.0000 1.0000 1.0000
illum 2
Ka 0.0000 0.0000 0.0000
Kd 0.5880 0.5880 0.5880
Ks 0.0000 0.0000 0.0000
Ke 0.0000 0.0000 0.0000

refl -type cube_top "../../textures/skyboxes/space/top.png"
refl -type cube_bottom "../../textures/skyboxes/space/bottom.png"
refl -type cube_front "../../textures/skyboxes/space/front.png"
refl -type cube_back "../../textures/skyboxes/space/back.png"
refl -type cube_left "../../textures/skyboxes/space/left.png"
refl -type cube_right "../../textures/skyboxes/space/right.png"`

this should be correct according to:

Though I am only getting one material back, with the last cube side specified (in this scenerio the "../../textures/skyboxes/space/right.png". I do not receive any warnings or errors from the tinyobjloader and am wondering if this is defined behaviour.

It also did not matter how much I searched for it, but I could not find any pieces about cubical reflection map loading in tinyobj. Hence I am creating this forum. In case I am wrong on this, please notify me of my wrongdoings, since I am still new to the wavefront file format.

Cheers.

@Geomazzix Geomazzix changed the title Reflection map reading in mtl retrieves wrong filepaths. Cubical reflection map reading in mtl creates only one material from the last specified side. Mar 24, 2020
@syoyo
Copy link
Collaborator

syoyo commented Mar 24, 2020

Currently tinyobjloader does not support cubemap feature. It only supports single refl line.

std::string reflection_texname; // refl

We may add std::map<std::string, std::string> cubemaps and parse

refl -type cube_top "../../textures/skyboxes/space/top.png"

into. cubemaps["cube_top"]

PR of adding cubemap feature is always appreciated!

@Geomazzix
Copy link
Author

Okay that clears things up, thank you for the quick reply. I believe a cubemap feature would help out a lot in these types of scenerios.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants