Note that there are some explanatory texts on larger screens.

plurals
  1. POWeird results when compiling in release mode
    primarykey
    data
    text
    <p>I've written a Vector class that I use for my 3D "engine". It works just like intended when compiled in debug mode but when compiled in release mode the colors are completely wrong. Instead of being the colors I specified it becomes a solid color that changes with the camera :s.</p> <p>I've taken pictures to show how it looks like: <a href="http://localhostr.com/file/R4nX4ve/debugmode.PNG" rel="nofollow">debug mode</a> and <a href="http://localhostr.com/file/KwlU5w5/releasemode.PNG" rel="nofollow">release mode</a>. Note that I also use this class for transforming my vertices and that works fine in both debug and release mode.</p> <p>This is how I pass the color vectors to my shader (pseudocode).</p> <pre><code>Vector3 Diffuse = Vector3(0.3f, 0.5f, 1.0f); Vector3 Ambient = Vector3(0.3f, 0.3f, 0.3f); Shaders.SetUniformData("AmbientColor", sizeof(float) * 3, 1, &amp;Ambient); Shaders.SetUniformData("DiffuseColor", sizeof(float) * 3, 1, &amp;Diffuse); </code></pre> <p>Please tell if you need to see more code.</p> <p>And here is my Vector class source code: <a href="http://pastebin.com/spy7FWFg" rel="nofollow">http://pastebin.com/spy7FWFg</a> (had to remove the http:// because I'm only allowed to post 2 hyper links). This have been bothering me for a while so any help is much appreciated.</p> <p><strong>EDIT</strong>: Alright I solved it! Heh it was nothing wrong with the Vector class it was how I sent it to the shaders... </p> <p>The thing is I have 2 functions I've made to pass data to the shaders, the first is the one I showed in the first post and the other (which I was using for real) takes an array of UNIFORM structs (custom struct) and apparently that one didn't work during release mode...</p> <p>Sorry for wasting your time and thanks for your help =)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload