Jump to content

Generating textures on-the-fly in C(++)


Mutato
 Share

Recommended Posts

Is it possible to get access to the pixelbuffer of a texture using the C(++) API. I looked through the documentation but couldn't find any method to allow me that. I read that it's possible in the Basic API but that isn't an option for me.

Is there a possible workaround? My project really needs the capability to generate textures procedurally and it would really be a pity if I couldn't use the otherwise easy to use Leadwerks Engine for it.

 

Thank you for your time and excuse my bad english.

Link to comment
Share on other sites

It's possible (I've done it multiple times), the workaround is by using OpenGL calls directly. (eg. glTexImage2D() etc,..)

 

..there is a good user written article on how to set-up and use OpenGL inside LE, so I'd start there first, and if you need further help with OpenGL just ask here

Link to comment
Share on other sites

It's possible if set texture as render target, than draw on it by using shader, just like any shader drawing on screen.

 

Here's my old demo test about it, it's in bMax, but i think it easy to convert to c++.

 

 

5fa50335be2ca41645683ee9960383d3.jpg

"Better" is big enemy of "good"

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