Giter Club home page Giter Club logo

ofxfluid's People

Contributors

patriciogonzalezvivo avatar smukkejohan avatar timscaffidi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ofxfluid's Issues

example 0.9.0 error

hi,patric
when i try to use example i have this error:
linker command failed with exit code 1 (use -v to see invocation)

getTexture() to getTextureReference() on Windows

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?

Hi Patricio. Can you help me?

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

unable to get obstacles to work.

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.

velocityBuffer seems to have an odd background

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

screenshot 2016-02-26 08 33 35
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.
screenshot 2016-02-26 08 38 17
second Image: fluid solver with stationary generator and rotating generator.
screenshot 2016-02-26 08 38 20
third Image: including obstacles starts this procedure, you can see a spread of interference from the obstacle affecting the stationary generator.
screenshot 2016-02-26 08 39 00fourth 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.

upgrading to OpenGL 3.2

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

  1. Changed all "texture2DRect()" to "texture()"
  2. Added a vertex shader to all shader objects with "out vec2 texCoordVarying;"
  3. Added "#version 150 in vec2 texCoordVarying; out vec4 outputColor;" to all shaders
  4. Changed all "gl_TexCoord[0]" to "texCoordVarying"
  5. Changed "gl_FragColor" to "outputColor"
  6. Call "bindDefaults();" on all shaders before linking
  7. In main.cpp "settings.setGLVersion(3, 2);

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!

Doesn't work over alpha-blended elements

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.

Can ofxFluid support IOS ?

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 ...

doens't work on mac m1/m2 with openGL higher than 2.1

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.