Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: RenderMonkey inspired GLSL editor for linux?

Hybrid View

  1. #1
    Junior Member Newbie
    Join Date
    Jun 2011
    Location
    Sweden
    Posts
    18

    RenderMonkey inspired GLSL editor for linux?

    Hi!

    I'm working on a (very basic) OpenGL graphics engine using the programmable pipeline.
    You can get some more info about it on my blog
    deorbit
    (The link URL contain the word "renderman", which of course is something different.)

    RenderMonkey was in my view a fantastic tool for prototyping and writing shader code, but the project has been discontinued for quite a while and the application is not for linux.

    Now I'm thinking of a use for my simple graphics engine and one idea is to create an open source alternative for linux (initially). One reason for the abandonment of such IDE's/tools was, if I've understood it correctly, that the lack of fixed functionality (and variables) in modern OpenGL makes it difficult to create a general tool. More specific, since the general vertex attributes are arbitrary nowadays, the application does not know what to expect. The stream mapping in RenderMonkey 1.82 seems to work good for common cases (except for the TEXCOORD, which I haven't got working), and maybe there are variations of their mapping solution which could work.

    I'm curious about how interesting this idea is to you. Would it be a project worth of further investigation and something to pursue? Why or why not?

    Please tell me your thoughts and if you follow my link above you can vote in a poll.

  2. #2
    Junior Member Regular Contributor
    Join Date
    Jan 2011
    Location
    Paris, France
    Posts
    231

    Re: RenderMonkey inspired GLSL editor for linux?

    100% of votes are "Yeah! Do it!"
    (but ok, it's only 10 votes ...)

    This can effectively to*be a good thing, so I'm OK for to work with you for to implement this on the Linux platform
    (I think too that this can be a good thing to implement this for the Android platform ...)

    I have discovered this link http://cumbia.informatik.uni-stuttgart.de/glsldevil/ that seem me already really advanced

    @+
    Yannoo

  3. #3
    Junior Member Newbie
    Join Date
    Jun 2011
    Location
    Sweden
    Posts
    18

    Re: RenderMonkey inspired GLSL editor for linux?

    Great!

    Thank you for your feedback. Yes I know, not so many votes yet. The number of positive votes would have to be one or a couple orders of magnitude greater than that before I believe the effort would be worth it.
    I am very thankful for everyone who has voted so far!

    Don't hesitate to be critical about my idea. I honestly want your opinion.

    glsldevil seems like a promising software with some great features. I haven't heard about it before and hopefully it will evolve!
    It seems to have a different purpose though. I'm aiming of something more like a sandbox in which you can experiment and create, as opposed to the "inspecting" and analyzing approach.

    As for other platforms, it might be a good thing to do an evaluation of the possibilities. If it is simple to port, it should be ported.
    I use CMake for my graphics engine project, which might make things easier.
    In my view, this is a later question, since one has to have something to port first.

    Anyway, I look forward to further reactions and thoughts.

  4. #4
    Advanced Member Frequent Contributor
    Join Date
    Apr 2010
    Location
    Germany
    Posts
    899

    Re: RenderMonkey inspired GLSL editor for linux?

    The absence of a recent tool supporting current OpenGL mechanisms and practices has pained me for a long time now.

    I also started a little shader editor for Linux and I will integrate my renderer which I'm currently developing as part of my diploma thesis. This will enable authoring shaders for a wide range of purposes with, for instance, automatic, customizable shadowmap generation, automatic gbuffer setup for deferred shading and combination of several shaders into one.

    One project which has been intriguing is Lumina. It has been around for a while and can be reached at

    http://sourceforge.net/projects/lumina/

    I can't really confirm that glslDevil is a suitable replacement for RenderMonkey as it is more closely related for instance to gDEBugger, being a GLSL debugging utility. You can edit shaders but I would hardly call it an IDE.

    Anyway, I think good shader authoring tools supporting recent GLSL version will definitely be received well.

  5. #5
    Junior Member Regular Contributor
    Join Date
    Jan 2011
    Location
    Paris, France
    Posts
    231

    Re: RenderMonkey inspired GLSL editor for linux?

    glslDevil is effectively more closely related to OpenGL debugging utility
    (it display the opengl activity generated by an opengl program)
    => so effectively, it cannot to be used as a RenderMonkey inspired GLSL editor for linux

    I have discovered the Lumina project with your link
    => I attempt actually to install it on my Linux Fedora box, but I have a problem with qmake ("bash: qmake: command not found") ... and always the same problem after somes commands such as 'yum install qt* qmake* --skip-broken'


    @+
    Yannoo

  6. #6
    Junior Member Newbie
    Join Date
    Jun 2011
    Location
    Sweden
    Posts
    18

    Re: RenderMonkey inspired GLSL editor for linux?

    You could try to install the full Qt4 SDK (i.e download the installer from Nokia). I installed it in my home directory. For a brief explanation of my solution you could check linsnos, for a post I wrote about it.
    Basically, I use kalternatives to chose the right version of qmake in my system.

  7. #7
    Junior Member Newbie
    Join Date
    Jun 2011
    Location
    Sweden
    Posts
    18

    Re: RenderMonkey inspired GLSL editor for linux?

    Nice! Thank you for the link. I installed and tried Lumina and it seems really good.
    Unfortunately I get segmentation fault as soon as I try any example. It might be a configuration issue. I will look into that.
    The source is from september last year. I hope they continue the development.

    Your own project seems really exciting too. It would be great if you publish your results later on.
    Good luck!

  8. #8
    Junior Member Regular Contributor
    Join Date
    Jan 2011
    Location
    Paris, France
    Posts
    231

    Re: RenderMonkey inspired GLSL editor for linux?

    Hi,


    I begin to work about a lightweight process that alloc shaders, detect shaders modications and delete them.

    I want that it automatically detect the modication of a shader file and automatically recompile the shader in OpenGL with the new file version (because at this moment, the shader used by OpenGL is the old version).

    I think that it's better if this little part can be handled by an little API, because with an API we can easily use it in a bigger project such as a "RenderMonkey like for Linux" **and** this can too to be easily used on smalls and multiples lighweights process
    @+
    Yannoo

  9. #9
    Junior Member Newbie
    Join Date
    Jun 2011
    Location
    Sweden
    Posts
    18

    Re: RenderMonkey inspired GLSL editor for linux?

    I have noticed some need for an application such as the post title suggests, and I lean towards making an effort.
    Maybe there are more channels I can use to investigate the interest?

    In the fall I will do my masters thesis and I will investigate if there are any companies where I live which would be interested in such an application. Of course, most of them should already have in-house tools, but anyway.

    I appreciate all feedback I can get!

  10. #10
    Junior Member Regular Contributor
    Join Date
    Jan 2011
    Location
    Paris, France
    Posts
    231

    Re: RenderMonkey inspired GLSL editor for linux?

    Yes, file modifications are detected with dnotify ...

    Code :
    #define _GNU_SOURCE
    #include <fcntl.h>
    #include <sys/stat.h>
    #include <stdio.h>
    #include <errno.h>
    #include <signal.h>
    #include <stdlib.h>
    #include <string.h>
     
     
    int	fd=0;
    char   *dir=NULL;
    char   *slashPtr=NULL;
     
    struct	stat statBuf;
    struct	sigaction action;
     
    int  	directorychanged=0;
    char 	splitFilename[128];
    char 	filechecked[127];
    time_t	modifiedTime;
     
    int 	isrunning=0;  
    int	filechanged=0;
     
     
    void EventHandlerFunc( int sig )
    {
    	// printf("This is the event Handler when the ./ directory is modified \n" /* , filechecked */ );
    	directorychanged = 1;
    }
     
    void DelayedActionToFileChange()
    {
    	printf("Delayed action after a modification to %s \n", filechecked);
    	filechanged = 0;
    }
     
     
    int InitDetectChange( int argc, char *argv[] )
    {
    	/* Find directory the file is in, or assume the current directory */
    	strncpy( splitFilename, argv[1], 127 );
    	strncpy( filechecked, argv[1], 127 );
    	if( (slashPtr = rindex( splitFilename, '/' )) == NULL ) 
    	{
    		dir = ".";
    	} 
    	else 
    	{
    		*slashPtr = 0;
    		dir = splitFilename;
    	}
     
    	/* Set up the signal handler */
    	action.sa_handler = EventHandlerFunc;
    	sigemptyset( &amp;action.sa_mask );
    	action.sa_flags = SA_RESTART;
    	sigaction( SIGRTMIN, &amp;action, NULL );
     
    	/* Open the directory the file is in */
    	if( (fd = open( dir, O_RDONLY )) < 0 ) 
    	{
    		printf( "Cannot open %s for reading : %s\n", dir, strerror(errno) );
    		exit( -1 );
    	}
     
    	/* Choose the signal I want to receive when the directory content changes */
    	if( fcntl( fd, F_SETSIG, SIGRTMIN) < 0 ) 
    	{
    		printf( "Cannot set signal : %s\n", strerror(errno) );
    		exit( -1 );
    	}
     
    	/* Ask for notification when a modification is made in the directory */
    	if( fcntl( fd, F_NOTIFY, DN_MODIFY|DN_MULTISHOT ) < 0 ) 
    	{
    		printf( "Cannot fcntl %s : %s\n", dir, strerror(errno) );
    		exit( -1 );
    	}
     
    	if( lstat( filechecked, &amp;statBuf ) < 0 ) 
    	{
    		printf( "Cannot lstat %s : %s\n", filechecked, strerror(errno) );	
    		exit( -1 );
    	}
     	modifiedTime = statBuf.st_mtime;
     
    	return fd;
    }
     
     
    int DetectChange(char *filename)
    {
    	if( lstat( filename, &amp;statBuf ) < 0 ) 
    	{
    		printf( "Cannot lstat %s : %s\n", filename, strerror(errno) );	
    		exit( -1 );
    	}
     
    	// If the modification time has changed, the file has been altered
    	if( modifiedTime != statBuf.st_mtime ) 
    	{
    		directorychanged = 1;
    		filechanged = 1;
    		modifiedTime = statBuf.st_mtime;
    		// printf( "File %s has really been modified since the lastest call\n", filename );
     
    	}else{
    		// directorychanged = 0;
    		filechanged = 0;		
    		// printf( "File %s hasn\'t been modified since the later call\n", filename );
    	}
     
    	return filechanged;
    }
     
    void PrintUsage(int argc, char **argv)
    {
    	if( argc != 2 ) 
    	{
    		printf( "Usage: %s filename", argv[0] );
    		exit( -1 );
    	}
     
    	if( lstat( argv[1], &amp;statBuf ) < 0 ) 
    	{
    		printf( "Cannot lstat %s : %s\n", argv[1], strerror(errno) );
    		exit( -1 );
    	}
     
    	if( ! S_ISREG( statBuf.st_mode ) ) 
    	{
    		printf( "%s is not a regular file\n", argv[1] );
    		exit( -1 );
    	}
    }
     
     
    int main( int argc, char *argv[] )
    {
     
    	PrintUsage(argc, argv);
     
    	isrunning = InitDetectChange(argc, argv);
     
    	while( isrunning ) 
    	{
    		/* This demo has nothing to do, so just wait for a signal */
    		sleep(10);
     
    		/* Check the flag which indicates the right signal has been received */
    		if( directorychanged ) 
    		{
    			if( DetectChange(argv[1]) )
    			{
    				sleep(1);
    				DelayedActionToFileChange();
    			}
    		}
    	}
     
    	return 0;	
    }

    But this use lstat( filechecked, &amp;statBuf ) vs modifiedTime too
    => if necessary the dnotify part can to be canceled ...
    (but perhaps with a %CPU increase because it limit really the number of calls to the DetectChange() func ...)

    This is not OpenGL code, this produce only a little executable that detect when the file in argument is modified.

    I think to use separates (but linked) tasks for

    1) edition of shaders

    2) detection of changes in a vertex/fragment shader file

    3) [re]compilation of shaders [that are changed]

    4) execution of a OpenGL task that show edited shaders in action

    The previous code can already be used for to implement the part 2) and the part 3) is't too difficult to make

    But Ok, if the part 4) can certainly to be make without too difficulties, I think that the really hard task is to make the editor ...


    @+
    Yannoo

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •