Page 1 of 1

About Shaders problem

Posted: Tue May 26, 2015 5:11 am
by 大小姐
I transplanted some shaders for drastic,but some shaders can not work and the official linear。
The following screen will shrink
Must be deleted dex Configuration

Code: Select all

<texture:1>
input=null
format=GL_RGBA
internalformat=GL_RGBA
type=GL_UNSIGNED_BYTE
min_filter=GL_LINEAR
mag_filter=GL_LINEAR
</texture>

<pass>
shader=linear.dsd 
sampler:u_sampler:u_texture=1
</pass>


And some sharders efficiency is not high。 Dropped frames

Re: About Shaders problem

Posted: Tue May 26, 2015 8:51 am
by Lordus
This can't work:

Code: Select all

sampler:u_sampler:u_texture=1
If you want 2 textures, you need 2 samplers:

Code: Select all

sampler:u_texture=0
sampler:u_sampler=1
And you also need at least 2 passes, if you want to render to texture 1 in this case. So for example:

Code: Select all

<texture:1>
input=null
format=GL_RGBA
internalformat=GL_RGBA
type=GL_UNSIGNED_BYTE
min_filter=GL_LINEAR
mag_filter=GL_LINEAR
</texture>

// This pass will render the DS screen to texture:1, using the lunar.dsd shader
<pass>
shader=luna.dsd
sampler:u_texture=0
// This line means: output to texture:1, with scale 1x
output=1:1
</pass>

// This pass will render the output of the first pass to the screen
<pass>
shader=linear.dsd
sampler:u_texture=1
</pass>