Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

grass texture for ForestWalk #7

Closed
paddywwoof opened this issue Jul 10, 2012 · 17 comments
Closed

grass texture for ForestWalk #7

paddywwoof opened this issue Jul 10, 2012 · 17 comments

Comments

@paddywwoof
Copy link
Collaborator

Tim, ForestWalk is now asking for a grass image file. This might be due to my lack of understanding of how to keep versions in synch but I can't see it in your repo either

@tipam
Copy link
Owner

tipam commented Jul 10, 2012

Sorry Paddy - grass textures now added to textures on master.
Tim

-----Original Message-----
From: paddywwoof [mailto:reply@reply.github.com]
Sent: 10 July 2012 23:42
To: Tim Skillmam
Subject: [pi3d] grass texture for ForestWalk (#7)

Tim, ForestWalk is now asking for a grass image file. This might be due to my lack of understanding of how to keep versions in synch but I can't see it in your repo either


Reply to this email directly or view it on GitHub:
#7


No virus found in this message.
Checked by AVG - www.avg.com
Version: 2012.0.2193 / Virus Database: 2437/5123 - Release Date: 07/10/12

@tipam
Copy link
Owner

tipam commented Jul 11, 2012

Hi Paddy,

I've come to realise that working with OpenGL ES 2.0 (not 1.0 that were currently using) is a lot harder to implement and quite different from what we're doing right now. Have you done anything with ES 2.0? I can't even get a 3D shader plane working in ES 2.0 as the moment!!

Tim

-----Original Message-----
From: paddywwoof [mailto:reply@reply.github.com]
Sent: 10 July 2012 23:42
To: Tim Skillmam
Subject: [pi3d] grass texture for ForestWalk (#7)

Tim, ForestWalk is now asking for a grass image file. This might be due to my lack of understanding of how to keep versions in synch but I can't see it in your repo either


Reply to this email directly or view it on GitHub:
#7


No virus found in this message.
Checked by AVG - www.avg.com
Version: 2012.0.2193 / Virus Database: 2437/5123 - Release Date: 07/10/12

@paddywwoof
Copy link
Collaborator Author

Tim

No the only opengles of any kind I have done is with pi3d, basically looking things up when I want to do something! Presumably you've looked through this http://benosteen.wordpress.com/2012/04/27/using-opengl-es-2-0-on-the-raspberry-pi-without-x-windows/

Are you wanting it to do things with the shader class you added to pi3d? It would be nice to get some bump mapping functionality though it might slow the whole thing down for game playing.

Is there anything I can look into that would help. No point duplicating stuff you're doing.

I can see that making a createPlane object multiple-tileable is a bit messy at this stage so maybe we should stick to other tileable objects (egg files work ok as well as the environment map) It might be better to create a new class createTiledPlane(createPlane) at some stage in the future.

I have tweaked the mouse steering in ForestWalk2.py so there is an additional component from the mouse position relative to the average position so it continues to turn when the mouse is at the screen edges. The fog makes scenery much more realistic. Will push is to my repository at some stage.

uploading some footage to youtube:
http://youtu.be/fHM-KqGmJZE

@tipam
Copy link
Owner

tipam commented Jul 11, 2012

Wow - love the spooky maze game! ... there's a missile helper in Pi3D which you could use for blasting stuff - but no collision detection as yet (although bounding box/sphere collisions are a good start)

As for shader stuff, I've talked to Peter who said he's making an OpenGL ES 2.0 cube demo with shaders - I've spent all afternoon trying to get something 3D with the shaders and failed miserably. Apparently, you've got to manage a lot more but it's worth it in the end. I don't think there will be much slowdown with shader effects - so I'll try and convert Pi3D over once Peter has sent some code (by the weekend hopefully)

I must admit I downloaded the benosteen stuff some time ago but never tried the triangle stuff - may be he's got shaders working in 3D?? I'll take a look.

I've finally got my RPi hooked up to the internet - I've just wired the house to reach it! Now I can push/pull the Git more reliably.

Tim.

-----Original Message-----
From: paddywwoof [mailto:reply@reply.github.com]
Sent: 11 July 2012 18:55
To: Tim Skillmam
Subject: Re: [pi3d] grass texture for ForestWalk (#7)

Tim

No the only opengles of any kind I have done is with pi3d, basically looking things up when I want to do something! Presumably you've looked through this http://benosteen.wordpress.com/2012/04/27/using-opengl-es-2-0-on-the-raspberry-pi-without-x-windows/

Are you wanting it to do things with the shader class you added to pi3d? It would be nice to get some bump mapping functionality though it might slow the whole thing down for game playing.

Is there anything I can look into that would help. No point duplicating stuff you're doing.

I can see that making a createPlane object multiple-tileable is a bit messy at this stage so maybe we should stick to other tileable objects (egg files work ok as well as the environment map) It might be better to create a new class createTiledPlane(createPlane) at some stage in the future.

I have tweaked the mouse steering in ForestWalk2.py so there is an additional component from the mouse position relative to the average position so it continues to turn when the mouse is at the screen edges. The fog makes scenery much more realistic. Will push is to my repository at some stage.

uploading some footage to youtube:
http://youtu.be/fHM-KqGmJZE


Reply to this email directly or view it on GitHub:
#7 (comment)


No virus found in this message.
Checked by AVG - www.avg.com
Version: 2012.0.2193 / Virus Database: 2437/5125 - Release Date: 07/11/12

@paddywwoof
Copy link
Collaborator Author

Tim
Not sent a pull but If you look in my latest commit you will see amazing.py and the required textures. Two things:
I have to do a push and pop matrix before moving and drawing things otherwise the avatar movement scrambles locations (as I found with my egg objects) so maybe these should go in all draw methods.
when the water is first drawn it goes all grey and flickers for a while, not sure why. You can see this by setting the start water depth to a positive value.
Paddy

@tipam
Copy link
Owner

tipam commented Jul 12, 2012

Hi Paddy.

I downloaded the amazing.py demo and it was a lot of fun trying to race to
the end before the water level rose!!

I did come across one or two probs ... I think all the water textures pushed
the memory limit too far - I needed to reset the Pi after each play –
perhaps you could use every other texture for anim? It could be because I'm
not using enough memory for the GPU. Also, I couldnt get the clipPlane
stuff working - I don’t get any rock textures?? May be I've broken it?!

I loved your fog effect and used it in my latest demo RobotWalkabout which
features an avatar 'R2D2' style robot walking around the mars landscape with
a lunar base. I've also updated the environment cube to render more types
of cuboid and added some neat freebie environment tex's.

Tim

-----Original Message-----
From: paddywwoof
[mailto:reply+i-5536649-2002ecdc6428206fe37b3e8425c6e84c0c60c87b-1822521@rep
ly.github.com]
Sent: 12 July 2012 11:30
To: Tim Skillmam
Subject: Re: [pi3d] grass texture for ForestWalk (#7)

Tim
Not sent a pull but If you look in my latest commit you will see amazing.py
and the required textures. Two things:
I have to do a push and pop matrix before moving and drawing things
otherwise the avatar movement scrambles locations (as I found with my egg
objects) so maybe these should go in all draw methods.
when the water is first drawn it goes all grey and flickers for a while,
not sure why. You can see this by setting the start water depth to a
positive value.
Paddy


Reply to this email directly or view it on GitHub:
#7 (comment)


No virus found in this message.
Checked by AVG - www.avg.com
Version: 2012.0.2193 / Virus Database: 2437/5126 - Release Date: 07/11/12

@paddywwoof
Copy link
Collaborator Author

Tim

I realised that I had patched a couple of lines in pi3d to make the tiling work, which I have just also committed. Basically python has to be tricked into not converting to integer by putting a float into the right hand side!!

I haven't run into any problems where I had to reset the pi and I haven't changed any memory settings from the default (is there a command I can run to find out what it's set to?) Maybe it's a byproduct of the pi3d change above, though I can't see why. Certainly worth finding the cause.

I did try animating the water using an egg model but got horrible flicker. It also flickered when I tried to use one createPlane drawn in several places (when more than 10 or so). The createMergeShape is just brilliant!

Did you see the non-functioning effect I mentioned which happens for the first second or two of the water mergeShape's life? (You have to put it above floor level to see it)

Paddy

Did you cheat to get to the end of the maze? I've only managed to get there once (after ages) and then got stuck in a hole! I then added a jump facility using the space bar (only 50 allowed). You can use the jump to get onto the top of the plateau, Very atmospheric.

@paddywwoof
Copy link
Collaborator Author

Tim
PPS, just merged in your current files and, while tidying the conflicts, noticed you had commented out mymap2 with the extra bit on the end: <<, "", 0.0, 0.01) # y position just above other map)>> which makes the tiled texture visible on top of the other image. (also need the float mulitple in UV map part)

Also I see that you have kept LoadModel.py 'pure'. I think you are right to do this (but I've taken the cloning and reparenting out as they're all on top of each other so not visible!) but I will make a LoadModel2.py to demonstrate these features of loadModel as well as the non-matrix method of moving things by simply changing their x,y,z etc. (I still hold that this is more intuitive and understandable for people who don't want to get bogged down in the details of the opengl c functions!)

(had another go at the maze with the map in the corner of the screen and still failed!!!)

@tipam
Copy link
Owner

tipam commented Jul 12, 2012

Hi Paddy,

Sorry if I've mixed things up a bit - I couldn't get it to work for one reason or another so I'll have another go.

Great News! Peter sent me a 3D cone shaded object which opens the door for shader models! I'll start producing a Pi3D based on shaders and pass you a similar interface so you can modify your loaderEgg code later on.

His code is found at www.github.com/peterderivaz/pyopengles

All the best - Tim.

-----Original Message-----
From: paddywwoof [mailto:reply@reply.github.com]
Sent: 12 July 2012 23:15
To: Tim Skillmam
Subject: Re: [pi3d] grass texture for ForestWalk (#7)

Tim
PPS, just merged in your current files and, while tidying the conflicts, noticed you had commented out mymap2 with the extra bit on the end: <<, "", 0.0, 0.01) # y position just above other map)>> which makes the tiled texture visible on top of the other image. (also need the float mulitple in UV map part)

Also I see that you have kept LoadModel.py 'pure'. I think you are right to do this (but I've taken the cloning and reparenting out as they're all on top of each other so not visible!) but I will make a LoadModel2.py to demonstrate these features of loadModel as well as the non-matrix method of moving things by simply changing their x,y,z etc. (I still hold that this is more intuitive and understandable for people who don't want to get bogged down in the details of the opengl c functions!)

(had another go at the maze with the map in the corner of the screen and still failed!!!)


Reply to this email directly or view it on GitHub:
#7 (comment)


No virus found in this message.
Checked by AVG - www.avg.com
Version: 2012.0.2193 / Virus Database: 2437/5127 - Release Date: 07/12/12

@paddywwoof
Copy link
Collaborator Author

Tim

I'm not too sure of the pros and cons of shader models as opposed to models used in pi3d so far but there are a couple of shader applications that I think would be useful: 1, Something that could give a texture to near surfaces that would attenuate with distance - bump map like. 2. Something that would make a model become more transparent with distance - clip plane but without a hard edge. Also things that could give a reflection effect metallic look etc would be handy.

Happy to look into an aspect of this if it would help, but will probably wait for you to publish something.

PS I tried running some of the example scripts directly rather than from a terminal window and found that the 3d ones left the pi in an unusable state when they exited. i.e. I had to pull the plug and reboot. The 2d ones seemed to be ok. Not sure why. Did you overcome the issues with amazing.py etc?

@tipam
Copy link
Owner

tipam commented Jul 13, 2012

Hi Paddy - do you mean you ran compiled scripts that made it hang? I must admit I've only ever run them from the terminal window.
Is this something that has just occurred in the latest release??

As for shaders, I've managed to get the shapes working although it's going to take some work replacing all the Pi3D functions - good thing it hasn’t got too huge. However, all the matrix stuff will need to be handwritten although Peter has really covered a lot of it already in his cone example. I'll try to get Pi3D(2) operating in the same way as v1. All the models are VBO's so each vertex describes [x,y,z,nx,yx,nz,tx,ty] for position, normal and texcoords. Again, Peter has put some really neat routines to contruct VBO's including automatic normal generation.

I'm just getting a texture and light shader working and then were in business!

Tim

-----Original Message-----
From: paddywwoof [mailto:reply@reply.github.com]
Sent: 13 July 2012 22:46
To: Tim Skillmam
Subject: Re: [pi3d] grass texture for ForestWalk (#7)

Tim

I'm not too sure of the pros and cons of shader models as opposed to models used in pi3d so far but there are a couple of shader applications that I think would be useful: 1, Something that could give a texture to near surfaces that would attenuate with distance - bump map like. 2. Something that would make a model become more transparent with distance - clip plane but without a hard edge. Also things that could give a reflection effect metallic look etc would be handy.

Happy to look into an aspect of this if it would help, but will probably wait for you to publish something.

PS I tried running some of the example scripts directly rather than from a terminal window and found that the 3d ones left the pi in an unusable state when they exited. i.e. I had to pull the plug and reboot. The 2d ones seemed to be ok. Not sure why. Did you overcome the issues with amazing.py etc?


Reply to this email directly or view it on GitHub:
#7 (comment)


No virus found in this message.
Checked by AVG - www.avg.com
Version: 2012.0.2195 / Virus Database: 2437/5129 - Release Date: 07/13/12

@paddywwoof
Copy link
Collaborator Author

Tim, Straight after logging in just typed 'python ForestWalk.py' etc. Each example loaded significantly faster (and might even have run smoother) but when I quitted I couldn't get back to the linux prompt (must have tried every combination of shift, control, alt and key plus words like quit, exit...) However Clouds3d.py stopped fine. I have a feeling that something like this has always been an issue but, like you, I have got into the habit of running everything in a terminal window. I suspect the terminal window hangs after running a 3d py but I just shut the window!

Will the shader version run faster or is it just a better (more flexible) way of doing it? So long as the class and method names and arguments are the same the conversion can happen behind the scenes without upsetting the apple cart. (Probably even more justification for keeping all (or as much as possible) of the matrix stuff 'hidden' inside the library so users just move things and cameras around. I think this would be a nicer way to do the camera/avatar i.e. have a class to contain rot, tilt etc and have a move method to hide the matrix bits)

I have thought a bit about how to make the loadModel more integrated with the other shapes and to be able to use the merge techniques but I don't think it's compatible with having multiple sub-objects each with a different texture.

@pabloav
Copy link

pabloav commented Jul 14, 2012

I believe the issue with the command prompt has to do with reading
keys. I believe there's a line in many of the demos
"display.getKeys()". If you comment it out it doesn't mess up the
terminal.

@tipam
Copy link
Owner

tipam commented Jul 14, 2012

... I must admit I've been very lazy in not clearing up the textures afterwards - I should be deleting them all before exit else they stay there in the GPU. Perhaps terminal clears this up whereas python by itself wont?? I'll fix this soon.

I've got some nice per-pixel shaded, texture rendering working although I've still got one or two problems with matrices.

Tim

-----Original Message-----
From: paddywwoof [mailto:reply@reply.github.com]
Sent: 14 July 2012 09:25
To: Tim Skillmam
Subject: Re: [pi3d] grass texture for ForestWalk (#7)

Tim, Straight after logging in just typed 'python ForestWalk.py' etc. Each example loaded significantly faster (and might even have run smoother) but when I quitted I couldn't get back to the linux prompt (must have tried every combination of shift, control, alt and key plus words like quit, exit...) However Clouds3d.py stopped fine. I have a feeling that something like this has always been an issue but, like you, I have got into the habit of running everything in a terminal window. I suspect the terminal window hangs after running a 3d py but I just shut the window!

Will the shader version run faster or is it just a better (more flexible) way of doing it? So long as the class and method names and arguments are the same the conversion can happen behind the scenes without upsetting the apple cart. (Probably even more justification for keeping all (or as much as possible) of the matrix stuff 'hidden' inside the library so users just move things and cameras around. I think this would be a nicer way to do the camera/avatar i.e. have a class to contain rot, tilt etc and have a move method to hide the matrix bits)

I have thought a bit about how to make the loadModel more integrated with the other shapes and to be able to use the merge techniques but I don't think it's compatible with having multiple sub-objects each with a different texture.


Reply to this email directly or view it on GitHub:
#7 (comment)


No virus found in this message.
Checked by AVG - www.avg.com
Version: 2012.0.2195 / Virus Database: 2437/5130 - Release Date: 07/13/12

@tipam
Copy link
Owner

tipam commented Jul 14, 2012

Pabloav ... you could be right - but something is need for reading the keys! I'll take a look.
Tim

-----Original Message-----
From: pabloav [mailto:reply@reply.github.com]
Sent: 14 July 2012 13:19
To: Tim Skillmam
Subject: Re: [pi3d] grass texture for ForestWalk (#7)

I believe the issue with the command prompt has to do with reading keys. I believe there's a line in many of the demos "display.getKeys()". If you comment it out it doesn't mess up the terminal.


Reply to this email directly or view it on GitHub:
#7 (comment)


No virus found in this message.
Checked by AVG - www.avg.com
Version: 2012.0.2195 / Virus Database: 2437/5130 - Release Date: 07/13/12

@paddywwoof
Copy link
Collaborator Author

Yes. not completely clear as some have the getKeys stuff but still exit cleanly so it could well have something to do with textures:
Clouds3d.py back to the normal prompt and carriage return works
LoadModel.py back to the normal prompt but random location on screen, no typed characters show on screen (but still get executed) and carriage return in program printing doesn't work (just line feeds)
ForestWalk.py, amazing.py leave a blank screen from which it doesn't seem possible to escape.
The only way to escape from LoadModel.py is CtrlC but I don't think this is relevant because in LoadModel2.py I left the getkey so Esc works but both programs seem to behave the same.

@rec
Copy link
Collaborator

rec commented Dec 19, 2012

I believe we can close this...?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants