Several questions about textures and shaders with construct.

For questions about using Classic.

Post » Thu Nov 18, 2010 9:06 am

Hi,

I'm thinking about making some mini game systems for -mostly- visual purpose (portfolio), and i was wondering if :
- it's possible to extract independently the R, G and B channels of a texture to treat them separately (with shaders) ?
- if the size of a texture used in a level should be using a power of 2 (128*256 etc.) to increase performances ?
- if construct can work with tiling textures the 3d way (you can tile as many time as you wish a bitmap on a defined surface)
- if it is possible to post process the entire screen at once (lens vignetting) ?

Thanks in advance.
B
72
S
15
G
4
Posts: 311
Reputation: 11,609

Post » Thu Nov 18, 2010 11:01 am

[quote="Valerien":1iqgdpv5]- it's possible to extract independently the R, G and B channels of a texture to treat them separately (with shaders) ?[/quote:1iqgdpv5]
If you only need to output to screen, then yes, this is easy with pixel shaders. If you want to save such altered textures, you would need the canvas/image manipulator objects.


[quote="Valerien":1iqgdpv5]- if the size of a texture used in a level should be using a power of 2 (128*256 etc.) to increase performances ?[/quote:1iqgdpv5]
No. General size, count and the display size matter, but a non power of two texture shouldn't affect performance (if the gfx card requires such texture formats, the image you use will be stored as a padded power of two anyway).


[quote="Valerien":1iqgdpv5]- if construct can work with tiling textures the 3d way (you can tile as many time as you wish a bitmap on a defined surface)[/quote:1iqgdpv5]
Not sure, what exactly you have in mind. The tiled background object does that, but I assume you want to tile some other shaped objects? If so, this is possible indirectly, using the shape as a mask and project other objects like the tb onto it (using pixel shaders).


[quote="Valerien":1iqgdpv5]- if it is possible to post process the entire screen at once (lens vignetting) ?[/quote:1iqgdpv5]
Yes. Some effects work very well as layer effects, processing the whole background to that layer. Furthermore the canvas object, set to "after drawing" also is suitable as a post processor. (btw: there already is a good vignette shader that ships with Construct)
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242

Post » Thu Nov 18, 2010 11:24 am

Thank you for your answers.

[quote="tulamide":8en33ndz]If you only need to output to screen, then yes, this is easy with pixel shaders. If you want to save such altered textures, you would need the canvas/image manipulator objects.[/quote:8en33ndz]

In fact, i'd like to be able to import like 3 mask textures packed into a single RGB file, as the memory will handle it as a single texture. I'd use those for operation on the screen like to simulate the shadow of the clouds on the ground or so.

[quote="tulamide":8en33ndz]Not sure, what exactly you have in mind. [/quote:8en33ndz]

Here's what I meant :



It can be usefull to avoid creating too small tiles with several variations (using a single really detailed 512 texture instead, which leaves you the possibility to put more stuff in it). Would also it have an impact on performance on huge surfaces (like a dungeon) ?
B
72
S
15
G
4
Posts: 311
Reputation: 11,609

Post » Thu Nov 18, 2010 12:33 pm

[quote="Valerien":dg5wwsw0]Thank you for your answers.

[quote="tulamide":dg5wwsw0]If you only need to output to screen, then yes, this is easy with pixel shaders. If you want to save such altered textures, you would need the canvas/image manipulator objects.[/quote:dg5wwsw0]

In fact, i'd like to be able to import like 3 mask textures packed into a single RGB file, as the memory will handle it as a single texture. I'd use those for operation on the screen like to simulate the shadow of the clouds on the ground or so.

[quote="tulamide":dg5wwsw0]Not sure, what exactly you have in mind. [/quote:dg5wwsw0]

Here's what I meant :



It can be usefull to avoid creating too small tiles with several variations (using a single really detailed 512 texture instead, which leaves you the possibility to put more stuff in it). Would also it have an impact on performance on huge surfaces (like a dungeon) ?[/quote:dg5wwsw0]

I've toyed with that using a distort map. The U, and V are tileable.
I didn't notice a big hit to performance, but you are limited on rows/ columns.
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Post » Thu Nov 18, 2010 7:17 pm

[quote="Valerien":367g5uxs]In fact, i'd like to be able to import like 3 mask textures packed into a single RGB file, as the memory will handle it as a single texture. I'd use those for operation on the screen like to simulate the shadow of the clouds on the ground or so.[/quote:367g5uxs]
I see. And I confirm. This is a task for pixel shaders und doable (although not easy). Depending on your needs you have to write them first, of course. Feel free to pm me, should you get in trouble regarding Construct's implementation of HLSL.
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests