Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt3D 2.0 (+QML) simple shader doesn't appear to work
Forum Update on Monday, May 27th 2025

Qt3D 2.0 (+QML) simple shader doesn't appear to work

Scheduled Pinned Locked Moved General and Desktop
qt3dqtquick3dqml
1 Posts 1 Posters 772 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    KitizzDev
    wrote on last edited by
    #1

    I have a basic scene using Qt3D 2.0. It has a cube and a Material like in the following code. And the fragment shader just sets fragColor = vec4(1.0, 0.0, 0.0, 1.0). But no matter how I rearrange things, I get the default brown-yellow color. I can confirm that the shaders themselves are being properly loaded.

    Full example project: https://drive.google.com/file/d/0B-ZerBBuuf3tclNDSUNCVWRzNVE/view?usp=sharing

    Material {
        id: material
        effect: Effect {
            techniques: [
                Technique {
                    openGLFilter {
                        api: OpenGLFilter.Desktop
                        profile: OpenGLFilter.Core
                        majorVersion: 3; minorVersion: 1
                    }
    
                    renderPasses: [
                        RenderPass {
                            shaderProgram: ShaderProgram {
                                vertexShaderCode:   loadSource( "qrc:/shader.vert" )
                                fragmentShaderCode: loadSource( "qrc:/shader.frag" )
                            }
                        }
                    ]
                }
            ]
        }
    }
    

    I know I'm working at the bleeding edge. I'm not sure if this is a bug, or something that I'm not quite doing right.

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved