Jump to content

Buffer questions.


Thareh
 Share

Recommended Posts

Hi!

Since I didn't get any answers on my previous topic (LINK) and I've been stuck on this for several days, I'm posting under the General Discussion instead.

And the questions are probably more aimed to Josh since no one have been able to answer.

 

1. Since it's not recommended to use buffers smaller than 64x64, how would I go ahead and create a texture smaller than 64x64 and render to it? (I used buffers before)

2. Is it possible to clear a buffer so that it's transparent instead of white? And if so: how?

 

Thanks.

Core2Duo, 3.33GHz, Radeon HD 5850 Black Edition, 4GB RAM, 4 TB HDD, Windows 7.

Core2Duo, 2.00GHz, Geforce 9500m, 4GB RAM, 320 GB HDD, Windows 7.

Link to comment
Share on other sites

1. Not recommended probably means it won't run on all cards, but nothing runs on all cards anyway. You could check if the card support smaller than 64x64 textures, and if not, then just render it on a 64x64 texture and scale the image smaller on screen.

2. Transparency works with any color, you just need to set the alpha value.

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

Okey, Thanks Lumooja.

But the problem with using buffer smaller than 64x64 is this: LINK. Any way to solve this?

I've tried clearing the buffer with the alpha set to 0, but it still won't be transparent.

Core2Duo, 3.33GHz, Radeon HD 5850 Black Edition, 4GB RAM, 4 TB HDD, Windows 7.

Core2Duo, 2.00GHz, Geforce 9500m, 4GB RAM, 320 GB HDD, Windows 7.

Link to comment
Share on other sites

Okiedokie, Thanks Josh.

What about the transparency issue then?

I just can't get a buffer to be cleared into "nothing"/transparency.

Core2Duo, 3.33GHz, Radeon HD 5850 Black Edition, 4GB RAM, 4 TB HDD, Windows 7.

Core2Duo, 2.00GHz, Geforce 9500m, 4GB RAM, 320 GB HDD, Windows 7.

Link to comment
Share on other sites

Since I'm using buffers to do a Render to Texture routine it would be like masked, if you create an image in Photoshop with a transparent background and then you can paint whatever you want on it, and the areas you haven't touched will be transparent :)

Core2Duo, 3.33GHz, Radeon HD 5850 Black Edition, 4GB RAM, 4 TB HDD, Windows 7.

Core2Duo, 2.00GHz, Geforce 9500m, 4GB RAM, 320 GB HDD, Windows 7.

Link to comment
Share on other sites

I've tried that already, Doesn't seem to do the trick! :S

 

Local Buffer:TBuffer = CreateBuffer( W, H, BUFFER_COLOR )
SetBuffer( Buffer )
SetColor( Vec4( 1, 1, 1, 0 ) )
ClearBuffer()
SetColor( Vec4( 1 ) )

 

SetColor( Vec4( 1, 1, 1, 0 ) )
Local Buffer:TBuffer = CreateBuffer( W, H, BUFFER_COLOR )
SetBuffer( Buffer )
ClearBuffer()
SetColor( Vec4( 1 ) )

 

Tried both of these without any change :)

Core2Duo, 3.33GHz, Radeon HD 5850 Black Edition, 4GB RAM, 4 TB HDD, Windows 7.

Core2Duo, 2.00GHz, Geforce 9500m, 4GB RAM, 320 GB HDD, Windows 7.

Link to comment
Share on other sites

Gah, Found the problem.

Was on my end all along :)

Thanks for the quick response now! I got it all solved! :D

Core2Duo, 3.33GHz, Radeon HD 5850 Black Edition, 4GB RAM, 4 TB HDD, Windows 7.

Core2Duo, 2.00GHz, Geforce 9500m, 4GB RAM, 320 GB HDD, Windows 7.

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