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

[QUESTION] How add decals to textures #733

Open
ggand0 opened this issue Oct 13, 2022 · 5 comments
Open

[QUESTION] How add decals to textures #733

ggand0 opened this issue Oct 13, 2022 · 5 comments
Labels
enhancement New feature or request first answer provided question Question, not yet a bug ;)

Comments

@ggand0
Copy link

ggand0 commented Oct 13, 2022

Hello,

Thanks for developing this awesome tool.
I was wondering how to add decals to textures in BlenderProc. If there's no way to perform this, I'd like to request this feature.

What I want to achieve is to randomly place dirt or damage decals (also randomly generated) on a model texture to simulate imperfect objects. I'm aware of MaterialUtility.infuse_texture method, but this rather "blends" two textures together. I'm looking for a method that overlays one or multiple small textures over another texture.

I'd appreciate if you could share any insights on this topic. Thanks in advance!

VideoScreenshot - YouTube - 2’20”

@themasterlink
Copy link
Contributor

Hey,

a great question. I thought about it a bit.

You should use the multiple UV map feature for this, allowing you to position multiple textures on one object.
These can then be selected via the UV Map shader node, and then you just have to fuse them as you have seen in the infuse_texture method.

Does this help?

PS: We are always looking for contributions ;)

Best,
Max

@themasterlink themasterlink added enhancement New feature or request question Question, not yet a bug ;) first answer provided labels Oct 13, 2022
@ggand0
Copy link
Author

ggand0 commented Oct 13, 2022

Hi Max,

Thank you for your reply and suggestion!
I feel that using multiple UV maps and the infuse_texture method with 'overlay' option would work. I'll play around with the codes and see how it goes.

On the other hand, I was imagining another method where we project decal textures onto model geometry. An example this would be bullet hole decals on objects in shooter games. I also found a three.js demo doing something close to this. Is this possible to do in blenderpy / BlenderProc? Would love to hear your thoughts on this approach too :)

@themasterlink
Copy link
Contributor

Hey,

That sounds like a plan.

To do it interactive in the blender GUI? Or to do it automatically in the code with bpy and bproc? In the code should work as you described.

Best,
Max

@ggand0
Copy link
Author

ggand0 commented Oct 13, 2022

I meant doing it automatically in bpy & bproc.
Thanks for your feedback, I'll also dig into the second approach.

@themasterlink
Copy link
Contributor

Looking forward to your results ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request first answer provided question Question, not yet a bug ;)
2 participants