Jump to content

  • Log In with Google      Sign In   
  • Create Account

#ActualHodgman

Posted 14 January 2013 - 10:34 PM

very interesting.... hm... so you are saying making a 3d model that is looked at via the viewport and then uses that model to project the 2d textures into the planes based off of the direction the player is? very generalized version of what you said... but... trying to understand it.

You make a second camera/scene, which just has the 3D grass model in it, and a second camera that is 'ortho' instead of 'perspective'.

 

Before each frame, you rotate this 2nd ortho camera to point in the same direction that your regular camera is pointing (but you don't translate/move it), and you render the 3d-grass-scene to a texture. That gives you a new grass texture to be used this frame, where the grass appears to have the (approximately) correct parallax for your main camera's viewing angle. You then use this grass-texture on the ground as usual when drawing your real 3D scene with your real camera -- it's just a regular 2D texture at this point, like an artist would usually draw for you.

 

e.g. the ortho frustum for two different viewing-angles are below -- top left is the 'regular' camera in the scene, it's rotation is used to make the ortho frustum, the grass model is then rendered using that ortho frustum (bottom), and then the resulting image is used as a texture on the regular scene (top right).

Take your 3d camera, copy it's rotation, draw the grass scene using an ortho camera using that rotation, then draw the 3d scene using your new grass texture.

 

7mP0h.png


#1Hodgman

Posted 14 January 2013 - 10:32 PM

very interesting.... hm... so you are saying making a 3d model that is looked at via the viewport and then uses that model to project the 2d textures into the planes based off of the direction the player is? very generalized version of what you said... but... trying to understand it.

You make a second camera/scene, which just has the 3D grass model in it, and a second camera that is 'ortho' instead of 'perspective'.

 

Before each frame, you rotate this 2nd ortho camera to point in the same direction that your regular camera is pointing (but you don't translate/move it), and you render the 3d-grass-scene to a texture. That gives you a new grass texture to be used this frame, where the grass appears to have the (approximately) correct parallax for your main camera's viewing angle. You then use this grass-texture on the ground as usual when drawing your real 3D scene with your real camera -- it's just a regular 2D texture at this point, like an artist would usually draw for you.

 

e.g. take your 3d camera, copy it's rotation, draw the grass scene using an ortho camera using that rotation, then draw the 3d scene using your new grass texture.

 

7mP0h.png


PARTNERS