Projected Texture

Hi everyone.

I’m using JME3 now. Texture system on JME3 is changed a lot form previous version and I don’t know how implementing projected texture like jmetest/effects/TestProjectedTexture.java in JME2 repository.



http://code.google.com/p/jmonkeyengine/source/browse/branches/2.0.x/src/jmetest/effects/TestProjectedTexture.java



Do you have any idea ?



Thanks.

soh.

1 Like

To do this in jME3 is somewhat more difficult because shaders are used. You need to transform the texture by a matrix which you pass to the shader, this matrix can be generated using the ProjectedTextureUtil class in jME2.

So it is possible, just not as straightforward as you might want it to be.

I have tried this but I don't have no progress.


You need to transform the texture by a matrix which you pass to the shader

Is it mean that create new Material file (.j3md) has matrix parameter for passing it ? or Can I use SimpleTextured.j3md ?
And one more question is how to set material (projected texture) to geometries that is had another material already.

If you have plan to add these sample code, I 'm saved from it.

Sorry for my poor knowledge...
Thank you.

I am interested in this matter.

Does someone have the method of solving this matter?



thx

/bump (thread necro) :smiley:



Is anyone (planning on) working on this feature? I think projected textures is a very powerful must have feature. If no one has plans for that, I would try to get it done in jme3 (fixed function and shader based). Probably with some pointing into the right direction by the experts.

1 Like

Nope, have fun ^^

Go for it! If you make some headway, start a new thread and link back to this one for reference.

For the pointers, you should create a processor.

You may have a look at the BasicShadowRenderer.

It creates a camera to render the shadow maps and then use this camera projection matrix to render the shadow pass.

Basically you have to do the same, except that you don’t have to render the shadow map, but use a given texture.

1 Like

Actually there are two methods,



one is the one nehon mentiond,

The other would be to create a special material that does the projected texture in the fragment shader only for this materialinstance.



Both have their uses, depending on what is wanted

1 Like
@EmpirePhoenix said:
The other would be to create a special material that does the projected texture in the fragment shader only for this materialinstance.

This approach would be so easy if we had something called Sha.@%$*¨{=#&§ction.

Edit : OMFG Word Press even censored it!!! :D
@nehon said:
Sha.@%$*¨{=#&§ction.


http://www.crossfiteastvillage.com/wp-content/uploads/2011/10/Oh-Snap.jpg
1 Like

http://images.cheezburger.com/completestore/2011/8/27/aa56dfe2-ab09-47d8-9c9e-6f64263e2679.jpg

:evilmonkey:

ACtually I don’t get it, whats the problem to inject code into a shader at runtime? Thtas not the difficualt at all.

:suitmonkey:

I think its time for Empire to be Ban Ban

And yet another Thread ends in senseless flaming :wink:

Who’s flaming? You really think “thats not hard at all” deserves an answer? ^^

Who was posting the pictures with themonkey way before XD, it’s not that I started this XD

Well what shader injections are and that doing it right (not just doing it) requires some thought and work has been said long enough. We don’t want to discuss this each time do we? Also you know what happens when you … OMG, I said it already, its to laaaaaaaaaaaatee …

1 Like