Switching between materials for double rendering pass

Hi everyone,
the topic name might not be the best, but its all I could come up for, sorry.

Anyway, to the issue:
I am working on a little fun project and I am trying to do a “radar” sort of thing for the HUD. I know how to render to texture in order to do that but I dont know how to do the “double render” thing with changing materials. This might not even be the best way of going around it, so if you have any better ideas, do let me know :slight_smile:
What I am trying to do is:

  • main screen is a FPS type of view from the ships cockpit, rendered normally
  • then there will be a HUD element, which I want to have a wireframe view from behind the ship (check the video at the end to see how Ive done it so far)

My question is then, how can I achieve this? I tried looking through some of the methods, but I couldnt find a way to save to a variable the default materials that are loaded from the models, which I need in order to revert the objects for the first rednder of the next frame.

vid of the wireframe “radar”: http://youtu.be/nefuAGnCGVw

this is footage from a previous version, done in a different engine, i am rewriting all from scratch, this is just to show how the main view would look: http://youtu.be/xkf4P6fG0u4

You should be able to do this, by using a forced material in your own viewport/processor, similar to how the shadowprocessor works.

see normens post a bit down here http://hub.jmonkeyengine.org/forum/topic/wireframe/

Thanks for the reply.

However, that approach will turn everything into a wireframe of one color, what I’m trying to achieve is (as shown in the vid) to have a different color for the terrain and a different color for the ship, otherwise its just too hard to see anything