giacomo986 wrote:Good to know, so maybe i'll need new functions from minetest engine, i need to use OpenGL Stencil Buffer because i need to render the world with multiple viewpontis
Look in the particles code src/script/lua_api/l_particles.cpp as a basic starting point (and follow his #include's) for adding script functionality. You'll then want to look at the corresponding stuff in server-related .cpp's (what you are looking for here is where it tells the client about new objects so you can add code to tell the client about the existence of your portals) and then hunt for the client code that responds to these kinds of server messages (in the example case the client code responding to the server's messages telling the client of the existence of particles).
There's some hunting for where to code stuff because the server and client are not the same beast and while the server needs to register and track the existence of something (in the referenced code a particle, in your case a new portal), it is the client who actually renders it, hence why scripts do not directly access OpenGL since most (except perhaps the mainmenu stuff) scripts are server-side only.
So you use scripting to have the server tell your client "10 paces to the right at 3 o'clock is your fancy portal" and then within the code of only client .cpp sources lie your code to implement your render algorithm for any "your fancy portals" found within the visible viewing frustum.