WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 02-15-2012, 08:30 AM
Andy Andy is offline
Member
 
Join Date: Mar 2008
Location: Germany
Posts: 36
geometryshader parameters

Hi,
I want to use a simple geometry shader. How can I set the GEOMETRY_INPUT_TYPE_ARB, GL_GEOMETRY_OUTPUT_TYPE_ARB and GL_GEOMETRY_VERTICES_OUT_ARB parameters?

Code:
#version 120
 
#extension GL_ARB_geometry_shader4 : enable
 
//input GL_TRIANGLES
//output GL_LINE_STRIP
 
varying in vec4 V[3];
varying in vec3 N[3];
 
uniform float nLength;
 
void createNormal( vec3 V, vec3 N )
{
    gl_Position = gl_ModelViewProjectionMatrix * vec4( V, 1.0f );
    EmitVertex();
 
    gl_Position = gl_ModelViewProjectionMatrix * vec4( V + N * nLength, 1.0f );
    EmitVertex();
 
    EndPrimitive();
}
 
void main()
{
    for ( int i = 0; i < 3; ++i )
    {
        createNormal( V[i].xyz, N[i] );
    }
}
Any idear?
Reply With Quote
  #2  
Old 02-15-2012, 08:34 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
You should be able to use the layout modifier in your geometry shader source to specify these parameters. Example:
Code:
#version 330 compatibility
layout(triangles) in;
layout(triangle_strip, max_vertices=3) out;
Reply With Quote
  #3  
Old 02-21-2012, 06:21 AM
Andy Andy is offline
Member
 
Join Date: Mar 2008
Location: Germany
Posts: 36
thanks, it works
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
OSG Text Node Additional Parameters pcatalano Vizard 2 11-01-2011 07:45 AM
Question about serial port mizutani_jun Plug-in development 6 11-21-2010 03:53 PM
Reading in parameters with a published exe Jerry Vizard 1 03-03-2008 09:46 AM


All times are GMT -7. The time now is 11:29 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC