Are there decals?

Not sure if it still works though^^

Something like this could really do with being more of a built in feature of the engine.

3 Likes

I agree. Decals are somehow like particle systems - a basic effect in game engines.
Maybe we find some elegant solution (e.g. a clever shader that uses a depth buffer).
For now: create a small box and project a texture from top square to bottom square.

Thanks @destroflyer that helps.

And I agree with @DannyJo this would be a great addition.

Yes it does :smile:

Okay it works. However, I get this result:

Looks like the textures expand outwards? In the video showing this off it looks perfect.

Albeit, this is from 2012… Maybe some compatibility issues have risen since then?

Two things you could try:

  1. Flip your cube (maybe it’s projecting from down under? I mean from bottom to top?)
  2. Try a very steep angle (like -1 or +1 degree instead of 0 degree) - the perspective projection seems to work but the orthographic projection (parallel frustum, i.e. 0 degrees field of view) doesn’t work.

I have a question: How do you create this nice .gif file? Is this built into jME? :chimpanzee_smile:

I’ll try it out.

And I use Gyazo

Okay so I set the texture to repeat and got this:

looks like the projection isn’t clipped by its frustum. Any ideas?

You set it to repeat and it repeats. Nice thing! :chimpanzee_closedlaugh:

Maybe there is another flag like “scale” or something like that?
I mean, maybe this “repeat” might do exactly what it should do and you just need to use a different mechanism that might have a different name?

Nah. Before it was edge clamping on a plane. now its repeating. I need it to clip.

In the first .gif that you posted it was clipped. So you can have that if you do not set “repeat”.
Maybe I don’t understand your exact problem correctly.

Have you tried all other available options?
Have you tried to use .setScale() with values like 0.5f ?

Or this: Set the UV-coordinates on the projecting thing to things like 2.0f (U) and 2.0f (V) ?

Or this: Is there no documentation with an example?

Or this: Maybe it is not possible to achieve what you whant to achieve with this software.

Nono. Notice in the first one how the jMonkey face decal has a yellow border that expands out into infinity?

It should be stopped at the frustum drawn.

Ah okay, it’s green on my screen. Or maybe yellow for people with red-green-color-blindness.

Yes, I understand now. If you look at the video here: Projective Texture Mapping There it is okay. Did you try to do it like the guy in that video: ParallelProjection GeometryList - YouTube And it still did not work? Maybe your geometry is weird (use two flat boxes instead your concave double quad (or what that weird geometry is in your .gif files).

Might be that this plugin broke with recent changes. The code is from EARLY 2012. jME 3.0 is from LATE 2013. jME 3.1 is from LATE 2015. So maybe there was a breaking change in the core code or something like that.

Bahaha. I’m not color blind. And I figured it was changes with the engine.

Might be yellow when running jME. Might become green when .gif is encoded.
Take a look and say if you see green or yellow in the .gif you posted. :chimpanzee_smile:

Okay … if something broke, then we would very much desire this to be repaired, I guess…
Without projective textures many things don’t work (e.g. decals or car headlights in the dark).

I think that something like that would be nice in the core engine.
Since it worked in the past and maybe works now (with minor errors perhaps), this would be a task that could be achieved with not too many efforts.

@Coredevs: What do you think? :chimpanzee_smile: (@nehon) (@pspeed) (@Momoko_Fan)

Here’s my opinion:
Decals are as important and basic as particle systems.
Projective textures are basic feature like render to texture.
TestProjectiveTextures would be a nice addition to the tests.

EDIT: Or if not core, then maybe repair the plugin code of that project by people who know enough jME graphics coding stuff to do that in a couple of minutes. I would need hours or days with my currently hibernating jME 3D knowledge… :chimpanzee_wink:

It’s chartreuse. In between yellow and green, close enough to both for their to be a legit difference of opinion on which it qualifies as… Unless you know the truth: it’s neither, it’s chartreuse!

Must admit, though, that chartreuse is a lot greener when viewed on a calibrated 95% gamut monitor set to D50 color temp than it does on a stock nexus 10 :wink: