Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8544721
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T12:37:44+00:00 2026-06-11T12:37:44+00:00

Im trying to make an app that simulates dice rolls, at the moment everything

  • 0

Im trying to make an app that simulates dice rolls, at the moment everything works fine. Im trying to add a shader for when the user selects a dice, it will put an outline around the selected dice. How im going about this is to render the particular dice scaled up slightly and completely black, then draw the textured dice on top of it to make it look like it has an outline.

The problem im having is that when the shader for drawing the object black is first applied, it draws the black dice fine, but when the textured dice is trying to be drawn over it, it draws it in the wrong place, and draws the wrong dice. The odd thing is it draws it inside one of the other dice on the screen.

If I apply the the same shader to the object twice, everything draws how its supposed to for that particular shader (either all black because of the outline shader or all textured and lit from the normal shader), but when I apply both shaders to the same model, things go wrong.

This class loads the vertices and stuff, and draws the object:
http://pastebin.com/N5aYAtBC

This class manages the shaders:
http://pastebin.com/0bT7ABRu

I’ve left out a lot of code that I feel will have nothing to do with the problem, but if you need more just leave a comment

and when i click on different dice this is what happens (first pic is normal):
https://i.stack.imgur.com/OWImo.jpg

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T12:37:46+00:00Added an answer on June 11, 2026 at 12:37 pm
    glUniformMatrix4fv(toon_mvp, 1, 0, modelViewProjectionMatrix.m);
    glUniform4fv(toon_outline, 1, oc);
    glUseProgram(Toon);
    

    I think you’re handling the uniforms wrong. I pulled out this snippet from your source as an example.

    When you upload a uniform, it only effects the currently bound program (each program has it’s own internal storage of uniforms).

    If you’re expecting ‘toon_mvp’ and ‘toon_outline’ to be available to the program ‘Toon’, they will not be. You need to first bind the program you want to modify, and then modify it’s uniforms after it is bound, not in the other order.

    You’ll probably have to fix this in other places in your code as well.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an app that works fine. I'm trying to make one of the
I am trying to make a little application that simulates the dice. I want
I am trying to make an app that will pass data between two servers
I was wondering : I'm trying to make an app that as a Listview,
I'm trying to make a console app that would monitor some process and restart
I'm trying to make a simple app that sits on the Mac OSX menu
So I'm trying to make a console app that imposes a time limit to
I'm trying to make a very simple updater app that reads current version.txt file
I'm trying to make a tiny OS X app that would start a bash
I am trying to make a web app in Dashcode that uses a range

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.