View unanswered posts | View active topics It is currently Sat May 26, 2018 6:41 pm



Reply to topic  [ 3 posts ] 
 Does the Geometry Shader not accept definable uniforms? 
Author Message

Joined: Sun Mar 08, 2009 7:24 pm
Posts: 103
I've been attempting to reduce the amount of input that gets sent to the vertex shader by having the geometry shader handle generating vertices that are a set distance from the single vertex input through the use of uniforms. When using a uniform constant set from within the shader, it works fine, but when I shift it to program code where other uniform functions reside (which are used for the vertex shader) for the designated command list, it displays nothing, even when using the same static values that make up the uniform when it was constant.


Wed Mar 25, 2015 11:23 pm
Profile

Joined: Thu Jul 02, 2009 1:19 pm
Posts: 349
Discostew wrote:
I've been attempting to reduce the amount of input that gets sent to the vertex shader by having the geometry shader handle generating vertices that are a set distance from the single vertex input through the use of uniforms. When using a uniform constant set from within the shader, it works fine, but when I shift it to program code where other uniform functions reside (which are used for the vertex shader) for the designated command list, it displays nothing, even when using the same static values that make up the uniform when it was constant.

Did you take a look at the text.vsh shader in portal3ds? It looks like smea is using a uniform with emitted vertices in the geometry shader.


Thu Mar 26, 2015 12:18 am
Profile

Joined: Sun Mar 08, 2009 7:24 pm
Posts: 103
elhobbs wrote:
Discostew wrote:
I've been attempting to reduce the amount of input that gets sent to the vertex shader by having the geometry shader handle generating vertices that are a set distance from the single vertex input through the use of uniforms. When using a uniform constant set from within the shader, it works fine, but when I shift it to program code where other uniform functions reside (which are used for the vertex shader) for the designated command list, it displays nothing, even when using the same static values that make up the uniform when it was constant.

Did you take a look at the text.vsh shader in portal3ds? It looks like smea is using a uniform with emitted vertices in the geometry shader.


Took a look at it, and other than a few differences to other things, the actual use of the uniform didn't seem to differ. I then went to examine his gs.c source code, and found out the problem. blargSNES uses an old GPU function of assigning an array of values to a uniform id, which I believe defaults to the vertex shader with no chance of choosing. The newer form allows you to assign whether the uniform gets used for vertex or geometry. I'll see if making the adjustment will work. At the very least, looking over this stuff and making up some adjustment to the overall shader source finally allowed me to use an updated version of aemstro.

Thanks for pointing me to where I could figure this out.

Seems being able to use uniforms for geometry shaders is a new development, because the version of libctru that comes with devkitARM r44 doesn't have the newer uniform function.


Thu Mar 26, 2015 4:25 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
  Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.
Get devkitPro at SourceForge.net. Fast, secure and Free Open Source software downloads