tjheldna Posted September 29, 2012 Posted September 29, 2012 Hi all, Does anyone have any advice on how to project a texture in the scene? I can see many uses for this in my project, but mainly I need to project a circle at the players feet at various radius's. Can this be done with some sort of light that projects a texture? I just don't know where to begin with this so any help would be appreciated!! Quote
Road Kill Kenny Posted September 29, 2012 Posted September 29, 2012 To project a texture you paint a light with a TTexture. i.e LE::PaintEntity(light, texture) In my game I simply have a texture with alpha. I parent that to the characters mesh and it seems to work pretty well. There are decals but they have some performance issues atm and I think a light projection would also be an unnecessary performance hit as well. Quote STS - Scarlet Thread Studios AKA: Engineer Ken Fact: Game Development is hard... very bloody hard.. If you are not prepared to accept that.. Please give up now!
Roland Posted September 29, 2012 Posted September 29, 2012 Most interesting ... didn't know about that trick. Thanks for that Quote Roland Strålberg Website: https://rstralberg.com
Road Kill Kenny Posted September 29, 2012 Posted September 29, 2012 To project a texture you paint a light with a TTexture. i.e LE::PaintEntity(light, texture) In my game I simply have a texture with alpha. I parent that to the characters mesh and it seems to work pretty well. There are decals but they have some performance issues atm and I think a light projection would also be an unnecessary performance hit as well. The only problem with my texture with alpha is when I put slopes into my game it will look wrong so I'll have to find some work around for that I guess lol Quote STS - Scarlet Thread Studios AKA: Engineer Ken Fact: Game Development is hard... very bloody hard.. If you are not prepared to accept that.. Please give up now!
Rick Posted September 29, 2012 Posted September 29, 2012 I know for terrain slopes I create a plane that has many segments that I paint the texture on and then I loop through each vertex location and get the height of the terrain directly below that x,z and move the vertex y like .001 above the terrain height. Performance is a balance between how many segments the plane has which comes down to how hilly your terrain is to give a nice look. Could probably do the same for models if you can get the y value of the x,z position on a model. Quote
AggrorJorn Posted September 29, 2012 Posted September 29, 2012 or the lua variant: http://www.leadwerks.com/werkspace/files/file/173-projector-light/ Quote
Road Kill Kenny Posted September 29, 2012 Posted September 29, 2012 I know for terrain slopes I create a plane that has many segments that I paint the texture on and then I loop through each vertex location and get the height of the terrain directly below that x,z and move the vertex y like .001 above the terrain height. Performance is a balance between how many segments the plane has which comes down to how hilly your terrain is to give a nice look. Could probably do the same for models if you can get the y value of the x,z position on a model. If the performance hit is smaller than the current decal system then why not Quote STS - Scarlet Thread Studios AKA: Engineer Ken Fact: Game Development is hard... very bloody hard.. If you are not prepared to accept that.. Please give up now!
ChrisMAN Posted September 29, 2012 Posted September 29, 2012 I know for terrain slopes I create a plane that has many segments that I paint the texture on and then I loop through each vertex location and get the height of the terrain directly below that x,z and move the vertex y like .001 above the terrain height. Performance is a balance between how many segments the plane has which comes down to how hilly your terrain is to give a nice look. Could probably do the same for models if you can get the y value of the x,z position on a model. How do you find the terrain height directly below each vertex? Quote
Rick Posted September 29, 2012 Posted September 29, 2012 http://www.leadwerks.com/werkspace/page/Documentation/le2/_/command-reference/terrain/terrainheight-r414 Quote
Recommended Posts
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.