-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
beginShape should not require call to fill() in order to render #1678
Comments
the warning shouldn't prevent drawing, but it's letting you know that you haven't set a fill color so you may not see the lines. try adding a line before that setting fill: function setup(){
createCanvas(500,500,WEBGL);
}
function draw(){
beginShape();
fill(255, 0, 0);
vertex(100,23,-100);
vertex(200,23,-50);
vertex(150, 45,-100);
endShape();
} @indefinit @mindofmatthew I think this shouldn't be necessary in immediate mode. can we set the default colors to white for fill and black for stroke? |
Can you even make a 'wire mesh' with webGL? I'm attempting to do what Daniel Shiffman did with his procedural generated terrain, but I am also coming up with the same error as OP. However, using fill(255,0,0) will let it compile, but it won't draw the shape to screen. |
Hey has anyone found a fix for this issue? |
Hi, i've got the same issue for my webgl-app (https://scenaristeur.github.io/graphe/):
but when i had
on the line 177 of my script https://github.com/scenaristeur/graphe/blob/master/js/sketch.js my canvas is very, very slow, as described in this issue : #1727 I don't think it's a good solution :-/ |
Man this sucks, I want to use p5 for webgl and this bug is preventing me. Does anyone else know of any alternatives for building 3d webgl content? Maybe three.js or something? |
@JakeSchroeder WebGL mode in p5.js is still pretty much work in progress. If you are looking for something more established now, three.js is a pretty good and popular library to deal with WebGL, you can start there. |
But I want to use WEBGL. Thats the whole point of it haha XD
…On Mon, Apr 17, 2017 at 9:38 PM, Zahir ***@***.***> wrote:
When you do the call to createCanvas, try *not* to add the WEBGL
parameter. Somehow this fixed my problem,
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1678 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AJQkpNGFa2ZGYBgK-ONCV5gb00btnPQgks5rxD5SgaJpZM4K7_Fh>
.
|
The minimal example given by the OP will work if the WEBGL parameter is omitted. However any 3d-oriented functions such as rotateX will then fail. |
Yes, thats because if you omit WEBGL, then you are not using WEBGL to do 3d
things. Which is what I wanted to do. ie; I WANT to use webgl, but p5.js is
not playing nicely with webgl currently
…On Tue, Apr 18, 2017 at 9:31 AM, Zahir ***@***.***> wrote:
The minimal example given by the OP will work if the WEBGL parameter is
omitted. However any 3d-oriented functions such as rotateX will then fail.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1678 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AJQkpMa4Iuq5ccvgCZ2nq8dV6xfPlqcDks5rxOVsgaJpZM4K7_Fh>
.
|
…enderer. uses this.stroke and this.fill methods when the renderer is initialized, so that all necessary gl context side effects also happen.
… housekeeping. made the camera tests use normalMaterial(), instead of default stroke and fill colors. some tests were using basicMaterial(), which no longer exists. Changed to fill() or normalMaterial() as appropriate. remove trailing whitespaces in tests.
…enderer. uses this.stroke and this.fill methods when the renderer is initialized, so that all necessary gl context side effects also happen.
… housekeeping. made the camera tests use normalMaterial(), instead of default stroke and fill colors. some tests were using basicMaterial(), which no longer exists. Changed to fill() or normalMaterial() as appropriate. remove trailing whitespaces in tests.
…enderer. uses this.stroke and this.fill methods when the renderer is initialized, so that all necessary gl context side effects also happen.
… housekeeping. made the camera tests use normalMaterial(), instead of default stroke and fill colors. some tests were using basicMaterial(), which no longer exists. Changed to fill() or normalMaterial() as appropriate. remove trailing whitespaces in tests.
…enderer. uses this.stroke and this.fill methods when the renderer is initialized, so that all necessary gl context side effects also happen. clean up gl tests: - made the camera tests use normalMaterial(), instead of default stroke and fill colors. - some tests were using basicMaterial(), which no longer exists. Changed to fill() or normalMaterial() as appropriate. - remove trailing whitespaces in tests. update conditional in _getCurShader to reflect that interleaving immediate mode and retain mode calls requires changing shaders, even if no change is made to fill color.
…enderer. uses this.stroke and this.fill methods when the renderer is initialized, so that all necessary gl context side effects also happen. clean up gl tests: - made the camera tests use normalMaterial(), instead of default stroke and fill colors. - some tests were using basicMaterial(), which no longer exists. Changed to fill() or normalMaterial() as appropriate. - remove trailing whitespaces in tests. update conditional in _getCurShader to reflect that interleaving immediate mode and retain mode calls requires changing shaders, even if no change is made to fill color.
…enderer. uses this.stroke and this.fill methods when the renderer is initialized, so that all necessary gl context side effects also happen. clean up gl tests: - made the camera tests use normalMaterial(), instead of default stroke and fill colors. - some tests were using basicMaterial(), which no longer exists. Changed to fill() or normalMaterial() as appropriate. - remove trailing whitespaces in tests. update conditional in _getCurShader to reflect that interleaving immediate mode and retain mode calls requires changing shaders, even if no change is made to fill color (so it is not sufficient to just change the shader in fill; would require user to call fill in between rect() and box() calls, for example).
closed with #2088 (comment) |
…enderer. uses this.stroke and this.fill methods when the renderer is initialized, so that all necessary gl context side effects also happen. clean up gl tests: - made the camera tests use normalMaterial(), instead of default stroke and fill colors. - some tests were using basicMaterial(), which no longer exists. Changed to fill() or normalMaterial() as appropriate. - remove trailing whitespaces in tests. update conditional in _getCurShader to reflect that interleaving immediate mode and retain mode calls requires changing shaders, even if no change is made to fill color (so it is not sufficient to just change the shader in fill; would require user to call fill in between rect() and box() calls, for example).
I have a minimal example set up that uses the webgl renderer
Running this produces the following errors:
I'm using the latest version of p5.js (p5.js v0.5.4 October 01, 2016)
The text was updated successfully, but these errors were encountered: