Jump to content

GPU texture paint


Aily
 Share

Recommended Posts

It's my own texture paint implementation, i can be wrong in some places, but it working fast enough. Only need to create drawing on many meshes (switching betwen it buffers), and check why is drawed texture so blured.

 

Anyway it's basic algorhytm only to show how it can be implemented.

 

P.S. Another way to making decals :)

P.P.S shaders and source is in archive.

post-260-0-32868400-1310435517_thumb.jpg

"Better" is big enemy of "good"

Link to comment
Share on other sites

Thank you for this!

 

When I start to paint the screen glitches out and goes to black with flickering artifacts. Damn, I want to try this!

 

It can be depended on hardware, as you can see in source, there is so simple. I'm working on GeForce 250GTS, maybe for Radeons must be some different code. What hardware do you have?

"Better" is big enemy of "good"

Link to comment
Share on other sites

Very nice !

 

Works like a charm here on my work PC with a GTS 240. A little information: if you're using Blitzmax, you don't need to distribute the engine.dll.

  • Intel® Core™ i7-8550U @ 1.80 Ghz 
  • 16GB RAM 
  • INTEL UHD Graphics 620
  • Windows 10 Pro 64-Bit-Version
Link to comment
Share on other sites

awesome ! Is there a way to draw some king a texture like bullets decals or something like that other than plain colors ? :)

 

Yeah! Need some udpate shaders and program. Now drawing color is calculated simple distance from current pixel to pen position. It's possible to put texture there and make some UV calculating code. There can be used any brush.

 

But there have two sad things:

1. Texture is one, and on buildings it must be very big. We can use maximum 2048x2048 textures, and always thinking about video memory (it can be end on one of large texture). Anyway, quality of bullets will be low. It's good effect for blood or dirt.

2. I don't know how Leadwerks working with mipmaps, because it use CreateTexture, we can't preprocess mipmaps as usual in DDS, did Leadwerks calculates mipmaps for it after we drawing, or not - i don't know :)

 

P.S. all meshes with such decals must have unique texture and "flattered" (unwrapped) UV coords.

"Better" is big enemy of "good"

Link to comment
Share on other sites

That's pretty cool. You could use that for the build-up of crud/mud and other things on a car body or window.

 

 

For bullets, damage and fire effects you might want to look into "Glyph Bombing"

http://www.yaldex.com/open-gl/ch10lev1sec6.html

 

I haven't tried an implementation in LE yet.

6600 2.4G / GTX 460 280.26 / 4GB Windows 7

Author: GROME Terrain Modeling for Unity, UDK, Ogre3D from PackT

Tricubic Studios Ltd. ~ Combat Helo

Link to comment
Share on other sites

And, as i understand, its bad choise for instanced buildings?

 

Yes, each texture must bee unique. :)

 

That's pretty cool. You could use that to for the build-up of crud/mud and other things on a car body or window.

 

 

For bullets, damage and fire effects you might want to look into "Glyph Bombing"

http://www.yaldex.com/open-gl/ch10lev1sec6.html

 

I haven't tried an implementation in LE yet.

 

Ok, will se whats that :)

"Better" is big enemy of "good"

Link to comment
Share on other sites

Hope you can convert this Glyph Bombing shader for LE it can be interesting for damage textures :P

 

No, it can't help us to draw to textures. Glyph bombing is technique to fill randow surface, i.e. for generating whole texture. Standart Leadwerks decals is still best issue i think.

 

As Vetal said, draw to texture cant be used on instanced geometry, because decal in one of them will be appear and on other too.

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