Loading...
Processing Forum
Recent Topics
All Forums
Screen name:
novorobo
novorobo's Profile
3
Posts
1
Responses
0
Followers
Activity Trend
Last 30 days
Last 30 days
Date Interval
From Date :
To Date :
Go
Loading Chart...
Posts
Responses
PM
Show:
All
Discussions
Questions
Expanded view
List view
Private Message
Multiple texture binding in PShader (for 2.0a7 or greater)?
[2 Replies]
12-Aug-2012 08:14 AM
Forum:
Core Library Questions
Hello,
I have a question for the PShader API (maybe not if there is another interface available for this matter).
Is there any way to bind multiple textures to the shader loaded by PApplet.loadShader()?
I'd like to bind 3 or more textures in a shader at once (not a step by step sequence) for the uniform sampler2Ds,
but couldn't find any API with the PShader something like
PShader.set(String argument, PImage texture) or
PShader.set(String argument, PGraphics canvas)...
I found the PShader APIs suggests a great way to approach the GLSL, and
shader(PShader) or filter(PShader) works just fine so I loved to work with them. but,,
Well, I guess there might be language issues and reasons that the API designers didn't allow the ways like this.
Anyway,
Any suggestions for this matter?
(I'm on 2.0a7)
Thanks :)
Setting normals didn't work as I expected.
[1 Reply]
03-Aug-2012 12:37 AM
Forum:
Programming Questions
I created a PShape insance and put some vertices and normals inside,
but found that the normals did not put as I expected.
How does the
PShape.normal(float x, float y, float z)
works?
How the order when I use the function effects?
after the PShape.vertex()?
To order them as I expected, I just used the function
PShape.setNormal(int index, float x, float y, float z);
and it worked clearly, but I want to know they way the 'normal()' works...
Please help.
(i'm in 2.0a7)
Cameras in PGraphics? (for 2.0a7)
[2 Replies]
01-Aug-2012 01:36 AM
Forum:
Core Library Questions
Hello,
I just downloaded the version 2.0a7 and tried some new features in the alpha version of the processing 2.0.
And met some problems with the cameras between parent PApplet and the PGraphics canvas
I expected the function camera(nine floats) works separately, but it did not.
when i used below,
PGraphics canvas = createCanvas(P3D); // in the setup()
canvas.beginDraw();
canvas.camera(float values);
canvas.endDraw();
In this case, it did not work. In other words, the effect of camera weren't applied to the PGraphics Instance.
And when i just use like below,
canvas.beginDraw();
camera(float values); // not canvas.camera()
canvas.endDraw();
the camera worked both PGraphics canvas and the normal (parent) canvas.
<Codes>
PGraphics canvas;
MyModel mMyModel;
void setup() {
size(300, 300, P3D);
canvas = createGraphics(300, 300, P3D);
mMyModel = new MyModel();
mMyModel.init();
}
void draw() {
background(204);
canvas.beginDraw();
canvas.background(0, 0, 0, 100);
canvas.camera(70.0, 35.0, 120.0, 50.0, 50.0, 0.0, 0.0, 1.0, 0.0); // <<< or just canvas()
mMyModel.draw();
canvas.endDraw();
image(canvas, 0, 0);
}
Any help?
Thanks.
// updated
ok, i figured out that the camera function works just fine with the primitives like sphere() by callling
canvas.sphere(20); //
instead of mMyModel.draw();
however, the problem occurs when i define a PShape and draw them by calling shape(PShape)
Inside the mMyModel,
I defined:
PShape instance with some vertices and normal definitions for a cube, and,
void draw() {
shape(model);
}
in it.
«Prev
Next »
Moderate user : novorobo
Forum