Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setters don't set #8

Open
karimsa opened this issue Aug 28, 2016 · 8 comments
Open

Setters don't set #8

karimsa opened this issue Aug 28, 2016 · 8 comments

Comments

@karimsa
Copy link

karimsa commented Aug 28, 2016

First off, awesome work on this project! It really looks great.

I am running a modified version of the squareNumbers example (I have tried this on the original code as well):

const monkey = WebMonkeys()

monkey.set('res', [1, 2, 3, 4, 5])
monkey.work(5, 'res(i) := res(i) * res(i);')

console.log(monkey.get('res'))

But the final output seems to be the original 'res' array instead of the squares.

This happens with all of the examples. None of the 'set' statements seem to work for me.

@karimsa karimsa changed the title Single-line loop does not seem to work Setters don't set Aug 28, 2016
@VictorTaelin
Copy link
Owner

VictorTaelin commented Aug 28, 2016

Thank you!

Yes, that is unexpected. That same code as you wrote works for me. I even tested on the browser to make sure.

<head>
  <script src="WebMonkeys.js"></script>
</head>
<body>
  <script>
  const monkey = WebMonkeys();

  monkey.set('res', [1, 2, 3, 4, 5])
  monkey.work(5, 'res(i) := res(i) * res(i);')

  console.log(monkey.get('res'))
  </script>
</body>

The HTML above outputs [1, 4, 9, 16, 25] on the console. Does that not happen to you?

Let me know more about your specs, OS, GPU, browser, etc.

@karimsa
Copy link
Author

karimsa commented Aug 28, 2016

It prints [1, 2, 3, 4, 5] for me (in both the browser as well as node).

Device: MacBook Pro (mid-2012)
Graphics: Intel HD Graphics 4000
Browser: Chrome 52.0.2743.116 (64-bit)

@VictorTaelin
Copy link
Owner

VictorTaelin commented Aug 28, 2016

I'm puzzled. No errors on console? What happens on Safari? What about Node.js? Anyone with a similar problem?

@karimsa
Copy link
Author

karimsa commented Aug 28, 2016

Tested with node v6.2.0 and v4.4.7 on the same machine and no luck.
Safari 9.1.1, same machine, no luck.

@karimsa
Copy link
Author

karimsa commented Aug 28, 2016

It seems to work on my iPhone 5S in Chrome. I'm viewing the dev console via weinre.

@VictorTaelin
Copy link
Owner

VictorTaelin commented Aug 28, 2016

That's bad. Without being able to replicate I can't do much. I'm not the most WebGL expert, chances somewhere on the code there are things that aren't 100% cross-platform. I know that because often I see some #ifdefs in other people codes that I didn't know are necessary. I'd love someone with deeper knowledge on the specs to do an overview of the codebase.

About your problem, I'll keep testing and wait it show up in a computer I can access to debug.

@OmarShehata
Copy link

I think I've managed to recreate the bug. I've set up this CodePen to easily test on various devices:

https://codepen.io/omarshe7ta/full/rrOdAB/

On one windows laptop, I see:

1.0000052452087402,
4,
9,
16,
25

Windows 8.
Platform: Win32
Browser User Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36
Context Name: webgl
GL Version: WebGL 1.0 (OpenGL ES 2.0 Chromium)
(According to http://webglreport.com)

On another, I get just:

1,
2,
3,
4,
5

Windows 10.
Platform: Win32
Browser User Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:48.0) Gecko/20100101 Firefox/48.0
Context Name: webgl
GL Version: WebGL 1.0

I'm still looking into it, but I thought I'd post this here to collect more data.

@shaylevi2
Copy link

shaylevi2 commented Mar 3, 2018

Any news on this issue?
I've got the same problem, it doesn't set.

(Windows 10 Chrome 64)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants