Treeform's feature requests

Return to Panda Features in Development

Treeform's feature requests

Postby treeform » Fri Aug 07, 2009 3:18 pm

This would probably never get done unless i did it myself. But this is my feature wish list:

Deferred shading pipline
http://en.wikipedia.org/wiki/Deferred_shading
requers the engine itself
requres editor for said shaders
Some thing like this:
http://polyphobia.de/public/tutorials/T ... shader.jpg
.. the features that this should have could easily fill another post. I would write it up later.


Decals
http://www.panda3d.org/phpbb2/viewtopic ... 2722#42722
robust and fast system to place them around either statically or dynamically.


Imposters
http://www.gamedev.net/community/forums ... _id=543409
Volumetric Billboards is currently the leading tech but its tightly coupled with forward or deferred shading that you do.


Quick Collisions
Very fast and temporary quick collision quarry for Ai stuff:
some thing like this:
Code: Select all
# on button press
if collide(Sphere(tree.nodepath,radius=2),Ray(me.nodepath):
    print "me is looking at tree"

Obviously collision done every frame should be done like it is now but some times you just want to do a quick test when users presses the fire button. Always having a hit ray sticking out is inefficient and so is crating collision testers a new every time.


High precession math
(as a feature not default).
NodePaths that have operate in 64 bit doubles larger. Maybe http://www.nongnu.org/hpalib/ (128 bit reals) ? Obviously graphics hardware cannot support that so after the computations are done turn them in 32 bit floats.
Example space ship (camera) is at 100000000000000000.00 and it sees a rock at 100000000000000002.33 all the GPU needs to know is that space ship is at 0 and rock is at 2.33 well inside float32 range while the maths are done in higher precession. It could be just a logical scene graph tied to standard panda3d scene graph that hides nodes out of float32 range.

[NEW]
Integer math.
A lot like High precession math but math primitives that use integers or fixnums for their computation. Such as Vec, Matrix, Quat etc..


Game swf integration
http://tulrich.com/geekstuff/gameswf.html
Play flash files as textures or as your UI screen. Art people love flash files because they can do so much cool stuff with them and they already know the flash editor.

[NEW]
Shader based particle system.
Particle system that uses sharers to do second to second computations.

Egg editor
Ability to move different nodes around, reparent, recolor and retexture. Maybe even create models from scratch. Not very complex just Notepad of 3d editors like Anim8or or Scetchup and to fix up or tweak models quickly or do some egg specific stuff. (maybe moot if we switch 100% to collada)


Ray tracing engine
Sort of like tinyGL but uses one of the open ray tracers to draw panda3d scenes in software. Possobly running its own "shader programs."


----------------------------------

[DONE]
Organize python api into how panda3d is organized internally or some thing a little better.
Code: Select all
Example:

panda3d.audio
panda3d.audio.traits
panda3d.chan
panda3d.char
panda3d.collide
....

and python stuff just like C++ stuff

panda3d.actor
panda3d.autorestart
panda3d.cluster
panda3d.configfiles
panda3d.controls
panda3d.dc.parse
panda3d.dc.parser
panda3d.deadrec
....
Last edited by treeform on Mon Jun 14, 2010 10:27 am, edited 3 times in total.
User avatar
treeform
 
Posts: 2106
Joined: Sat May 05, 2007 5:15 pm
Location: SF, CA

Postby ditus » Fri Aug 07, 2009 6:38 pm

lol, i hope to see it anytime, so start to code treefrom ;)

at my wishlist, a deep intergrated shader support from maya! why to create a wheel new, if there lots around??

maybe you are working with the wrong engine? if you do a bit of research you would find excatly what you want ;)

---
do not copy old ways, create new ways!
is the idea of the lenov diing? no!
the aries is already on build :)
User avatar
ditus
Troll
 
Posts: 277
Joined: Mon Oct 15, 2007 2:15 pm
Location: moon

Postby rdb » Sat Aug 08, 2009 1:12 am

At my wishlist:

- FX pipeline, with support for CgFX shaders and an easier system for managing render passes and postprocessing filters.

- Native collada support

Combining those two we could get support for ColladaFX too, and people will be able to use tools like RenderMonkey or FX Composer to create shaders.

The texture nodes thing that you showed is also on my wishlist - we could extend TextureStage to have more modes like that, and input/output connections to other stages.

About deferred rendering - if I get the FX pipeline stuff done, implementing that will be a lot easier!

Oh, and I forgot one:
- Hardware geometry instancing
rdb
 
Posts: 9442
Joined: Mon Dec 04, 2006 5:58 am
Location: Netherlands

Postby FenrirWolf » Sat Aug 08, 2009 2:49 am

On Quick Collisions... You can emulate this by creating a temporary CollisionTraverser, adding your sphere/ray/etc to it, then traversing it. Something like:

Code: Select all
tempTrav = CollisionTraverser("instaCollide")
tempQueue = CollisionQueueHandler()
tempTrav.addCollider(collisionRay, tempQueue)
tempTrav.traverse(render)
if tempQueue.getNumEntries() > 0:
  processCollision (tempQueue.getEntry(0))


Maybe we could have a convenience function which does this in straight C++ code. The last game engine I used had functions like this -- things like checkRay, checkSphere, etc. which would return a list of scenegraph objects that intersected the given ray/sphere/etc. Not designed for per-frame checks, but great if you wanted to do things like mouse-picking-on-click or to check for things like objects within an explosion blast radius.

I especially like the re-organized Python API. It would mean taking all of the Direct libraries and bringing them into line, though.

Personally, I don't see much need for the Egg editor. I want my art assets to be authoritative, so if I re-generate an Egg from Blender, I don't want to worry about running a fix-up process on the resulting dropped Egg. But, this is more of a work flow issue, I suppose.

I would like to see Pview expanded, though. It would be nice if it allowed you to do things like play multiple animations, display object scale meters, and had a hierarchy browser much like what is in directtools.

I'd also like to see the Particle system get some TLC, as I've already documented here. This obviously includes the Particle Editor Panel.
User avatar
FenrirWolf
 
Posts: 267
Joined: Mon Jun 08, 2009 3:24 pm
Location: Mississippi, US

Postby rdb » Sat Aug 08, 2009 3:14 am

About the collisions: well, I guess we could just expose the CollisionSolid::test_intersection(entry) method to Python.
rdb
 
Posts: 9442
Joined: Mon Dec 04, 2006 5:58 am
Location: Netherlands

Postby MentalDisaster » Sun Aug 09, 2009 2:42 pm

Agree with the most.

Quick collisions is pretty high on my priority list.
Image
Image
Greetz -- Europe!
RIP Michael Jackson
MentalDisaster
 
Posts: 170
Joined: Mon Apr 27, 2009 12:46 pm

Re: Treeform's feature requests

Postby Bradamante » Sun Aug 09, 2009 2:55 pm

Sure agree on this one, even though I don't need it for my own game. I guess an editor that
- imports already prepared egg files and displays them in a hierarchy list
- rotates, positions, scales those egg files in the scene
- swaps UVs
- place tags for lights, water, sound objects
- exports an egg with relative paths only holding other egg objects

would already do a lot of good.

treeform wrote:Egg editor

Ability to move different nodes around, reparent, recolor and retexture. Maybe even create models from scratch. Not very complex just Notepad of 3d editors like Anim8or or Scetchup and to fix up or tweak models quickly or do some egg specific stuff. (maybe moot if we switch 100% to collada)


The other things you proposed are quite advanced. While they might be useful to some, many others just would never get there.

Another thing is particles or the particle editor panel, which afair does not run here on the Mac.

pview could display thing like scale, coordinate arrows and coordinate maxima.
User avatar
Bradamante
 
Posts: 306
Joined: Tue Nov 25, 2008 10:58 am
Location: Leipzig, Germany

Postby Hypnos » Mon Aug 10, 2009 5:35 am

the features Bradamante requests are already in that editor i've worked on.

http://code.google.com/p/panda3d-editor/ (get the svn version)

- replace, modify egg textures & texturestages
- add all kinds of nodes into a scene (particlesystem, models, lights, and more)
- add shaders
- height and texture paint-geomipterrain (seems to be broken with 1.7)
- place lights, sounds

the project was to much to handle alone, so i stopped working on it after several months getting no significant feedback of ppl willing to help working on the core functionality.
Hypnos
 
Posts: 585
Joined: Sat Sep 11, 2004 8:07 am
Location: Zürich, Switzerland

Postby FenrirWolf » Wed Aug 12, 2009 4:56 am

A tiny bit more realtime debug info would be nice! As far as I can tell, all we can see is bounding volumes.

I could have used a normal display with an earlier debugging session*. :)

I'm not sure if it would be best to implement such a thing as a part of NodePath (like show_bounds), or as a render attribute (DebugAttrib?)

(*I know you can display normals using the Egg interface, but not everything is rendered from triangles generated using that, so something a bit more generalized would be needed.)
User avatar
FenrirWolf
 
Posts: 267
Joined: Mon Jun 08, 2009 3:24 pm
Location: Mississippi, US

Postby Bradamante » Wed Aug 12, 2009 11:25 am

I'd like to try that out, but I've never compiled something in my life and I don't plan to do so.

Hypnos wrote:
http://code.google.com/p/panda3d-editor/ (get the svn version)
User avatar
Bradamante
 
Posts: 306
Joined: Tue Nov 25, 2008 10:58 am
Location: Leipzig, Germany

Postby rdb » Wed Aug 12, 2009 11:49 am

It's all Python code and nothing needs to be compiled, don't worry.
rdb
 
Posts: 9442
Joined: Mon Dec 04, 2006 5:58 am
Location: Netherlands

Postby FenrirWolf » Thu Aug 20, 2009 10:28 pm

Oh yeah, let me add this to the list while I am thinking about:

Simple DirectGUI editor, which reads/writes Python snippets (similar to how the ParticleEditor works). Ideally this should include helpers for things like building multiple geom effects for things like buttons.
User avatar
FenrirWolf
 
Posts: 267
Joined: Mon Jun 08, 2009 3:24 pm
Location: Mississippi, US

Re: Treeform's feature requests

Postby rdb » Wed Nov 04, 2009 3:14 pm

treeform wrote:Organize python api into how panda3d is organized internally or some thing a little better.


I've just implemented this and checked it into CVS. As there hasn't been much devblog activity in a while, I wrote another wall of text about the new panda3d.* structure:
http://blog.panda3d.org/?p=22
rdb
 
Posts: 9442
Joined: Mon Dec 04, 2006 5:58 am
Location: Netherlands

Postby treeform » Wed Nov 04, 2009 4:21 pm

This is cool rdb!

I cant comment on blog, it says "date is invalid"
User avatar
treeform
 
Posts: 2106
Joined: Sat May 05, 2007 5:15 pm
Location: SF, CA

Postby rdb » Thu Nov 05, 2009 1:56 am

Why didn't anyone tell me that before?

Fixed now. I had to disable the anti-spam plugin. It worked, but apparently a bit too well. :)
rdb
 
Posts: 9442
Joined: Mon Dec 04, 2006 5:58 am
Location: Netherlands

Postby rdb » Tue Dec 22, 2009 10:38 am

rdb wrote:- Hardware geometry instancing

Checked in support yesterday.
http://blog.panda3d.org/?p=44
rdb
 
Posts: 9442
Joined: Mon Dec 04, 2006 5:58 am
Location: Netherlands

Postby wvd » Fri Dec 25, 2009 9:26 am

Wow, hardware instancing seems to be pretty nice. Good job rdb.
wvd
 
Posts: 36
Joined: Tue Nov 24, 2009 11:24 am

Postby treeform » Tue Feb 02, 2010 2:54 am

I want to add a new feature requests:

1)
Generate a texture from an python array of matrices or vectors that can be passed to the shader so we can do: hardware instancing, GPU skinning, and tons of other things that require this.

2)
Make texture setRam image work for python strings or a long (which is a pointer) from python to interpolate with existing python drawing API's like pygame, cairo, svg and countless others.
User avatar
treeform
 
Posts: 2106
Joined: Sat May 05, 2007 5:15 pm
Location: SF, CA

Postby rdb » Tue Feb 02, 2010 6:48 am

treeform wrote:Generate a texture from an python array of matrices or vectors that can be passed to the shader so we can do: hardware instancing, GPU skinning, and tons of other things that require this.

Better yet: we need support for passing arrays to shaders.

treeform wrote:Make texture setRam image work for python strings or a long (which is a pointer)

Certainly you can do that already. It's not hard to construct a CPTAUchar from that. Furthermore, there is getRamImageAs that can automatically alter the format of the texture for compatibility with libraries like the ones you have mentioned.
rdb
 
Posts: 9442
Joined: Mon Dec 04, 2006 5:58 am
Location: Netherlands

Postby Praios » Tue Feb 02, 2010 9:59 am

you could use numpy for such stuff...
What am I actually talking about? - I don't know...
User avatar
Praios
 
Posts: 234
Joined: Fri Aug 31, 2007 2:23 pm
Location: Germany

Postby treeform » Tue Feb 02, 2010 10:53 am

Certainly you can do that already. It's not hard to construct a CPTAUchar from that. Furthermore, there is getRamImageAs that can automatically alter the format of the texture for compatibility with libraries like the ones you have mentioned.


Could you show me a sample? I tried getting this to work and always failed and you always say its possible.

Code: Select all
#!/usr/bin/env python
import cairo
import pygame
import array
import math
import sys

import direct.directbase.DirectStart
from pandac.PandaModules import *
props = WindowProperties()
props.setSize(512,512)
base.win.requestProperties(props)
screen = loader.loadModel('plane.egg')
screen.setScale(2)
Width, Height = 512, 512

cairoTexture = Texture()
cairoTexture.setFormat(cairoTexture.FRgba8)
screen.setTexture(cairoTexture)
screen.reparentTo(render2d)
cairoTexture.setXSize(Width)
cairoTexture.setYSize(Height)

ptu_data = cairoTexture.newSimpleRamImage(Width,Height)
# start of the fail code?
array_data = array.array('c', ptu_data.getData())
print len(array_data)

for i in range(Width*Height):
    array_data[i] = chr(200)
 
def draw(surface):
    x,y, radius = (250,250, 200)
    ctx = cairo.Context(surface)
    ctx.set_line_width(15)
    ctx.arc(x, y, radius, 0, 2.0 * math.pi)
    ctx.set_source_rgb(0.8, 0.8, 0.8)
    ctx.fill_preserve()
    ctx.set_source_rgb(1, 1, 1)
    ctx.stroke()

   
surface = cairo.ImageSurface.create_for_data (
    array_data,
    cairo.FORMAT_ARGB32,
    Width,
    Height,
    Width*4)

 
def drawall(task):
    draw(surface)
    # fail code after this line::::
    #print cairoTexture.getExpectedRamImageSize()
    #cairoTexture.setRamImage(how(ptu_data))
    return task.cont   

taskMgr.add(drawall, 'draw')
run()
User avatar
treeform
 
Posts: 2106
Joined: Sat May 05, 2007 5:15 pm
Location: SF, CA

Postby rdb » Tue Feb 02, 2010 12:33 pm

Something like:
Code: Select all
buffer = PTAUchar.emptyArray(len(string))
buffer.setData(string)
tex = Texture()
tex.setup2DTexture(see apiref)
tex.setRamImage(buffer)
rdb
 
Posts: 9442
Joined: Mon Dec 04, 2006 5:58 am
Location: Netherlands

Postby treeform » Thu Feb 04, 2010 4:27 pm

That does not work with the sample above.
User avatar
treeform
 
Posts: 2106
Joined: Sat May 05, 2007 5:15 pm
Location: SF, CA

Postby drwr » Thu Feb 04, 2010 6:27 pm

In what way does it fail? The code looks fine to me, and I do that sort of thing all the time.

David
drwr
 
Posts: 11425
Joined: Fri Feb 13, 2004 12:42 pm
Location: Glendale, CA

Re: Treeform's feature requests

Postby jyapayne » Fri Jan 24, 2014 10:43 am

This is the code that works for anyone interested.

Code: Select all
#!/usr/bin/env python
import cairo
import pygame
import array
import math
import sys

import direct.directbase.DirectStart
from pandac.PandaModules import *
props = WindowProperties()
props.setSize(512,512)
base.win.requestProperties(props)
screen = loader.loadModel('./plane.egg.pz')
screen.setScale(2)
Width, Height = 512, 512

cairoTexture = Texture()
cairoTexture.setFormat(cairoTexture.FRgba8)
cairoTexture.setup2dTexture(Width, Height, Texture.CMDefault, Texture.FRgba)

screen.setTexture(cairoTexture)
screen.reparentTo(render2d)

def draw(surface):
    x,y, radius = (250,250, 200)
    ctx = cairo.Context(surface)
    ctx.set_line_width(15)
    ctx.arc(x, y, radius, 0, 2.0 * math.pi)
    ctx.set_source_rgb(0.8, 0.8, 0.8)
    ctx.fill_preserve()
    ctx.set_source_rgb(1, 1, 1)
    ctx.stroke()


surface = cairo.ImageSurface.create(
    cairo.FORMAT_ARGB32,
    Width,
    Height)


def drawall(task):
    draw(surface)
    cairoTexture.setRamImage(surface.get_data())
    return task.cont

taskMgr.add(drawall, 'draw')
run()


And if you want transparency around the circle:
Code: Select all
#!/usr/bin/env python
import cairo
import pygame
import array
import math
import sys

import direct.directbase.DirectStart
from pandac.PandaModules import *
props = WindowProperties()
props.setSize(1024,768)
base.setBackgroundColor(0,1,1,1)
base.cam.setPos(0,-20,0)
base.win.requestProperties(props)
screen = loader.loadModel('./plane.egg.pz')
screen.setTransparency(TransparencyAttrib.MAlpha)
screen.setTwoSided(True)
screen.setScale(2)
Width, Height = 512, 512

cairoTexture = Texture()
cairoTexture.setFormat(cairoTexture.FRgba8)
cairoTexture.setup2dTexture(Width, Height, Texture.CMDefault, Texture.FRgba32)

screen.setTexture(cairoTexture)
screen.reparentTo(render)


def draw(surface):
    x,y, radius = (250,250, 200)
    ctx = cairo.Context(surface)
    ctx.set_operator(cairo.OPERATOR_CLEAR)
    ctx.rectangle(0.0, 0.0, Width, Height)
    ctx.fill()
    ctx.set_operator(cairo.OPERATOR_OVER)
    ctx.set_line_width(15)
    ctx.arc(x, y, radius, 0, 2.0 * math.pi)
    ctx.set_source_rgba(0.8, 0.8, 0.8)
    ctx.fill_preserve()
    ctx.set_source_rgba(1, 1, 1)
    ctx.stroke()


surface = cairo.ImageSurface (
    cairo.FORMAT_ARGB32,
    Width,
    Height)


def drawall(task):
    draw(surface)
    cairoTexture.setRamImage(surface.get_data())
    return task.cont

taskMgr.add(drawall, 'draw')
run()


EDIT: Removed some unnecessary bits to make it less confusing/more efficient.
jyapayne
 
Posts: 1
Joined: Fri Jan 24, 2014 10:41 am


Return to Panda Features in Development

Who is online

Users browsing this forum: No registered users and 0 guests

cron