ちょっとしたテストコードをメモ代わりに置いてます。
tonkotsuboy / testcodes Goto Github PK
View Code? Open in Web Editor NEWテストコード
テストコード
元スレッド
https://twitter.com/tonkotsuboy_com/status/704846328279363585
takahiro(John Smith) @superhoge 21 時間21 時間前
@tonkotsuboy_com @gyoh_k 修正しました。件のAndroid4.1.2や他の端末で問題が直っているか確認してもらえますか。直っていたら、元々動いていたiOSでも引き続き正しく動いているか念のため見てもらえますかhttp://takahirox.github.io/test/examples/#webgl_animation_cloth
鹿野壮(Takeshi Kano) @tonkotsuboy_com 21 時間21 時間前
@superhoge @gyoh_k 拝見しました。getShaderPrecisionFormatメソッドのエラーは消えました!ただ、http://takahirox.github.io/test/examples/webgl_animation_cloth.html のデモ(元々がそうですが)requestAnimationFrame()メソッドを使っているので、ここでエラーが出ますね。
requestAnimationFrame()メソッドがAndroid4.1では非対応な為です。http://caniuse.com/#feat=requestanimationframe
デモを再生することに関して言えば、Android4.3以下のみsetInterval()等で代用すれば大丈夫そうですね。
takahiro(John Smith) @superhoge
@tonkotsuboy_com @gyoh_k 確認ありがとうございます。requestAnimationFrame()の問題はまた別問題ですね。直すならばrequestAnimationFrame()非対応のデバイスでも動くようにexamplesを修正するというissueを投げて議論する必要があるでしょう。
ところで、そちらでrequestAnimationFrame()の部分を修正してデモを再生することは可能でしょうか?今回の修正方法だと(WebGLRendererの引数でprecisionを指定しない限り)precisionがhighpに設定されて、それがモバイルデバイスだと非対応の可能性があるので、修正の仕方を少し変えないといけないかもしれないと 気にしていて、とりあえず今対象としている4.1.2の端末ではどうなるか知りたいのです。まぁmediumpになるようにした方がいいと思っていまして、mrdoobとどう直すか少し話をしようとは思っています。
鹿野壮(Takeshi Kano) @tonkotsuboy_com
@superhoge @gyoh_k そうですね。requestAnimationFrame()は別問題ですね。
試しにこちらでrequestAnimationFrame()を使って実装してみました。
http://tonkotsuboy.github.io/testCodes/160303_android4_webgl_fix/
バグが起こっていたうちの一端末Android4.4(元はAndroid4.0.*)では表示されるようになりました。
しかし、 Android 4.1.2の方では "THREE.WebGLShader: Shader couldn't comile" というエラーにより表示できません。
takahiro(John Smith) @superhoge 20 時間20 時間前
@tonkotsuboy_com @gyoh_k おそらくprecisionの問題ですね。WebGLRendererをnewしてるところの引数にprecision:'mediump'を追加して、4.1.2でもう一度試してもらうことってできますか?
鹿野壮(Takeshi Kano) @tonkotsuboy_com
@superhoge @gyoh_k うーむ、変わらないですねえ。。
http://tonkotsuboy.github.io/testCodes/160303_android4_webgl_fix/
takahiro(John Smith) @superhoge 19 時間19 時間前
@tonkotsuboy_com @gyoh_k コンパイルエラーのログってコンソールに出ませんでしたか?もしprecisionの問題ではないとすると、また別の問題にぶつかっている可能性があります。
鹿野壮(Takeshi Kano)
@superhoge @gyoh_k
コンパイルエラーは以前のものと全く同じです。
takahiro(John Smith)
@superhoge
@tonkotsuboy_com @gyoh_k 3つお願いがあります。件のAndroid4.1.2端末で
おそらくですがprecisionの問題ではないような気がしていて、また新たな別の問題にぶつかっている気がします。その場合、shaderプログラムのコードをdumpして怪しいところを探すなどの作業が必要になってくると思います。
元々のgetShaderPrecisionFormatがないことによるエラーは今回の修正で直っているので、PRを送ることで当初の問題は一旦クローズして、必要ならAndroid4.1.2でshaderのコンパイルエラーが起きたという新たなissueを投げるのがいいのではと思っています。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.