How to render a tex in 3d without applying it as(t) a model?

For example:
I’ve got a grass texture. I want to apply the grass on my flat terrain and use Billboard effect for a realistic feeling(don’t ask). Now the problem:

I don’t want to tell panda everytime “load flat.egg|apply grass.jpeg|place at x,y,z”. It’s a waste of HW resources! I imagine that I’ll tell it only “load grass.jpg[size=59]|create vertexes from grass.jpg’s x,y(0,0) to grass.jpg’s last x,y(32, 32) [/size]|apply to the grass(count) node”

Is it possible? Cos’ I’ve seen this in editors like Game Maker and etc.

[size=75]Please don’t offer me other ways how to do the grass because it’s not only the grass that will be done with just a texture, the whole game will be done that way(texture+billboard effect).[/size]

And there are couple of other problems with the “not good” way to apply it I did not mention here(for shortening).

Once again I am sorry for my english, it’s been written fast so I didn’t have any deep look at my post.

It’s not possible in 3d. You always have to assign your texture to geometry if you want it to be displayed. Talk to the graphics card manufacturers about adding that functionality.

I recommend using the CardMaker class to easily generate a quad to put your texture on. You can find plenty of information about this class on the manual, API and forums.

Thanks for the fast response.

But correct me if I’m wrong:

Cardmaker is a function that converts xy coordinates to xyz?

Also, I am confused about it’s general purpose :neutral_face:

No, CardMaker is a class that can generate a quad (two triangles), you can put those anywhere in the scene and apply a texture to it.

Thanks. :smiley:

And my last question is:

So card = render.attachNewNode(Cardmaker(‘card’).generate()) would simply do all the work, generate two quads. But how do I know/change how big will it be?

Well, you can either do that in the cardmaker interface with setFrame, or afterwards on the card, using setScale.

OK, but wait, setScale works on a non-textured model?


Ok I tested it, it works. but why is it only one sided?




just to fix the transparency :slight_smile:

model.setTransparnacy(True) ? … ansparency

you have exhausted your question limit please deposit 75c

I used

card.setAttrib(TransparencyAttrib.make(TransparencyAttrib.MMultisampleMask ))

Any complaints about the code?

P.S.: You can freely delete the old posts.

Yes, that’s just a long and more complicated way to write:


Note that you also need to configure your framebuffer to use multisampling before this will work.