Projection mapping

Hi everyone,

I’ve been trying to do this for a long time, have been going through the forum for weeks but still can’t wrap my head around doing projection mapping in Babylon

I’d like to project an albedoTexture onto several objects from the camera (or ideally just a transformNode) point of view. In this case, projecting this pre rendered image
on to this babylon scene

I have pre rendered something in 3dsmax and would like to project that render on to my Babylon scene in order to create a parralax effect when moving around with a camera. Something similar to this but with a texture2d instead of a cubemap Cubemap SKYBOX_MODE projection origin - Questions & Answers - HTML5 Game Devs Forum

My understanding is that I should create either a PBRcustommaterial or a shadermaterial to do this but my knowledge of shader writing is almost 0.

I loaded my 3d scene and the rendered texture in a playground. I’d like for my texture to be mapped on the objects from the camera view point the same way it would be if I was to use the texture has a layer without objects in the scene. The camera is imported too so is at the same location as in the render.

My questions are:
-Do you see any reason for this to not be possible?
-Has anyone done this or something similar in the past?
-If not, do you have good tutorials/docs on writing custom shaders? I looked this up (Introduction to Shaders | Babylon.js Documentation) but I don’t think this gives me quite enough info yet to build what I need and am happy to learn how to write shaders but if anyone of you has pointers on the logic that would save me quite a lot of time.

Thanks in advance for your help!


Maybe you can use the projection texture from the spot light to achieve what you want to do:

Thanks so much for linking this post. I had seen it many times late last year but I guess it was before all the new posts from December and on.

I think I mostly got what I needed to work and just need to figure out a few more settings. I’ll post my playground here when I’m done in case anyone is interested too.