WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 05-27-2018, 10:21 PM
saket saket is offline
Member
 
Join Date: Mar 2015
Posts: 20
Jeff,

I am using the following code to test the effect on my model.

A subset of model with the code file is in attachment. Execute the shader_test.py to see that no effect is applied on the model.

However if I remove "Earth/main_root_L0_X0_Y0" folder then the effect start working.

Code:
import viz,vizfx

viz.go()
model=vizfx.addChild('./Earth/main.osgb')
viz.MainView.setPosition(2270347.75*2, 3137376.25*2, 7425973.0*2)
viz.MainView.lookAt([0,0,0])

composer=vizfx.getComposer()
model.generateEffects(composer=composer)

code="""
Effect {
    Float rmin{value 0}
    Float rmax{value 255}
    Float gmin{value 0}
    Float gmax{value 255}
    Float bmin{value 0}
    Float bmax{value 255}
    Shader{
        BEGIN FinalColor
        float r=(vizfx_VertexColor.r-rmin)*255/(rmax-rmin);
        float g=(vizfx_VertexColor.g-gmin)*255/(gmax-gmin);
        float b=(vizfx_VertexColor.b-bmin)*255/(bmax-bmin);
        gl_FragColor.rgb=vec3(r,g,b);
        END
    }
}
"""

effect=viz.addEffect(code)
model.apply(effect)
model.setUniformFloat('bmin',50)
Attached Files
File Type: zip effect_test.zip (580.9 KB, 1122 views)
Reply With Quote
Reply

Tags
effects, object, post process, shader


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
Crosshatch Post-Processing Effect give away Vaquero Vizard 0 08-03-2016 09:48 PM
anaglyph effect at front view of cave g.vannan Vizard 1 02-03-2015 05:29 AM
retrieve Object names Geoffrey Vizard 11 12-11-2009 04:26 AM
importing a single WRL with many objects. giancamati Vizard 3 12-18-2006 01:13 PM
rotate to object jargon Vizard 1 08-08-2005 12:20 PM


All times are GMT -7. The time now is 09:24 PM.


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