RenderKit / ospray

An Open, Scalable, Portable, Ray Tracing Based Rendering Engine for High-Fidelity Visualization
http://ospray.org
Apache License 2.0
1k stars 182 forks source link

Questions about creating Metal type Sand material #365

Closed ryanwentaoxu closed 4 years ago

ryanwentaoxu commented 4 years ago

I am trying to replace the material in tutorial with sand material, as I know that sand material is Metal type, so I tried to send some parameter like 'eta','k' into the Metal material, while I checked the source code in Metal.cpp and Metal.ispc, I didn't find parameter 'reflectance', how can I create a sand like material through these parameters?

BruceCherniak commented 4 years ago

http://www.ospray.org/documentation.html documents all of the current material properties. Do you have a reference to this "sand material" you are trying to create?

ryanwentaoxu commented 4 years ago

@BruceCherniak Hi! Thanks. Yes I have a link: https://github.com/carsonbrownlee/example_materials/blob/master/knobs/sand.mtl I really don't know how to transfer this into my codes. Best regards

BruceCherniak commented 4 years ago

Just from looking at it, I don't believe those parameters will produce the effect you are looking for.

Sand is a very complex material depending a lot on how convincing a "sand" look you are trying to achieve. If all you are looking for is a "rough tan-ish diffuse" look, that can be achieved with the OBJMaterial. A bit better would be to add a bump map (https://www.google.com/search?q=sand+bumpmap). A more realistic look will require the "Principled" material.

Perhaps @carsonbrownlee can comment further?

ryanwentaoxu commented 4 years ago

@BruceCherniak Thank you so much!

ryanwentaoxu commented 4 years ago

@BruceCherniak Hi Bruce! Sorry to ask that does something that can convert these .obj files or .mtl files into things which I can use in my codes? I am sorry I am new to OSPray. Thanks. Best regards

BruceCherniak commented 4 years ago

@CassiniXu, .obj and .mtl are quite popular/standard file formats. The code that OSPRay uses to read/import these files is called "tinyobjloader" (https://github.com/syoyo/tinyobjloader). Without knowing more about your code, it is difficult to advise you.

I'm going to close this issue, since we are no longer talking about a potential OSPRay issue/bug. Please feel free to contact me via email and I'll try to help you further.

Cheers, Bruce