<PAGE>   1

                                                                    EXHIBIT 10.4

                          REGISTRATION RIGHTS AGREEMENT


         THIS REGISTRATION RIGHTS AGREEMENT (the "Agreement") is entered into as
of June 28, 2000, by and among MEGAWORLD, INC., a Delaware corporation (the
"Company"), and the undersigned (the "Holder").

                                    Recitals

         WHEREAS, in connection with the sale to the undersigned of shares of
common stock, par value $. 0001 per share (the "Common Stock"), of the Company
pursuant to that certain Common Stock Purchase Agreement (the "Stock Agreement")
by the Company to sell a total of 495,833 shares (the "Shares") of its Common
Stock, at a purchase price of $1.50 per share, the Company has agreed to enter
into this Registration Rights Agreement;

         NOW, THEREFORE, in consideration of the mutual promises and covenants
hereinafter set forth, the parties hereby agree as follows;

1.       Certain Definitions. As used in this Agreement, the following terms
have the following respective meanings:

                       "Best lawful efforts" means the efforts that a prudent
         business person desirous of achieving a result would use under similar
         circumstances to ensure that such result is achieved as expeditiously
         as possible.

                       "Commission" means the Securities and Exchange Commission
         or any other federal agency at the time administering the Securities
         Act.

                       "Common Stock" means the Common Stock, par value $.0001,
         of the Company.

                       "Exchange Act" means the Securities Exchange Act of 1934,
         as amended, or any similar federal statute and the rules and
         regulations of the Commission thereunder, all as the same shall be in
         effect at the time.

                       "Initial Public Offering" means a public offering of
         Common Stock pursuant to a registration statement filed under the
         Securities Act; provided, however, that the term "Initial Public
         Offering" shall not include any offering pursuant to a registration
         statement (i) relating to any capital stock of the Company or options,
         warrants or other rights to acquire any such capital stock issued or to
         be issued primarily to directors, officers or employees of the Company
         or any of its affiliated corporations, (ii) relating to any employee
         benefit plan or interests therein, (iii) filed pursuant to Rule 145
         under the Securities Act or any successor or similar provision, (iv)
         relating principally to any preferred stock or debt securities of the
         Company or (v) relating to the registration statement which the Company
         has agreed to file in connection with its offering to certain creditors
         of Total Building Systems, Inc., a wholly owned subsidiary of the
         Company, in consideration for payment and cancellation of an aggregate
         of approximately $1,000,000 of debt (the "TBS Registration").

                       "Registrable Securities" means any Common Stock of the
         Company issued or issuable by the Company to the Holder pursuant to the
         Stock Agreement, and other securities issued or issuable to the Holder
         in respect of the above upon any stock split, stock dividend,
         recapitalization, or similar event; excluding in all cases, however,
         any Common Stock or other security transferred pursuant to a
         registration statement or pursuant to Rule 144 under the Securities
         Act.

                       The terms "register," "registered" and "registration"
         refer to a registration effected by preparing and filing a registration
         statement in compliance with the Securities Act, and the declaration or
         ordering of the effectiveness of such registration statement.



                                       1
<PAGE>   2

                       "Registration Expenses" means all expenses, other than
         Selling Expenses (as defined below), incurred by the Company in
         complying with Section 2.1 hereof, including, without limitation, all
         registration, qualification and filing fees, exchange listing fees,
         printing expenses, escrow fees, fees and disbursements of counsel for
         the Company, blue sky fees and expenses, the expense of any special
         audits incident to or required by any such registration (but excluding
         the compensation of regular employees of the Company which shall be
         paid in any event by the Company).

                       "Securities Act" means the Securities Act of 1933, as
         amended, or any similar federal statute and the rules and regulations
         of the Commission thereunder, all as the same shall be in effect at the
         time.

                       "Selling Expenses" means all underwriting discounts,
         selling commissions and stock transfer taxes applicable to the
         securities registered by the Holder and, except as set forth above, all
         fees and disbursements of counsel for the Holder.

2.       Piggyback Registration Rights.

         2.1      Company Registration.

                  (a) Notice of Registration. If at any time or from time to
time the Company determines to register on a form that permits the sale of
Registrable Securities a public offering of any of its securities for cash,
either for its own account or the account of a security holder or the Holder,
other than (i) on Form S-4 or S-8 or any successor or similar form, (ii) in
connection with the Initial Public Offering, or before (but not in connection
with) the Initial Public Offering, (iii) relating to any capital stock of the
Company under options, warrants or other rights to acquire any such capital
stock issued or to be issued primarily to directors, officers or employees of
the Company, or any of its subsidiaries or affiliates, (iv) filed pursuant to
Rule 145 under the Securities Act or any successor or similar provision, (v)
relating to any employee benefit plan or interests therein, or (vi) relating
principally to preferred stock or debt securities of the Company, the Company
will:

                       (1) promptly give to the Holder written notice thereof,
         and

                       (2) use its best lawful efforts to include in such
         registration (and any related qualification under blue sky laws or
         other compliance), all the Registrable Securities specified in a
         written request or requests, made within 15 days after receipt of such
         written notice from the Company, by the Holder.

                  (b) Underwriting Agreement. If the Company elects to use an
underwriter and the Holder has requested the inclusion of Registrable Securities
in such registration, the Holder shall enter into an underwriting agreement in
customary form with the managing underwriter selected for such underwriting by
the Company.

                  Notwithstanding anything herein to the contrary, if the
managing underwriter determines that marketing factors require a limitation of
the number of shares to be underwritten or that the amount of securities
requested to be included in such registration (whether by the Company, the
Holder, or other holders of the Company's securities pursuant to any other
rights granted by the Company to demand inclusion of any such securities in such
registration) exceeds the amount of such securities which can be successfully
sold in such offering, the managing underwriter may limit some or all of the
Registrable Securities sought to be registered on behalf of the Holder pursuant
to Paragraph 2.1 above in the following order (such rights are the managing
underwriters' "Cutback Rights"):

                       (A) First, all of the securities offered by holders of
Company securities whose rights to include their securities in such registration
are junior, by their terms, to rights of the Holders hereunder shall be reduced
in proportion to their respective holdings for which registration has been
requested. The Company agrees that except as expressly provided herein, the
rights of the Holders under this Agreement shall not be junior to the
registration rights of any other Company stockholders.



                                       2
<PAGE>   3

                       (B) If, after eliminating all securities described in
paragraph (A) from the proposed registration, a limitation is still required,
the number of Registrable Securities and the number of other Company securities
("Other Registrable Securities") which are held by holders whose right to
register such securities are pari passu (i.e., of equal stature) with the right
of the Holder hereunder to register the Registrable Securities, then the
Registrable Securities and the Other Registrable Securities shall be reduced ,
to the extent required by such limitation, in proportion to the respective
amounts, as nearly as practicable, of Registrable Securities and Other
Registrable Securities requested to be included in such registration by the
Holder and by all holders of such Other Registrable Securities.

                       (C) If the proposed registration is a secondary
registration on behalf of holders of securities of the Company who have the
right to require such registration (and not merely the right to participate in a
registration initiated by another party)("Demand Registration Rights"), and such
registration is pursuant to such Demand Registration Rights, and after
eliminating all securities described in paragraph (A) and (B) from the proposed
registration a limitation is still required, then all of the securities offered
by holders of Demand Registration Rights shall be reduced in proportion to their
respective holdings for which registration has been requested.

                       (1) If the proposed registration is a primary
registration on behalf of the Company in connection with an underwritten public
offering, and after eliminating all securities described in paragraph (A) and
(B) from the proposed registration a limitation is still required, then the
securities proposed to sold by the Company shall be reduced.

         To facilitate the allocation of shares in accordance with the above
provisions, the managing underwriters and the Company may round the number of
shares allocable to the Holder or any Other Registrable Securities Holder to the
nearest 100 shares.

         For purposes of the Cutback Rights, the TBS Registration shall be
deemed to be pursuant to Demand Registration Rights.

                  If the Holder disapproves of the terms of any such
underwriting, the Holder may elect to withdraw his Registrable Securities from
the registration statement covering such offering, by written notice to the
Company and the managing underwriter, delivered not less than seven days before
the effective date of such registration statement. Any Registrable Securities so
withdrawn from such underwriting shall be withdrawn from such registration, and
shall be withdrawn from the market for a period of 120 days after the effective
date of the registration statement relating thereto, or such other period of
time as the underwriters may require.

                  (c) Right to Terminate Registration. The Company has the right
to terminate or withdraw any registration initiated by it under this Section 2.1
prior to the effectiveness of such registration whether or not the Holder has
elected to include securities in such registration.

                  (d) Delay of Registration. No Holder has any right to take any
action to restrain, enjoin or otherwise delay any registration as the result of
any controversy that may arise with respect to the interpretation or
implementation of Section 2.

         2.2 Expenses of Registration. All Registration Expenses shall be borne
by the Company. Unless otherwise agreed by the Company, all Selling Expenses
relating to securities registered on behalf of the Holder shall be borne by the
Holder pro rata on the basis of the number of shares so registered.

         2.3 Registration Procedures. In the case of each registration,
qualification or compliance effected by the Company pursuant to this Agreement
the Company will keep the Holder advised in writing as to the initiation of each
registration, qualification and compliance and as to the completion thereof. At
its expense, the Company will:

                       (1) Subject to Section 2.1(c), prepare and file with the
Commission a registration statement with respect to such securities and use its
best lawful efforts to cause such registration statement to



                                       3
<PAGE>   4

become and remain effective for at least 90 days or until the distribution
described in the Registration Statement has been completed;

                       (2) Furnish to each underwriter such number of copies of
a prospectus, a preliminary prospectus, in conformity with the requirements of
the Securities Act, and such other documents as such underwriter may reasonably
request in order to facilitate the public sale of the shares by such
underwriter, and promptly furnish to each underwriter and the Holder notice of
any stop-order or similar notice issued by the Commission or any state agency
charged with the regulation of securities; and

                       (3) Use its best lawful efforts to cause all Registrable
Securities included in such registration to be listed or authorized for
inclusion on each securities exchange or similar trading system on which similar
securities issued by the Company are then listed or authorized for trading.

         2.4      Indemnification.

                  (a) To the extent permitted by law, the Company will indemnify
the Holder against all claims, losses, expenses, damages and liabilities (or
actions in respect thereto) arising out of or based on any untrue statement (or
alleged untrue statement) of a material fact contained in any prospectus,
offering circular or other document (including any related registration
statement, notification or the like) incident to any such registration, or based
on any omission (or alleged omission) to state therein a material fact required
to be stated therein or necessary to make the statements therein not misleading
in light of the circumstances in which they were made, or any violation by the
Company of any rule or regulation promulgated under the Act or any state
securities law applicable to the Company in connection with any such
registration, and will reimburse the Holder for any reasonable legal and any
other expenses incurred in connection with investigating, defending or settling
any such claim, loss, damage, liability or action, provided that the indemnity
contained in this Section shall not apply to amounts paid in settlement of any
such claim, loss, damage liability or action if such settlement is effected
without the consent of the Company (which consent will not be reasonably
withheld) and provided further that the Company will not be liable in any such
case to the extent that any such claim, loss, damage or liability arises out of
or is based on any untrue statement or omission based upon written information
furnished to the Company by the Holder relating to Holder.

                  (b) The Holder will indemnify the Company, each of its
directors and officers, each legal counsel and independent accountant of the
Company, each person who controls the Company within this meaning of the Act,
and each of its officers, directors and partners against all claims, losses,
expenses, damages and liabilities (or actions in respect thereof) arising out of
or based on any untrue statement (or alleged untrue statement) of a material
fact contained in any such registration statement, prospectus offering circular
or other document, or any omission (or alleged omission) to state therein a
material fact required to be stated therein or necessary to make the statements
therein not misleading in light of the circumstances in which they were made,
and will reimburse the Company, such directors, officers, partners or persons
for any reasonable investigating, defending, or settling any such claim, loss,
damage, liability or action, in each case to the extent, but only to the extent,
that such untrue statement (or alleged untrue statement) or omission (or alleged
omission) relating to Holder (or any owner who is selling pursuant to Holder's
registration rights hereunder) which is made in such registration statement,
prospectus, offering circular or other document in reliance upon and in
conformity with written information furnished to the Company by such Holder
specifically for use therein; and provided further that the indemnity contained
in this paragraph shall not apply to amounts paid in settlement of any such
claim, loss, damage, liability or action if such settlement is effected without
the consent of the Holder (which consent will not be unreasonably withheld).
Absent fraud by the Holder, in no event shall the liability of any Holder under
this Subsection (b) and Subsection (d) below, taken together, exceed the gross
proceeds received by such Holder in connection with such offering.

                  (c) Each party entitled to indemnification under this Section
2.4 (the "Indemnified Party") shall give notice to the party required to provide
indemnification (the "Indemnifying Party") promptly after such Indemnified Party
has actual knowledge of any claim as to which indemnity may be sought, and shall
permit the Indemnifying Party to assume the defense of any such claim or any
litigation resulting therefrom, provided that counsel for the Indemnifying
Party, who shall conduct the defense of such claim or litigation, shall be
approved by the Indemnified Party (whose approval shall not be unreasonably
withheld), and the Indemnified Party may participate in such defense at such
party's expense, and provided further that the failure of any Indemnified Party
to



                                       4
<PAGE>   5

give notice as provided herein shall not relieve the Indemnifying Party of its
obligations hereunder, unless such failure resulted in actual detriment to the
Indemnifying Party. No Indemnifying Party, in the defense of any such claim or
litigation, shall, except with the consent of each Indemnified Party, consent to
entry of any judgment or enter into any settlement which does not include as an
unconditional term thereof the giving by the claimant or plaintiff to such
Indemnified Party of a release from all liability in respect to such claim or
litigation.

                  (d) To provide for just and equitable contribution in
circumstances under which the indemnity contemplated by this Section 2.4 is for
any reason not available under the circumstances provided in this Section 2.4
for such indemnity, the parties entitled to indemnification by the terms thereof
shall contribute to the aggregate losses, liabilities, claims, damages and
expenses of the nature contemplated by such indemnity agreement incurred by the
Company, any seller of Registrable Securities and one or more of the
underwriters, except to the extent that contribution is not permitted under
Section 11(f) of the Securities Act. In determining the amount of contribution
to which the respective parties shall be entitled, there shall be considered the
relative benefits received by each party from the offering of the Registrable
Securities (taking into account the portion of the proceeds of the offering
realized by each), the parties relative knowledge and access to information
concerning the matter with respect to which the claim was asserted, the
opportunity to correct and prevent any statement or omission and any other
equitable considerations appropriate under the circumstances. For purposes of
this Section 2.4(d) each director and each officer of the Company who signed the
registration statement, and each person, if any, who controls the Company or a
seller of Registrable Securities within the meaning of Section 15 of the
Securities Act shall have the same rights to contribution as the Company or a
seller of Registrable Securities, as the case may be.

         2.5      Certain Information.

                       (1) As a condition to exercising the registration rights
provided for herein, the Holder, with respect to any Registrable Securities
included in any registration, shall furnish the Company such information
regarding the Holder and the Registrable Securities as the Company may request
in writing and as shall be required in connection with any registration,
qualification or compliance referred to in Section 2.

                       (2) The Holder, with respect to any Registrable
Securities included in any registration, shall cooperate in good faith with the
Company and its underwriters, if one is used, in connection with such
registration, including placing such shares in escrow or custody to facilitate
the sale and distribution thereof.

                       (3) The Holder, with respect to any Registrable
Securities included in any registration, shall make no further sales or other
dispositions, or offers therefor, of such shares under such registration
statement if, during the effectiveness of such registration statement, the
Holder is informed that an intervening event has occurred which, in the opinion
of counsel to the Company, makes the prospectus included in such registration
statement no longer comply with the Securities Act until such time as the Holder
has received from the Company copies of a new, amended or supplemented
prospectus complying with the Securities Act.

         2.6 Transfer of Registration Rights. The rights granted to the Holder
hereunder may not be assigned or transferred by the Holder.

         2.7 Standstill Agreement. The Holder agrees upon request of the
underwriter(s) managing the Initial Public Offering, not to sell, make any short
sale of, loan, grant any option for the purchase of or otherwise dispose of any
equity securities of the Company (other than those included in the registration
or purchased in the open market) without the prior written consent of such
underwriter(s), for such period of time following the effective date of the
registration statement relating to the Initial Public Offering as may be
requested by the underwriter(s); provided, however, that (i) such request shall
not be for a period extending longer than that applicable to management
shareholders of the Company and shall in no event exceed 180 days; (ii) this
Section 2.7 shall not limit the Holder's right to sell Registrable Securities
pursuant to any piggyback registration right that the Holder may have pursuant
to any registration rights or similar agreement binding upon the Company, and
(iii) any restrictions recommended by the underwriters are no more restrictive
than those imposed on the management shareholders of the Company. The Company
may impose stop-transfer instructions with respect to such securities subject to
the foregoing restriction until the end of said lock-up period.



                                       5
<PAGE>   6

3.       Miscellaneous.

         3.1 Term. The term of this Agreement shall begin on the date of this
Agreement and expire upon the earlier of (i) December 31, 2001 or (ii) at the
time at which the Registrable Securities become eligible to be sold or
transferred pursuant to Rule 144(k), or any successor thereto.

         3.2 GOVERNING LAW. THIS AGREEMENT SHALL BE GOVERNED IN ALL RESPECTS BY
THE LAWS OF THE STATE OF DELAWARE WITHOUT REGARD TO THE CONFLICT OF LAWS
PRINCIPLES THEREOF.

         3.3 Successors and Assigns. Except as otherwise provided herein, the
provisions hereof shall inure to the benefit of and be binding upon, the
successors, assigns, heirs, executors and administrators of the parties hereto.

         3.4 Entire Agreement: Amendment. This Agreement shall constitute the
full and entire understanding and agreement between the parties with regard to
the subject hereof. Except as expressly provided herein, this Agreement, or any
provision hereof may be amended, waived, discharged or terminated upon the
written consent of the Company and the Holder.

         3.5 Notices. Etc. All notices and other communications required or
permitted hereunder shall be in writing and shall be mailed by registered or
certified mail, postage prepaid, or otherwise delivered by hand or by messenger,
including Federal Express or similar courier service, addressed (a) if to the
Holder, at the Holder's address set forth in the Stock Agreement, or (b) if to
the Company, at 6250 N. Houston Rosslyn Road, Houston, Texas 77091, Attn:
Corporate Secretary, or at such other address as the Company shall have
furnished to the other parties hereto.

         Each such notice or other communication shall for all purposes of this
Agreement be treated as effective upon receipt.

         3.6 Delays or Omissions. Except as expressly provided herein, no delay
or omission to exercise any right, power, or remedy accruing to any party to
this Agreement shall impair any such right, power or remedy of such party nor
shall it be construed to be a waiver of any such breach or default, or an
acquiescence therein, or of or in any similar breach or default thereafter
occurring; nor shall any waiver of any single breach or default be deemed a
waiver of any other breach or default theretofore or thereafter occurring. Any
waiver, permit, consent or approval of any kind or character on the part of any
party of any breach or default under this Agreement, or any waiver on the part
of any party of any provisions or conditions of this Agreement, must be in
writing and shall be effective only to the extent specifically set forth in such
writing. All remedies, either under this Agreement or by law or otherwise
afforded to any party to this Agreement, shall be cumulative and not
alternative.

         3.7 Counterparts. This Agreement may be executed in any number of
counterparts, each of which may be executed by less than all of the parties
hereto, each of which shall be enforceable against the parties actually
executing such counterparts, and all of which together shall constitute one
instrument.

         3.8 Validity. In the event that any provisions hereof are held to be
invalid, illegal or against public policy, the remaining provisions hereof shall
not be affected thereby. In such event, the parties hereto shall negotiate in
good faith to modify this Agreement so as to effect the original intent of the
parties as closely as possible with respect to those provisions which were held
to be invalid, illegal or against public policy.

         3.9 Titles and Subtitles. The titles and subtitles used in this
Agreement are used for convenience only and are not to be considered in
construing or interpreting this Agreement.



                                       6
<PAGE>   7

         IN WITNESS WHEREOF, the undersigned or each of their respective duly
authorized officers or representatives have executed this Agreement effective as
of the date first set forth above.

                                    "COMPANY"

                                    MEGAWORLD, INC.

                                    By:
                                       -----------------------------------------
                                             Charles D. McPhail, President


                                    "HOLDER"

                                    MOCKINGBIRD NETWORKS

                                    By:
                                       -----------------------------------------



                                       7