Jump to content

Project a Texture


tjheldna
 Share

Recommended Posts

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!!

trindieprod.png?dl=0spacer.png?dl=0steam-icon.png?dl=0twitter-icon.png?dl=0spacer.png?dl=0
Link to comment
Share on other sites

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.

 

post-3220-0-31850700-1348899082_thumb.jpg

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!

Link to comment
Share on other sites

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.

 

post-3220-0-31850700-1348899082_thumb.jpg

 

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

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!

Link to comment
Share on other sites

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.

 

 

Link to comment
Share on other sites

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

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!

Link to comment
Share on other sites

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?

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.

 Share

×
×
  • Create New...