patriciogonzalezvivo / ofxfluid Goto Github PK
View Code? Open in Web Editor NEWGPU Fluid Simulation with a collisions layer
GPU Fluid Simulation with a collisions layer
hi,patric
when i try to use example i have this error:
linker command failed with exit code 1 (use -v to see invocation)
Tried compiling the example on Windows 7 64 bit with oF 0.8.4 and was getting an error related to the use of getTexture() in ofxFluid.cpp. Changing all of those to getTextureReference() seemed to fix the issue. I'm new to oF so figured I'd inquire about it in an issue rather than do a pull. Thoughts?
Hola @patriciogonzalezvivo
I want to implement the oxFluid for my CFD simulations, however I do not know what kind of requirements my computer GPU, and OS need to properly run it. Can you tell me a briefly description please.
thanks Jose
I had thought the problem was the advect fragment shader which does not seem to be initialized in the same format as the others. Currently activating the obstacles will cause the flow mechanism to stop working, even if you include a toggle that turns the obstacles back off afterwards..
I get this error, and I am not sure if it is part of the cause of this or not:
[ error ] ofGLUtils: ofGetGLFormatFromInternal(): unknown internal format 34843, returning GL_RGBA
I tried initializing the advect fragment shader but it failed to compile:
// ADVECT
string fragmentShader = STRINGIFY(uniform sampler2DRect tex0; // Real obstacles
uniform sampler2DRect backbuffer;
uniform sampler2DRect VelocityTexture;
uniform float TimeStep;
uniform float Dissipation;
void main(){
vec2 st = gl_TexCoord[0].st;
float solid = texture2DRect(tex0, st).r;
if (solid > 0.1) {
gl_FragColor = vec4(0.0,0.0,0.0,0.0);
return;
}
vec2 u = texture2DRect(VelocityTexture, st).rg;
vec2 coord = st - TimeStep * u;
gl_FragColor = Dissipation * texture2DRect(backbuffer, coord);
}
);
shader.unload();
shader.setupShaderFromSource(GL_FRAGMENT_SHADER, fragmentShader);
shader.linkProgram();
this throws an error:
[ error ] ofShader: checkProgramLinkStatus(): program failed to link
[ error ] ofShader: ofShader: program reports:
ERROR: Compiled fragment shader was corrupt.
I am still trying to parse the code for how the obstacles are utilized, but perhaps some insight into how you intended them to work would be helpful. I tried using the same shader code as the jacobi shader, but that does not work either.
Thanks.
When I run the example I get this error :
[ error ] ofGLUtils: ofGetGLFormatFromInternal(): unknown internal format 34843, returning GL_RGBA
I have been trying to figure out why the obstacles are not working on my system, and this is what I have come up with to determine the problem. I believe the background of the velocityBuffer is becoming corrupt somehow.This is on a macbook air, but as far as I can see there are no openGL issues, especially since ofxFx works so well for another project I am working on using grayscott diffusion reactions with ofxFx.
I have included 4 images to help demonstrate. You can find them here with explanations: http://gersart.tumblr.com/post/140031884674/example-of-a-fluid-problem-with-ofxfluid-first
First image: The image on the upper right is the velocityBuffer. the image on the lower right is the divergenceBuffer. the background on velocityBuffer is the not completely blank, which is causing problems with the way the divergenceBuffer is created.
second Image: fluid solver with stationary generator and rotating generator.
third Image: including obstacles starts this procedure, you can see a spread of interference from the obstacle affecting the stationary generator.
fourth Image: the aftermath of integrating obstacles within this fluid solver where introduction of an obstacle has destroyed the fluid generators.
I 'think' the problem is the background not being cleared. I have written in the code the drawing of a black rectangle within this image before drawing the obstacle itself. I hope you can help.
I'm trying to run a sketch that uses ofxFluid on a Mac Mini w/ an Intel Iris graphics card and I get no errors, but also see no output. Any idea why this might be? I'll post some graphics card specs in a minute.
I'm attempting to upgrade this to OpenGL 3.2 and running into problems, which isn't surprising because I'm crap with shaders.
What I've done: https://github.com/jeffcrouse/ofxFluid/blob/master/src/ofxFluid.cpp
I've made other little changes, but I was careful to test that everything still works before making the 3.2 changes.
One guess is that I need to change how I'm allocating FBOs, but I'm not sure how... I've tried many things.
Any tips (and/or general tips about migrating to programmable renderer in oF) greatly appreciated.
Thanks!
Works only over solid background or image.
When frambuffer is constructed with layers (alpha blended) the fluid either renders to black screen or doesn't function properly.
The ofxFluid is very cool ~ I have try to use that example on IOS version.But there still many bugs in it .
like Use of undeclared identifier 'GL_RGB16F'
Function definition is not allowed here ...
I changed the main.cpp to work on OF 11.2 on Mac OS Mojave
int main( ){
ofGLFWWindowSettings settings;
settings.setSize(1024, 768);
settings.setGLVersion(2, 1);
ofCreateWindow(settings);
ofRunApp( new testApp());
}
shaders are compliant only with OpenGL 2.1.
I tried to update all the sahders in ofxFluid but it doesn't work. I think the issue is also in ofFX
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.