Attachments:

You should leave the ctor arg to new UniformBlock as 3. Why did you change this to 4? With it set to 4 I get a runtime error trying to bind SourceTexture.

This arg refers to the ‘type’ of uniform block being created, where ‘3’ means ‘material’ uniforms, so they get a ‘m_’ prefix. Other uniform types include ‘render’ which have an ‘r_’ prefix and instance which has an ‘i_’ prefix etc. There is no real logic to these I’m just making them up as I go. It’s highly likely there will end up being lighting and scene uniform block types too with “l_” and “s_” prefixes (maybe) and all these uniform block types will eventually get enumed preventing lots of confusion here. The base class of PostEffect should probably be the one creating the uniform block anyway, but the PostEffect system is way underdeveoped and I’m really just experimenting with the shaders right now so it’s likely to stay this way for a while.

Anyway, leaving ctor uniform block type as 3 and SetFloat mousepos enabled I can run the demo and get the same dodgy greenish cube, but shader isn’t using mouse pos yet so that’s what I’d expect.

Yet without the break, it seems to end up at the last breaking case (the final case if there is no earlier break). So with no breaks enabled, the screen always ends up red (per the last line there), even if m_Mode is < 3.

Example is attached — anyone got any idea what’s going wrong here? Is it some later GLSL spec that works differently?? How do I get it to just select a path based on m_Mode?

Note that m_Mode is set by this line (0-3, where 0 is normal RGB), and it can then be changed via -/+ on the main keyboard:

I’m still stuck on this — trying to set an int in the shader, in the existing uniform block, it’s always 0 on the GLSL side. (Have tried checking for both m_Mode and i_Mode!)

I’ve been trying to add another UniformBlock, but I get the impression that’s not the way to handle it. (Am I right in thinking you just have to set the largest data type that’s going to be passed?)

Tried a new UniformBlock using both types 1 (scalar) and 9 (int), but scalar causes textures not to be found (think because it effectively replaces the existing block ?), while int just crashes when I try to call SetInt.

(Assume scalar is same as float?)

So I’m back to what I posted above (see code), which just passes 0 all the time!

I’d come to a similar conclusion on an epic 6-hour debugger-debug session, but it seemed to be failing in the underlying C++ call for WriteStdIn, and as far as I could tell was being called correctly, so sort of lost the trail at that, and I knew you didn’t have 7 to be able to follow it up.

0

Author

Posts

Viewing 12 posts - 1 through 12 (of 12 total)

You must be logged in to reply to this topic.

Search for:

Archives

Archives

Recent Replies

Warning: Cannot modify header information - headers already sent by (output started at /home/monkey2monkeyx/public_html/wp-includes/class.wp-styles.php:242) in /home/monkey2monkeyx/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_wp.class.php on line 220$100 Bounty: MX2 Running on Samsung's Linux on Dex

Warning: Cannot modify header information - headers already sent by (output started at /home/monkey2monkeyx/public_html/wp-includes/class.wp-styles.php:242) in /home/monkey2monkeyx/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_wp.class.php on line 220Need Monkey2 logos as .SVG

Warning: Cannot modify header information - headers already sent by (output started at /home/monkey2monkeyx/public_html/wp-includes/class.wp-styles.php:242) in /home/monkey2monkeyx/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_wp.class.php on line 220Viva Mortis

Warning: Cannot modify header information - headers already sent by (output started at /home/monkey2monkeyx/public_html/wp-includes/class.wp-styles.php:242) in /home/monkey2monkeyx/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_wp.class.php on line 220Viva Mortis

Warning: Cannot modify header information - headers already sent by (output started at /home/monkey2monkeyx/public_html/wp-includes/class.wp-styles.php:242) in /home/monkey2monkeyx/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_wp.class.php on line 220Viva Mortis

What is this?

Monkey2 is an easy to use, cross platform, games oriented programming language from Blitz Research.