Jump to content
  • Advertisement
Sign in to follow this  
Funkymunky

Tree Shader

This topic is 4345 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Alright I'm thinking about a pine tree vertex shader. The pine tree itself will be basically a cylinder with smaller cylinders that split off from the main trunk and are angled out and downward. The mesh will be oriented such that (0, 0, 0) is at the center of the base of the trunk, which runs up along the y axis. Now since basically I just want to sag the vertices more as they get farther away from (0, 0, 0) (in object space), I shouldn't even need to pass in any extra parameters (except maybe a wind variable, but that's ahead of what i'm thinking about just yet). So my question then is... how to code this (in hlsl, vs1_1 preferably)? How do I determine how much to offset the position.y value... I guess it should be some kind of exponential falloff such that there isn't really much saggage until you get pretty far away from the trunk.

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!