Jump to content

how to create geometry from the shader?


Netvudu

Recommended Posts

I need to create boxes from the shader, so that they only show at render time. They should be created from flat planes created at the modelling dept. The box of course renders properly when the camera moves.

I suppose this is possible, but being quite new to shaders I don´t know how I would go about doing this...I don´t need a great shading of this shading-created geometry. Just displaying a texture with a constant shading might be enough....

Any initial ideas/directions?

Link to comment
Share on other sites

Look into delayed load. It is basically loading the geometry at rendertime... with the advantage that your ifd file is lighter as it only contains the path to the bgeo on disk.

Warning: try to stay away from motionblur and ray tracing as they will most likely cause your render to absorb too much memory (because the geometry is kept in memory rather than freed when no longer needed by any of the tiles). The clusterthis (mentioned before) might be better, but I have not tried it yet.

Link to comment
Share on other sites

Thanks both for the input. I have used the delayed loading before, but I thought there would be a way of faking geometry strictly from shading as opposed to calling it at render time, as delayed loading does.

I´ll try this way.

hmm, there could be a fake around this too... just like the old quitcktime VR approach.

This would be very restrictive in term of shadows.

You would render the box from a lot of angles and use those renders as a lookup in a sprite. Depending on the angle of the camera versus the local coordination system of the object you load a different image.

I don't know that much about relighting with normal maps, perhaps that can be linked in for basic relighting, but you will not get self-shadowing or shadows on other sprites.

The advantage would be that you would only have to render those lookup maps once of potentially super heavy geometry. -once you have the maps it really doesn't matter whether the geometry was heavy or not, it's just a sprite.

This is very much a hack, but if it's for background or just for boxes it might work for your scenario.

Link to comment
Share on other sites

Hi Javi.

Are they creating the planes as placeholders???

So basically yo uchange the plane by a box???

If this is the case then I think that creating the geometry (or faking it) at render time is really complicated is not worth to try it.

Is mor easy to get points from the planes to place your boxes, create proper scale and rotation attribute for the points and do point instancing.

I think is much more easier, it performs really well and you get all the shadowing/motion blur/depth of field problems solved.

Salut

Link to comment
Share on other sites

That should work as well. The whole idea came from "Batman Begins". I read they used a Renderman shader to populate buildings with interior rooms at render time, and I thought it was the shader the one making the job, but maybe it was archiving a.k.a delayed loading. The article didn´t specify it.

I recently found a Lightwave plugin that does precisely this Eurisko Studios vRoom, so I thought it might be something doable in houdini.

I think I know how to do this both as delayed loading or point instancing, but from the docs of this Lightwave plugin it would look like they are creating that geometry from shading tricks. This idea is reinforced by the fact that FPrime (LW´s almost real time renderer) does see vRoom rooms. If it was some sort of delayed loading or instancing it wouldn´t, hence it must be faked at shading time.

Edited by Netvudu
Link to comment
Share on other sites

In my opnion the main thing vRoom is doing is applying a cube texture, with the room stuff in it, to boxes that represent every room.

Looking at the render examples they seems to me as testures. So if you have a lot of them applying them randomly gives you the eral feeling of lots of of different rooms.

the perlin noise applied to the windows helps to give you the distortion effect produced by them, but I think it just apply a glass shader (probably is even not doing raytracing just semi transparent surface) to one of the sides of the cube and the textures to the rest.

they says pseudo geomtry, what is this? I dont know, I think is probably using the texture to get some dispalcement also, not sure, but depending of the camera position just textures is enough.

In Batman Begins almost all the trick are textures with proper projections.

Link to comment
Share on other sites

The problem with your initial theory is that boxes are NOT in the original building model. It´s just flat windows and the plugin creates the interiors "automagically".

It says pseudo geometry because the original building is just the windows faces...no cubes for interiors at all. The rooms get created at render time...or so I thought. Fprime (IPR good equivalent for Lightwave) can see it and that means it´s no instancing or delayed loading, because in that case Fprime wouldn´t see it.

The glass makes proper fresnel effect which tells me it´s some sort of glass shader, but it´s the "pseudogeometry" cube thing that got me stumped. I´m still unsure about how they are doing that.

Link to comment
Share on other sites

Mmm at least you have to say to the plugin what is a window in your geometry I dont think the plugin can guess if a primitive is a window or not, otherwise it will be more ibntelligent that us :)

So what about if you put all the faces that are to be windows in a prim group, in a forEach loop go prim by prim and creates the neede geo for the room?

Probably the file I have attached can give you any ideas.

roomsTest.hip

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...